Checkbox

Checkbox built on bits-ui with support for indeterminate state, labels, and custom children.

Example

Accept terms

State: false

Indeterminate
Disabled

Props

PropTypeDefaultDescription
checkedboolean | 'indeterminate'falseChecked state (bindable)
onCheckedChange(checked: boolean | 'indeterminate') => voidCallback when state changes
disabledbooleanfalseDisable interaction
labelstringLabel text
childrenSnippetCustom label content (overrides label prop)
classstringAdditional 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" />