{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "toggle", "type": "registry:ui", "title": "Toggle", "description": "A toggle component.", "dependencies": ["@radix-ui/react-toggle"], "files": [ { "path": "registry/niv/ui/toggle.tsx", "content": "'use client';\n\nimport { Root } from '@radix-ui/react-toggle';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '@/lib/classnames';\nimport type { ComponentProps } from 'react';\n\nconst toggleVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-[color,box-shadow] hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground 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:\n 'border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground',\n },\n size: {\n default: 'h-9 min-w-9 px-2',\n sm: 'h-8 min-w-8 px-1.5',\n lg: 'h-10 min-w-10 px-2.5',\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}: ComponentProps & VariantProps) {\n return (\n \n );\n}\n\nexport { Toggle };\n", "type": "registry:ui" } ] }