shoelace/docs/components/checkbox.md

40 wiersze
736 B
Markdown
Czysty Zwykły widok Historia

2020-07-15 21:30:37 +00:00
# Checkbox
[component-header:sl-checkbox]
Checkboxes allow the user to toggle an option on or off.
```html preview
<sl-checkbox>Checkbox</sl-checkbox>
```
2021-05-13 13:11:24 +00:00
?> This component doesn't work with standard forms. Use [`<sl-form>`](/components/form) instead.
2020-07-15 21:30:37 +00:00
## Examples
### Checked
Use the `checked` attribute to activate the checkbox.
```html preview
<sl-checkbox checked>Checked</sl-checkbox>
```
### Indeterminate
Use the `indeterminate` attribute to make the checkbox indeterminate.
```html preview
<sl-checkbox indeterminate>Indeterminate</sl-checkbox>
```
### Disabled
Use the `disabled` attribute to disable the checkbox.
```html preview
<sl-checkbox disabled>Disabled</sl-checkbox>
```
[component-metadata:sl-checkbox]