{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "base-switch-demo", "type": "registry:ui", "title": "Base Switch Demo", "description": "Demo showing a base switch.", "dependencies": [ "lucide-react" ], "registryDependencies": [ "https://animate-ui.com/r/base-switch", "label" ], "files": [ { "path": "registry/demo/base/switch/index.tsx", "content": "'use client';\n\nimport { useState } from 'react';\nimport { MoonIcon, SunIcon } from 'lucide-react';\n\nimport { Label } from '@/components/ui/label';\nimport { Switch } from '@/components/animate-ui/base/switch';\n\ninterface BaseSwitchDemoProps {\n leftIcon?: boolean;\n rightIcon?: boolean;\n thumbIcon?: boolean;\n}\n\nexport const BaseSwitchDemo = ({\n leftIcon,\n rightIcon,\n thumbIcon,\n}: BaseSwitchDemoProps) => {\n const [checked, setChecked] = useState(true);\n\n const ThumbIcon = checked ? : ;\n\n return (\n
\n \n : null}\n rightIcon={rightIcon ? : null}\n thumbIcon={thumbIcon ? ThumbIcon : null}\n />\n
\n );\n};\n", "type": "registry:ui", "target": "components/animate-ui/demo/base/switch.tsx" } ], "meta": { "demoProps": { "Switch": { "leftIcon": { "value": false }, "rightIcon": { "value": false }, "thumbIcon": { "value": false } } } } }