Skip to content

Commit b4a4efc

Browse files
committed
docs(components): Update document for Switch
Make the document more readable.
1 parent 1c871a0 commit b4a4efc

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

packages/docs/src/pages/components/switch.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Switch
33
---
44

5-
import Note from '../../components/note.js';
5+
import Note from '../../components/note.js'
66

77
# Switch
88

@@ -46,22 +46,21 @@ To show different style based on the input state, you can use
4646

4747
## `labelPosition`
4848

49-
May you want to change the label's position, so there are props
50-
`labelPosition`. Its value can be `'start'`, `'end'`(default).
49+
By default, the switch comes first, with the label to the right of it. If you'd
50+
like to change the ordering, set the `labelPosition` prop to `"start"`, or the
51+
default value, `"end"`.
5152

5253
```jsx live=true
53-
<Switch label="Click Me!" labelPosition='start' />
54+
<Switch label="Use 24-Hour Time" labelPosition="start" />
5455
```
5556

5657
```jsx live=true
57-
<Switch label="Do Not Click Me!" labelPosition='end' />
58+
<Switch label="Auto-Correction" labelPosition="end" />
5859
```
5960

6061
## External label
6162

62-
<Note>
63-
Try to use `labelPosition` prop rather than another Label layer!
64-
</Note>
63+
<Note>Try to use `labelPosition` prop rather than another Label layer.</Note>
6564

6665
Even though the Switch component already renders a label, but you can also
6766
opt-in for an external label instead.
@@ -76,7 +75,8 @@ import { Box, Flex, Label, Switch } from 'theme-ui'
7675
justifyContent: 'space-between',
7776
alignItems: 'center',
7877
py: 4,
79-
}}>
78+
}}
79+
>
8080
<Label htmlFor="enable-email-alerts" sx={{ flex: 1 }}>
8181
Enable email alerts?
8282
</Label>

0 commit comments

Comments
 (0)