a
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
||||
"name": "switch",
|
||||
"type": "registry:component",
|
||||
"title": "Switch",
|
||||
"description": "Let users to turn on or off your marketing emails or notifications.",
|
||||
"dependencies": [
|
||||
"@radix-ui/react-switch"
|
||||
],
|
||||
"files": [
|
||||
{
|
||||
"path": "components/retroui/Switch.tsx",
|
||||
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst Switch = ({ className, ...props }: SwitchPrimitives.SwitchProps) => (\n <SwitchPrimitives.Root\n className={cn(\n \"peer inline-flex h-6 w-11 shrink-0 cursor-pointer border-2 border-foreground items-center disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary\",\n className,\n )}\n {...props}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n \"pointer-events-none block h-4 w-4 bg-primary border-2 mx-0.5 border-foreground ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 data-[state=checked]:bg-background\",\n )}\n />\n </SwitchPrimitives.Root>\n);\n\nexport { Switch };\n",
|
||||
"type": "registry:component",
|
||||
"target": "components/retroui/Switch.tsx"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user