Skip to content

Checkbox ​

States

Loading...

Checkbox: a form control for boolean selection.

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

Import ​

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

Usage ​

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

Properties ​

PropertyAttributeTypeDefaultDescription
checkedcheckedbooleanfalseCurrent checked state (controlled). When set, the component reflects this state and does not manage its own state.
indeterminateindeterminatebooleanfalseDisplays the checkbox in an indeterminate state.
disableddisabledbooleanfalseDisables the checkbox and prevents interaction.
requiredrequiredbooleanfalseMarks the checkbox as required for form validation.
sizesizeSize'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 (uncontrolled). Only used on first render; ignored after mount.
ariaLabelaria-labelstring | nullnullAccessible label for screen readers when no visible label is provided.

Events ​

EventDetailDescription
flint-checkbox-change&#123; checked: boolean; value: string; indeterminate: boolean &#125;Fired when the checked state changes. detail: &#123; checked: boolean; value: string; indeterminate: boolean &#125;

CSS Parts ​

NameDescription
baseThe checkbox's base wrapper label.
controlThe checkbox visual indicator.
labelThe label text element.

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—