Componentform0.9 KB gzipZero dependencies

Checkbox

Crisp checkbox with bold checked states.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add checkbox

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { Checkbox } from "@/components/ui/checkbox"; <Checkbox defaultChecked aria-label="Accept terms" />

Source code

checkbox.tsx + 2 helpers

Zero 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 />
PropTypeDescription
checkedbooleanControlled checked state.
defaultCheckedbooleanUncontrolled initial state (default false).
indeterminatebooleanToggles indeterminate. (Default: false)
onCheckedChange(checked: boolean) => voidCalled when the state changes.
namestringForm field name submitted during form serialization.
valuestringControlled value. (Default: "on")
requiredbooleanMarks the input as required for native form validation.