diff --git a/docs/src/pages/components/Checkbox.svx b/docs/src/pages/components/Checkbox.svx index f5e7f684..8e66285a 100644 --- a/docs/src/pages/components/Checkbox.svx +++ b/docs/src/pages/components/Checkbox.svx @@ -3,39 +3,53 @@ import Preview from "../../components/Preview.svelte"; -## Default (unchecked) +Checkboxes let users select one or more options from a list. Use them for multiple-choice questions, settings, or to confirm actions. + +## Default + +Create a checkbox with a label using `labelText`. + +By default, the checkbox is unchecked. ## Checked +Set `checked` to `true` to pre-select the checkbox. + ## Indeterminate +Set `indeterminate` to `true` to show a mixed state, typically used in parent checkboxes with some children selected. + ## Hidden label +Set `hideLabel` to `true` to visually hide the label while keeping it accessible to screen readers. + -## Disabled +## Disabled state + +Set `disabled` to `true` to prevent user interaction. ## Reactive example (bind:checked) -The `checked` prop supports two-way binding. +Use two-way binding with `bind:checked` to track the checkbox state. ## 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). +Bind an array of values using `group` to manage multiple checkboxes. This API is inspired by Svelte [group inputs](https://svelte.dev/tutorial/group-inputs).
- If using bind:group, bind:checked will only support one-way binding. + When using bind:group, bind:checked only supports one-way binding.
@@ -43,4 +57,6 @@ An alternative to `checked` is binding an array of values using `group`. This AP ## Skeleton +Set `skeleton` to `true` to show a loading state. +