switch
accelya-ui-lib/switchFreeComponent
shadcn/ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by shadcn/ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://raw.githubusercontent.com/ramsaoji/Accelya-UI-Lib/main/public/r/styles/default/switch.jsonSource
1"use client"23import * as React from "react"4import * as SwitchPrimitives from "@radix-ui/react-switch"56import { cn } from "@/lib/utils"78const Switch = React.forwardRef<9 React.ElementRef<typeof SwitchPrimitives.Root>,10 React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>11>(({ className, ...props }, ref) => (12 <SwitchPrimitives.Root13 className={cn(14 "peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent 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",15 className16 )}17 {...props}18 ref={ref}19 >20 <SwitchPrimitives.Thumb21 className={cn(22 "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"23 )}24 />25 </SwitchPrimitives.Root>26))27Switch.displayName = SwitchPrimitives.Root.displayName2829export { Switch }
What it pulls in
npm packages
Files it writes
More from shadcn/ui
All 357 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn/ui | Components | Free | 1 dep | |
| alertalert | shadcn/ui | Components | Free | no deps | |
| alert-dialogalert-dialog | shadcn/ui | Components | Free | 1 dep | |
| aspect-ratioaspect-ratio | shadcn/ui | Components | Free | 1 dep | |
| avataravatar | shadcn/ui | Components | Free | 1 dep | |
| badgebadge | shadcn/ui | Components | Free | 1 dep | |
| breadcrumbbreadcrumb | shadcn/ui | Components | Free | 1 dep | |
| buttonbutton | shadcn/ui | Components | Free | 1 dep |
