Component

Checkbox

A checkbox component with convenience and compound APIs

UI Component

Checkbox

A checkbox component built with Ark UI that supports both a convenience API and a full compound API.

Installation

bash
liminal add checkbox

Usage (convenience)

tsx
import { Checkbox } from "@/components/ui/checkbox";

export default function Example() {
  return <Checkbox label="I accept the terms and conditions" />;
}

Compound API

tsx
import {
  CheckboxRoot,
  CheckboxControl,
  CheckboxLabel,
  CheckboxHiddenInput,
} from "@/components/ui/checkbox";

export default function Example() {
  return (
    <CheckboxRoot className="inline-flex items-center gap-2">
      <CheckboxHiddenInput />
      <CheckboxControl />
      <CheckboxLabel>Subscribe to newsletter</CheckboxLabel>
    </CheckboxRoot>
  );
}