{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "checkbox",
  "title": "Checkbox",
  "author": "Ballmac <https://ui.ballmac.com>",
  "description": "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.",
  "dependencies": [
    "radix-ui",
    "lucide-react"
  ],
  "registryDependencies": [
    "utils"
  ],
  "files": [
    {
      "path": "registry/ballmac/components/checkbox.tsx",
      "content": "// Ballmac UI: Checkbox. https://ui.ballmac.com/components/checkbox\n// Based on shadcn/ui's Checkbox (MIT, Copyright (c) 2023 shadcn), restyled with an indeterminate state.\n\"use client\"\n\nimport * as React from \"react\"\nimport { CheckIcon, MinusIcon } from \"lucide-react\"\nimport { Checkbox as CheckboxPrimitive } from \"radix-ui\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype CheckboxProps = React.ComponentProps<typeof CheckboxPrimitive.Root>\n\nfunction Checkbox({ className, ...props }: CheckboxProps) {\n  return (\n    <CheckboxPrimitive.Root\n      data-slot=\"checkbox\"\n      className={cn(\n        \"peer relative size-4 shrink-0 rounded-[4px] border border-input bg-background shadow-xs outline-none transition-[color,background-color,border-color,box-shadow] duration-150 dark:bg-input/30\",\n        \"after:absolute after:-inset-2 after:content-['']\",\n        \"hover:border-foreground/30 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50\",\n        \"disabled:cursor-not-allowed disabled:opacity-50\",\n        \"aria-invalid:border-destructive aria-invalid:ring-destructive/20\",\n        \"data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground\",\n        \"data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground\",\n        className\n      )}\n      {...props}\n    >\n      <CheckboxPrimitive.Indicator\n        data-slot=\"checkbox-indicator\"\n        className=\"group/indicator flex items-center justify-center text-current transition-none\"\n      >\n        <CheckIcon className=\"size-3.5 group-data-[state=indeterminate]/indicator:hidden\" strokeWidth={3} aria-hidden=\"true\" />\n        <MinusIcon className=\"hidden size-3.5 group-data-[state=indeterminate]/indicator:block\" strokeWidth={3} aria-hidden=\"true\" />\n      </CheckboxPrimitive.Indicator>\n    </CheckboxPrimitive.Root>\n  )\n}\n\nexport { Checkbox, type CheckboxProps }\n",
      "type": "registry:ui",
      "target": "@components/ballmac/checkbox.tsx"
    }
  ],
  "meta": {
    "schema": 1,
    "tier": "free",
    "tags": [
      "checkbox",
      "form",
      "indeterminate",
      "radix"
    ],
    "version": "1.0.0",
    "updated": "2026-09-28",
    "ai": {
      "summary": "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.",
      "whenToUse": [
        "Agreeing to terms or opting into emails",
        "Multi-select lists and table row selection",
        "A select-all control that reflects partial selection"
      ],
      "whenNotToUse": [
        "Settings that apply immediately (use switch)",
        "Choosing exactly one option from several (use a radio group or select)"
      ],
      "composesWith": [
        "label",
        "button"
      ],
      "a11y": [
        {
          "keys": "Space",
          "action": "Toggles the checkbox"
        },
        {
          "keys": "Tab",
          "action": "Moves focus to the checkbox"
        }
      ],
      "customization": [
        "checked: boolean | \"indeterminate\"; onCheckedChange receives the new state",
        "aria-invalid=\"true\" for errors",
        "Inherits the peer class so a following Label dims when disabled"
      ]
    },
    "source": {
      "name": "shadcn/ui Checkbox",
      "url": "https://github.com/shadcn-ui/ui",
      "license": "MIT",
      "copyright": "Copyright (c) 2023 shadcn",
      "modified": true
    },
    "examples": [
      "checkbox-demo",
      "checkbox-indeterminate"
    ],
    "url": "https://ui.ballmac.com/components/checkbox"
  },
  "categories": [
    "primitives"
  ],
  "type": "registry:ui"
}