Checkbox
Checkbox built on bits-ui with support for indeterminate state, labels, and custom children.
Example
Accept terms
State: false
Indeterminate
Disabled
Props
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | 'indeterminate' | false | Checked state (bindable) |
onCheckedChange | (checked: boolean | 'indeterminate') => void | — | Callback when state changes |
disabled | boolean | false | Disable interaction |
label | string | — | Label text |
children | Snippet | — | Custom label content (overrides label prop) |
class | string | — | Additional CSS classes |
Usage
<script>
import { Checkbox } from '@chrissnell/chonky-ui';
let agreed = $state(false);
</script>
<Checkbox bind:checked={agreed} label="I agree" />
<Checkbox checked={'indeterminate'} label="Partial" />