{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "switch", "files": [ { "path": "registry/new-york/ui/switch.tsx", "content": "import * as React from \"react\";\nimport { cn } from \"@/lib/utils\";\n\ninterface SwitchProps extends React.ButtonHTMLAttributes {\n\tchecked?: boolean;\n\tonCheckedChange?: (checked: boolean) => void;\n}\n\nconst Switch = React.forwardRef(\n\t({ className, checked = false, onCheckedChange, onClick, ...props }, ref) => {\n\t\tconst handleClick = (e: React.MouseEvent) => {\n\t\t\tonClick?.(e);\n\t\t\tonCheckedChange?.(!checked);\n\t\t};\n\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t},\n);\n\nSwitch.displayName = \"Switch\";\n\nexport { Switch };\n", "type": "registry:ui" } ], "type": "registry:ui" }