docs(toggle): add "Hidden label text" example

This commit is contained in:
Eric Liu 2022-07-26 07:07:40 -07:00
commit ece62887e2

View file

@ -23,6 +23,12 @@ components: ["Toggle", "ToggleSkeleton"]
<Toggle labelText="Push notifications" on:toggle={e => console.log(e.detail)} /> <Toggle labelText="Push notifications" on:toggle={e => console.log(e.detail)} />
### Hidden label text
Set `hideLabel` to `true` to visually hide the label text. It's recommended to still specify `labelText` for screen reader accessibility.
<Toggle labelText="Push notifications" hideLabel />
### Custom labels ### Custom labels
<Toggle labelText="Push notifications" labelA="No" labelB="Yes" /> <Toggle labelText="Push notifications" labelA="No" labelB="Yes" />