Checkbox

An accessible checkbox component built on top of Radix UI primitives. Supports labels, descriptions, error messages, indeterminate state, and multiple size variants.

Import

import { Checkbox } from '@wavebooking/aqua-fusion';

Preview

Loading preview...

Usage

<Checkbox label="Accept terms" />

<Checkbox
  label="Receive updates"
  description="We will send you weekly newsletters."
  size="lg"
/>

<Checkbox
  label="Invalid field"
  error="This field is required"
  variant="error"
/>

<Checkbox label="Select all" indeterminate />

Props

PropTypeDefaultDescription
labelstring-Label text displayed next to the checkbox.
descriptionstring-Description text rendered below the label.
errorstring-Error message to display. Automatically sets the error variant.
indeterminatebooleanfalseWhether the checkbox is in an indeterminate (partially checked) state.
size'sm' | 'md' | 'lg''md'Size of the checkbox.
variant'default' | 'error''default'Visual variant. Automatically set to error when an error message is provided.
checkedboolean-Controlled checked state of the checkbox.
onCheckedChange(checked: boolean) => void-Callback fired when the checked state changes.
disabledbooleanfalseWhether the checkbox is disabled.
idstring-HTML id attribute. Auto-generated if not provided.
classNamestring-Additional CSS classes to apply to the checkbox root.

The component also accepts all Radix UI Checkbox.Root props except children.