Forms

Checkbox

A native checkbox with a styled control. `indeterminate` is a DOM property with no HTML attribute, which is why it needs an effect rather than a prop on the element.

data-scope="checkbox"

Usage

<Checkbox label="Accept terms" onChange={e => set(e.target.checked)} />
<Checkbox v-model="accepted" label="Accept terms" />
<Checkbox bind:checked={accepted} label="Accept terms" />
<ck-checkbox label="Accept terms" [(checked)]="accepted" />

Props

PropTypeDefaultNotes
size"sm" | "md" | "lg""md"Control size.
labelReactNodeLabel text.
invalidbooleanfalseInvalid state.
indeterminatebooleanfalseMixed state.

Prop names are identical in all four frameworks. Only two-way binding differs, and each framework uses its own idiom over the same underlying prop.