{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "switch", "title": "Switch", "description": "Polaris-styled Switch component.", "dependencies": [], "devDependencies": [ "@shopify/polaris-types" ], "registryDependencies": [ "@polaris-shadcn/theme", "@polaris-shadcn/utils" ], "files": [ { "path": "registry/templates/components/ui/switch.tsx", "content": "import * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\ntype SSwitchProps = React.ComponentPropsWithoutRef<\"s-switch\">;\n\ntype SwitchChangeEvent = Parameters>[0];\n\nexport interface SwitchProps extends SSwitchProps {\n className?: string;\n onCheckedChange?: (checked: boolean) => void;\n}\n\nconst Switch = React.forwardRef(\n ({ className, checked, defaultChecked, onCheckedChange, ...props }, ref) => {\n const handleChange = (event: SwitchChangeEvent) => {\n onCheckedChange?.(event.currentTarget.checked);\n };\n\n return (\n \n );\n },\n);\nSwitch.displayName = \"Switch\";\n\nexport { Switch };\n", "type": "registry:ui" } ], "type": "registry:ui" }