Skip to content

Checkbox

Independent choices with checked and unchecked states.

Upstream documentation

Examples

Installation

Run the Ninaero registry command to install the component and its dependencies, including shared theme styles.

Install Checkbox
pnpm dlx shadcn@latest add 'https://ninaero.pages.dev/r/checkbox.json'

Usage

A complete example using the installed component and hook paths.

Checkbox usage
"use client";import { useId } from "react";import { Checkbox } from "@/components/ui/checkbox";import { Label } from "@/components/ui/label";function CheckboxPreview() {  const id = useId();  return (    <div className="flex items-center gap-2">      <Checkbox id={id} defaultChecked />      <Label htmlFor={id}>Include notes</Label>    </div>  );}export default function Demo() {  return <CheckboxPreview />;}

API Reference

Ninaero exports and local defaults are listed below. See the upstream reference for inherited primitive props and additional composition examples.

Checkbox

Checkbox props
CheckboxPrimitive.Root.Props & { sound?: boolean }
sound
true

Source

Registry JSON