Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Show monospace label typography in Toggle migration guide
  • Loading branch information
mirka committed Oct 6, 2026
commit 93665f7ceaf201a9dfe9064b09595ade0dd42b9a
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,22 @@ When the label text is already visible elsewhere, pass a descriptive string and
/>
```

For a custom layout, such as placing the label before the switch, compose `Switch` with [`Field`](?path=/docs/design-system-components-form-primitives-field--docs):
To customize the label typography, compose `Switch` with [`Field`](?path=/docs/design-system-components-form-primitives-field--docs):

```jsx
import { Field, Stack, Switch } from '@wordpress/ui';

<Field.Root
render={ <Stack gap="sm" align="center" justify="space-between" /> }
>
<Field.Label variant="plain">Fixed background</Field.Label>
<Field.Root render={ <Stack gap="sm" align="start" /> }>
<Switch
checked={ hasFixedBackground }
onCheckedChange={ setHasFixedBackground }
/>
<Field.Label
variant="plain"
style={ { fontFamily: 'var(--wpds-typography-font-family-mono)' } }
>
Fixed background
</Field.Label>
</Field.Root>;
```

Expand Down
Loading