docs(toggle): add "Slottable labels" example

This commit is contained in:
metonym 2022-01-12 16:39:51 -10:00
commit 456f38721e

View file

@ -27,6 +27,15 @@ components: ["Toggle", "ToggleSkeleton"]
<Toggle labelText="Push notifications" labelA="No" labelB="Yes" /> <Toggle labelText="Push notifications" labelA="No" labelB="Yes" />
### Slottable labels
An alternative to the "labelA" and "labelB" props is to use the corresponding named slots.
<Toggle labelText="Push notifications">
<span slot="labelA" style="color: red">No</span>
<span slot="labelB" style="color: green">Yes</span>
</Toggle>
### Disabled ### Disabled
<Toggle labelText="Push notifications" disabled /> <Toggle labelText="Push notifications" disabled />