Forms & selection@neumorphism-ui/checkbox

Checkbox

Layers a neumorphic surface over a transparent native input to preserve form submission and browser accessibility. Supports controlled, uncontrolled, and indeterminate states with a shadcn-style onCheckedChange callback.

@neumorphism-ui/checkbox
Registry JSON

Preview

Installation

Installation: checkboxnpx shadcn@latest add @neumorphism-ui/checkbox

The CLI resolves npm dependencies, base tokens, utilities, and component source in order.

New to this Registry? Set up the namespace before continuing.

Usage

Usage: Installationnpx shadcn@latest add @neumorphism-ui/checkbox @neumorphism-ui/label

Import

Checkbox import code
import { Checkbox } from "@/components/ui/checkbox"
import { Label } from "@/components/ui/label"

Example

Checkbox usage code
<div className="flex items-center gap-2">
  <Checkbox id="updates" defaultChecked />
  <Label htmlFor="updates">Receive product updates</Label>
</div>

API Reference

ComponentPropTypeDefaultDescription
Checkboxcheckedboolean | "indeterminate"—The controlled checked or mixed state.
CheckboxdefaultCheckedbooleanfalseThe initial checked state for uncontrolled usage.
CheckboxonCheckedChange(checked: boolean | "indeterminate") => void—Called when the checked state changes.
CheckboxdisabledbooleanfalseDisables input and pointer interaction.
Checkboxname / value / requirednative input props—Native checkbox attributes used for form submission.

Accessibility

  • 01

    A real input[type=checkbox] preserves form submission and keyboard interaction with Space.

  • 02

    Connect Label htmlFor to the Checkbox id, or place Checkbox inside a label.

  • 03

    In the indeterminate state, both aria-checked=mixed and the DOM indeterminate property are set.