Skip to content

Checkbox

A control allowing the user to toggle between checked and not checked.

API Reference

Installation

pnpm dlx shadcn@latest add @frontal-labs/checkbox

Usage

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

API Reference

Checkbox

Styled wrapper for Checkbox.Root from Base UI. Includes a built-in indicator with a checkmark icon. All props from Checkbox.Root are supported.

In light mode the box carries a bg-muted fill on top of its border, so an unchecked checkbox stays visible against a white surface instead of relying on the border alone. When checked it switches to bg-primary with text-primary-foreground.

Examples

For accessible labelling and validation, prefer using the Field component to wrap checkboxes. See the related example: Checkbox field.

Disabled

With Description

Card Style

Form Integration

Field provides accessible labelling and validation primitives for form controls. Use it with Form to submit values.