Ballmac UI home

Checkbox

A Radix checkbox with checked and indeterminate (mixed) states, a check or minus icon, focus ring and invalid styling, for forms and select-all lists.

You agree to our Terms of Service and Privacy Policy.

Installation

$ pnpm dlx shadcn@latest add @ballmac/checkbox

Usage

import { Checkbox } from "@/components/ballmac/checkbox"

The full example is in the Code tab above.

Examples

Select all

Notify me about
2/4

Accessibility

KeyAction
SpaceToggles the checkbox
TabMoves focus to the checkbox

Use with AI

Binary or tri-state choice. Pass checked="indeterminate" for a parent row whose children are partly selected; aria-checked becomes "mixed". Pair with Label via id/htmlFor. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Checkbox (@ballmac/checkbox) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Agreeing to terms or opting into emails
  • Multi-select lists and table row selection
  • A select-all control that reflects partial selection

Not for

  • Settings that apply immediately (use switch)
  • Choosing exactly one option from several (use a radio group or select)

Registry JSON: https://ui.ballmac.com/r/checkbox.json

Credits

Based on shadcn/ui Checkbox, adapted by Ballmac. Free to use in personal and commercial projects.

Registry
shadcn/utils