Checkbox
A Shadcn checkbox projected from the Base checkbox protocol.
Ordinary demos on this page explicitly use Shadcn Rhea, with matching examples. This does not change public compatibility defaults or imply complete browser, native-host or visual acceptance. Neutral Surface/Text atoms retain their own public semantics; the consumer composition supplies the family presentation theme.
Base Checkbox owns the protocol: controlled and uncontrolled checked and indeterminate, activation from pointer and Space, the effective disabled state, focus, and the checkbox role with its mixed accessible state. Root and Indicator are the whole anatomy. The Shadcn layer adds presentation only: the box, its fill, the focus ring, and the disabled treatment.
The Indicator is derived. It reads checked and indeterminate from the nearest Base Checkbox, picks the tick or the dash, and owns no value, focus, or event of its own. Mixed reads before checked, so a checkbox that is both never paints a tick.
The demo below is one composition: unchecked, checked, mixed, disabled-and-checked, and a focusable unchecked box.
Install
Section titled “Install”
npx @proto.ui/cli@latest add wc shadcn-checkbox
Replace wc with react, vue or vue2 to generate the facade for that host.
Omitted boolean props use the defaults below. Passing checked or indeterminate selects controlled mode for that fact; the other fact can stay uncontrolled.
| Prop | Type | Default |
|---|---|---|
checked | boolean undefined | uncontrolled |
defaultChecked | boolean | false |
indeterminate | boolean undefined | uncontrolled |
defaultIndeterminate | boolean | false |
disabled | boolean | false |
Root exposes checked, indeterminate, disabled, hovered, focused, focusVisible, and pressed, plus checkedChange and indeterminateChange. There is no label prop; name the checkbox with composed content.