GitHubGitHub
← All components
Forms / component

Checkbox

A real checkbox input with an animated draw-in checkmark, indeterminate state, and label.

CheckedIndeterminateDisabled
<Checkbox bind:checked label="Email me when a deployment fails" />

Installation

pnpm add @chanrg/4ui

Import the stylesheet once, at the root of your app:

import '@chanrg/4ui/styles.css';

Usage

import { Checkbox } from '@chanrg/4ui';<Checkbox bind:checked label="Email me when a deployment fails" />

API reference

Props

PropTypeDefaultDescription
checkedboolean ($bindable)falseState.
indeterminatebooleanfalseMixed state for partial selections.
labelstringVisible label text.
onchange(checked) => voidChange callback.

CSS variables

VariableDescription
--4ui-surfacePrimary component surface.
--4ui-textPrimary foreground color.
--4ui-borderDefault control and panel border.

Accessibility

  • Backed by a native input: form submit, label click, and keyboard all work.
  • Checkmark animation disappears under reduced motion.

Dependencies

No runtime component dependencies.