vael-ui v0.3.10

Forms & Inputs

Checkbox

A tri-state toggle for a single yes/no/indeterminate choice.

Install

import { Checkbox } from 'vael-ui'

Playground

import { Checkbox } from 'vael-ui'

<Checkbox label="Checkbox label" :indeterminate="false" :disabled="false" :invalid="false" size="md" name="" motionCss>Checkbox</Checkbox>

Props

NameTypeDefaultDescription
labelstring | undefined
valuestring | number | undefinedOnly meaningful alongside an array model — checked reflects membership.
indeterminateboolean | undefinedfalseProperty, not attribute.
disabledboolean | undefinedfalse
invalidboolean | undefinedfalse
size"md" | "sm""md"
namestring | undefined
motionCssboolean | undefinedtrue`false` skips built-in transitions; use exposed `boxEl`/`checkEl` to drive animation instead.
uiPartial<{ root: UiPartValue; box: UiPartValue; label: UiPartValue; }> | undefined
modelValueboolean | unknown[] | undefinedfalseChecked state. Bind an array instead to toggle this checkbox's `value` prop in/out of it (checkbox-group pattern).

Slots

NameTypeDescription
defaultanyInline label content; overrides the `label` prop text entirely.

Events

NameTypeDescription
update:modelValue[value: boolean | unknown[]]
change[checked: boolean]

Exposed

NameTypeDescription
elHTMLElement | null
inputElHTMLInputElement | null
boxElHTMLElement | null
checkElSVGElement | null