Checkbox

A checkbox component with neumorphic styling, built on top of Base UI.

Installation

$ npx shadcn@latest add "/r/checkbox.json"

Usage

With Label

Disabled State

Props

PropTypeDefaultDescription
size"sm" | "md" | "lg""md"The size of the checkbox.
checkedboolean-The controlled checked state of the checkbox.
defaultCheckedboolean-The default checked state when uncontrolled.
onCheckedChange(checked: boolean) => void-Event handler called when the checked state changes.
indeterminateboolean-Whether the checkbox is in an indeterminate state.
disabledbooleanfalseWhether the checkbox is disabled.
classNamestring-Additional CSS classes to apply to the checkbox.