Switch() — ui Function Reference
Architecture documentation for the Switch() function in switch.tsx from the ui codebase.
Entity Profile
Dependency Diagram
graph TD b51a53c3_682e_21b5_fa45_075426635ab3["Switch()"] e2a8f6ba_b2d9_08d3_f234_bb3e3e24aeec["switch.tsx"] b51a53c3_682e_21b5_fa45_075426635ab3 -->|defined in| e2a8f6ba_b2d9_08d3_f234_bb3e3e24aeec style b51a53c3_682e_21b5_fa45_075426635ab3 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
deprecated/www/registry/new-york/ui/switch.tsx lines 11–26
>(({ className, ...props }, ref) => (
<SwitchPrimitives.Root
className={cn(
"peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
className
)}
{...props}
ref={ref}
>
<SwitchPrimitives.Thumb
className={cn(
"pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
)}
/>
</SwitchPrimitives.Root>
))
Domain
Subdomains
Source
Frequently Asked Questions
What does Switch() do?
Switch() is a function in the ui codebase, defined in deprecated/www/registry/new-york/ui/switch.tsx.
Where is Switch() defined?
Switch() is defined in deprecated/www/registry/new-york/ui/switch.tsx at line 11.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free