{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "toggle",
  "title": "Toggle",
  "author": "Ballmac <https://ui.ballmac.com>",
  "description": "A compact two-state action with distinct pressed styling, visible keyboard focus, and outline or filled variants.",
  "dependencies": [
    "radix-ui"
  ],
  "registryDependencies": [
    "utils"
  ],
  "files": [
    {
      "path": "registry/ballmac/components/toggle.tsx",
      "content": "// Ballmac UI: Toggle. https://ui.ballmac.com/components/toggle\n\"use client\";\n\nimport * as React from \"react\";\nimport { Toggle as Primitive } from \"radix-ui\";\nimport { cn } from \"@/lib/utils\";\n\ntype ToggleProps = React.ComponentProps<typeof Primitive.Root> & {\n  /** Surface treatment of the two-state control. */\n  variant?: \"default\" | \"outline\";\n  /** Control height and horizontal padding. */\n  size?: \"sm\" | \"default\" | \"lg\";\n};\nfunction Toggle({\n  className,\n  variant = \"default\",\n  size = \"default\",\n  ...props\n}: ToggleProps) {\n  return (\n    <Primitive.Root\n      data-slot=\"toggle\"\n      data-variant={variant}\n      data-size={size}\n      className={cn(\n        \"inline-flex min-w-0 shrink-0 items-center justify-center gap-2 rounded-md px-3 text-sm font-medium text-muted-foreground outline-none transition-[color,background-color,box-shadow] duration-150 hover:bg-muted hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground data-[variant=outline]:border data-[variant=outline]:border-input data-[variant=outline]:bg-background data-[variant=outline]:data-[state=on]:border-primary data-[variant=outline]:data-[state=on]:bg-primary/10 data-[size=sm]:h-8 data-[size=sm]:px-2 data-[size=default]:h-9 data-[size=lg]:h-11 data-[size=lg]:px-4 motion-reduce:transition-none [&_svg]:size-4\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\nexport { Toggle, type ToggleProps };\n",
      "type": "registry:ui",
      "target": "@components/ballmac/toggle.tsx"
    }
  ],
  "meta": {
    "schema": 1,
    "tier": "free",
    "tags": [
      "toggle",
      "pressed",
      "toolbar",
      "radix"
    ],
    "version": "1.0.0",
    "updated": "2026-09-30",
    "ai": {
      "summary": "An on/off action such as pinning or formatting that communicates its pressed state to assistive technology.",
      "whenToUse": [
        "A toolbar action with persistent pressed state",
        "Favorite or pin control"
      ],
      "whenNotToUse": [
        "Boolean form field; use switch",
        "Multiple related choices; use toggle-group"
      ],
      "composesWith": [
        "button-group"
      ],
      "a11y": [
        {
          "keys": "Tab",
          "action": "Focuses the toggle"
        },
        {
          "keys": "Enter / Space",
          "action": "Changes pressed state"
        }
      ],
      "customization": [
        "variant: default | outline",
        "size: sm | default | lg",
        "controlled or uncontrolled pressed state"
      ]
    },
    "examples": [
      "toggle-demo",
      "toggle-states"
    ],
    "url": "https://ui.ballmac.com/components/toggle"
  },
  "categories": [
    "primitives"
  ],
  "type": "registry:ui"
}