Browse components

Checkbox

Checkbox input with label, focus ring, and controlled/uncontrolled checked state.

atoms

Live example

Default usage you can copy and adapt.

Basic Checkbox

Simple checkbox with label

Loading state

Disable and show a spinner while submitting.

Props

The props you are most likely to need, with types and defaults.

Props / API
NameTypeRequiredDefaultDescription
idstringNogeneratedStable id; generated when omitted
checkedbooleanNofalseControlled checked state (supports bind:checked)
defaultCheckedbooleanNofalseInitial checked state for uncontrolled usage
labelstringNo—Checkbox label
namestringNo—Input name submitted with forms
valuestringNo—Input value submitted with forms
disabledbooleanNofalseDisable the checkbox
loadingbooleanNofalseShows a spinner and disables interaction while true
onChange(event: Event) => voidNoundefinedChange handler (alias: onchange)
onchange(event: Event) => voidNoundefinedAlias for onChange