carbon-components-svelte/docs/src/pages/components/Checkbox.svx
metonym 2657ce71c2
docs: fix formatting, broken link (#1172)
* chore: remove extra space in description comment

* docs(data-table): fix formatting

* docs(checkbox): fix broken link

* chore(deps-dev): bump deps

* Run "yarn build:docs"
2022-03-13 19:03:15 -07:00

46 lines
1.1 KiB
Text

<script>
import { Checkbox, InlineNotification } from "carbon-components-svelte";
import Preview from "../../components/Preview.svelte";
</script>
### Default (unchecked)
<Checkbox labelText="Label text" />
### Checked
<Checkbox labelText="Label text" checked />
### Indeterminate
<Checkbox labelText="Label text" indeterminate />
### Hidden label
<Checkbox labelText="Label text" hideLabel />
### Disabled
<Checkbox labelText="Label text" disabled />
### Reactive example (bind:checked)
The `checked` prop supports two-way binding.
<FileSource src="/framed/Checkbox/CheckboxReactive" />
### Reactive example (bind:group)
An alternative to `checked` is binding an array of values using `group`. This API in inspired by Svelte [group inputs](https://svelte.dev/tutorial/group-inputs).
<InlineNotification svx-ignore lowContrast title="Note:" kind="info" hideCloseButton>
<div class="body-short-01">
If using <strong>bind:group</strong>, <strong>bind:checked</strong> will only support one-way binding.
</div>
</InlineNotification>
<FileSource src="/framed/Checkbox/MultipleCheckboxes" />
### Skeleton
<Checkbox skeleton />