Skip to content
LoidoltTheme 0.11.1
Svelte 5

Component

Checkbox

A checkbox with its label, including an indeterminate state.

import { Checkbox } from '@loidolt/theme-svelte';

Example

Notes

  • class lands on the <label>; use inputClass to reach the input.

Props

Generated from the component source, so it cannot drift from the implementation.

Checkbox props
PropTypeDefaultNotes
checked bindablebooleanfalse
children Snippet—
class string—class lands on the wrapping <label>; use inputClass to reach the input.
disabled booleanfalse
indeterminate bindablebooleanfalse
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 bindableHTMLInputElement | nullnull

Plus the attributes of Omit<HTMLInputAttributes, 'type' | 'checked'>, forwarded to the root element.