Componentform0.9 KB gzipZero dependencies
Checkbox
Crisp checkbox with bold checked states.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add checkboxOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { Checkbox } from "@/components/ui/checkbox"; <Checkbox defaultChecked aria-label="Accept terms" />Source code
checkbox.tsx + 2 helpersZero third-party dependencies (3 local files shown in tabs below).
tsxcheckbox.tsx134 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils";import { mergeRefs } from "./lib/react-compat"; export type CheckboxProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onChange" | "value"> & { checked?: boolean; defaultChecked?: boolean; indeterminate?: boolean; onCheckedChange?: (checked: boolean) => void; name?: string; value?: string; required?: boolean;}; const Checkbox = React.forwardRef<HTMLButtonElement, CheckboxProps>( (Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { Checkbox } from "@/components/ui/checkbox"; <Checkbox />| Prop | Type | Description |
|---|---|---|
| checked | boolean | Controlled checked state. |
| defaultChecked | boolean | Uncontrolled initial state (default false). |
| indeterminate | boolean | Toggles indeterminate. (Default: false) |
| onCheckedChange | (checked: boolean) => void | Called when the state changes. |
| name | string | Form field name submitted during form serialization. |
| value | string | Controlled value. (Default: "on") |
| required | boolean | Marks the input as required for native form validation. |