Skip to content

Checkbox ​

States

Loading...

Checkbox: a form control for boolean selection.

  • Tag: <flint-checkbox>
  • Class: FlintCheckbox

Import ​

ts
import 'flint-ui'; // auto-registers all
// or
import { FlintCheckbox } from 'flint-ui';

Usage ​

html
<flint-checkbox></flint-checkbox>

Properties ​

PropertyAttributeTypeDefaultDescription
checkedcheckedbooleanfalseWhether the checkbox is checked.
indeterminateindeterminatebooleanfalseDisplays the checkbox in an indeterminate state.
disableddisabledbooleanfalseDisables the checkbox and prevents interaction.
requiredrequiredbooleanfalseMarks the checkbox as required for form validation.
sizesize'sm' | 'md' | 'lg''md'Size of the checkbox control.
labellabelstring''Visible label text displayed next to the checkbox.
namenamestring''Form field name used when submitting form data.
valuevaluestring'on'Value submitted with form data when checked.
defaultCheckeddefault-checkedbooleanfalseInitial checked state for uncontrolled usage.
ariaLabelaria-labelstring | nullnullAccessible label for screen readers when no visible label is provided.

Events ​

EventDetailDescription
flint-checkbox-change—Fired when the checked state changes.

CSS Custom Properties ​

PropertyDefault
--flint-checkbox-size18px
--flint-checkbox-border-radiusvar(--flint-border-radius-sm
--flint-checkbox-gap8px
--flint-checkbox-size-sm14px
--flint-checkbox-size-lg22px
--flint-checkbox-icon-size12px
--flint-checkbox-icon-size-sm10px
--flint-checkbox-icon-size-lg16px
--flint-checkbox-label-font-size14px
--flint-checkbox-label-font-size-sm12px
--flint-checkbox-label-font-size-lg16px
--flint-font-family—
--flint-text-color—
--flint-input-border-color—
--flint-surface-1—
--flint-primary-color—
--flint-text-color-on-primary—