kopia lustrzana https://github.com/shoelace-style/shoelace
33 wiersze
549 B
Markdown
33 wiersze
549 B
Markdown
|
# Switch
|
||
|
|
||
|
[component-header:sl-switch]
|
||
|
|
||
|
Switches allow the user to toggle an option on or off.
|
||
|
|
||
|
```html preview
|
||
|
<sl-switch>Switch</sl-switch>
|
||
|
```
|
||
|
|
||
|
?> This component doesn't work with standard forms. Use [`<sl-form>`](/components/form.md) instead.
|
||
|
|
||
|
## Examples
|
||
|
|
||
|
### Checked
|
||
|
|
||
|
Use the `checked` attribute to activate the switch.
|
||
|
|
||
|
```html preview
|
||
|
<sl-switch checked>Checked</sl-switch>
|
||
|
```
|
||
|
|
||
|
### Disabled
|
||
|
|
||
|
Use the `disabled` attribute to disable the switch.
|
||
|
|
||
|
```html preview
|
||
|
<sl-switch disabled>Disabled</sl-switch>
|
||
|
```
|
||
|
|
||
|
|
||
|
[component-metadata:sl-switch]
|