Component
Checkbox
A checkbox with its label, including an indeterminate state.
import { Checkbox } from '@loidolt/theme-svelte';
Example
Notes
classlands on the<label>; useinputClassto reach the input.
Props
Generated from the component source, so it cannot drift from the implementation.
| Prop | Type | Default | Notes |
|---|---|---|---|
checked bindable | boolean | false | |
children | Snippet | — | |
class | string | — | class lands on the wrapping <label>; use inputClass to reach the input. |
disabled | boolean | false | |
indeterminate bindable | boolean | false | |
inputClass | string | — | |
label | string | — | Visible text when there are no children. One of children, label or an aria-labelledby in the rest props is required, or the control is unnamed. |
onCheckedChange | (checked: boolean) => void | — | |
ref bindable | HTMLInputElement | null | null |
Plus the attributes of Omit<HTMLInputAttributes, 'type' | 'checked'>, forwarded to the root element.