{"$schema":"https://ui.logic2b.com/schema/registry-item.json","name":"toggle","type":"registry:ui","description":"A two-state button that can be either on or off. Use for a single toggleable action like bold formatting, built on Radix Toggle.","dependencies":["radix-ui","class-variance-authority"],"registryDependencies":["utils"],"files":[{"path":"ui/toggle.tsx","type":"registry:ui","content":"import * as React from \"react\"\nimport { Toggle as TogglePrimitive } from \"radix-ui\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst toggleVariants = cva(\n  \"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow]\",\n  {\n    variants: {\n      variant: {\n        default: \"bg-transparent\",\n        outline:\n          \"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground\",\n      },\n      size: {\n        default: \"h-9 px-2 min-w-9\",\n        sm: \"h-8 px-1.5 min-w-8\",\n        lg: \"h-10 px-2.5 min-w-10\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n      size: \"default\",\n    },\n  }\n)\n\nfunction Toggle({\n  className,\n  variant,\n  size,\n  ...props\n}: React.ComponentProps<typeof TogglePrimitive.Root> &\n  VariantProps<typeof toggleVariants>) {\n  return (\n    <TogglePrimitive.Root\n      data-slot=\"toggle\"\n      className={cn(toggleVariants({ variant, size, className }))}\n      {...props}\n    />\n  )\n}\n\nexport { Toggle, toggleVariants }\n"}],"categories":["form"],"accessibility":{"support":"primitive","pattern":"toggle button","primitive":"Radix Toggle","keyboard":[{"keys":["Enter","Space"],"action":"Activate the focused control."}],"aria":["Exposes pressed state through aria-pressed."],"consumer":["Icon-only toggles require an aria-label describing the action."]},"api":{"source":"src/ui/toggle.tsx","exports":[{"name":"Toggle","kind":"component","propsType":"React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>","props":[{"name":"variant","type":"null | \"default\" | \"outline\"","required":false},{"name":"size","type":"null | \"default\" | \"sm\" | \"lg\"","required":false}]},{"name":"toggleVariants","kind":"utility","signature":"(props?: (ConfigVariants<{ variant: { default: string; outline: string; }; size: { default: string; sm: string; lg: string; }; }> & ClassProp) | undefined): string"}]}}