{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "toggle",
  "title": "Toggle",
  "description": "A two-state button that can be either on or off.",
  "dependencies": [
    "class-variance-authority",
    "radix-ui@1"
  ],
  "registryDependencies": [
    "https://ui.cortexcn.dev/r/utils.json",
    "https://ui.cortexcn.dev/r/design-system-recipes.json"
  ],
  "files": [
    {
      "path": "src/components/toggle.tsx",
      "content": "\"use client\";\n\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Toggle as TogglePrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { cn } from \"@/lib/utils\";\n\n// Cortexcn item \"toggle\", revision 9aa244a813fc, MIT license.\n// https://ui.cortexcn.dev/r/v/toggle/9aa244a813fc.json\n\nconst toggleVariants = cva(\n  \"group/toggle button-case inline-flex items-center justify-center gap-1 whitespace-nowrap rounded-button font-button text-sm outline-none transition-[color,box-shadow] hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-pressed:bg-muted aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n  {\n    variants: {\n      variant: {\n        default: \"bg-transparent\",\n        outline: \"border border-input bg-transparent shadow-xs hover:bg-muted\",\n      },\n      size: {\n        default:\n          \"h-button min-w-button px-button-x has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n        sm: \"h-button-sm min-w-button-sm px-button-x has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5\",\n        lg: \"h-button-lg min-w-button-lg px-button-x has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n      size: \"default\",\n    },\n  },\n);\n\nfunction Toggle({\n  className,\n  variant = \"default\",\n  size = \"default\",\n  ...props\n}: React.ComponentProps<typeof TogglePrimitive.Root> &\n  VariantProps<typeof toggleVariants>) {\n  return (\n    <TogglePrimitive.Root\n      className={cn(toggleVariants({ variant, size, className }))}\n      data-slot=\"toggle\"\n      {...props}\n    />\n  );\n}\n\nexport { Toggle, toggleVariants };\n",
      "type": "registry:component",
      "target": "components/toggle.tsx"
    }
  ],
  "categories": [
    "components"
  ],
  "type": "registry:component",
  "author": "Cortexcn (https://ui.cortexcn.dev)",
  "meta": {
    "license": "MIT",
    "revision": "9aa244a813fc"
  }
}