switch
nrjdalal/switchFreeComponent
acme publishes no description for this item.
Install it
npx shadcn@latest add https://nrjdalal.dev/r/switch.jsonSource
1"use client"23import { cn } from "@/lib/utils"4import * as SwitchPrimitive from "@radix-ui/react-switch"5import * as React from "react"67function Switch({8 className,9 ...props10}: React.ComponentProps<typeof SwitchPrimitive.Root>) {11 return (12 <SwitchPrimitive.Root13 data-slot="switch"14 className={cn(15 "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 inline-flex h-5 w-9 shrink-0 items-center rounded-full border-2 border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",16 className,17 )}18 {...props}19 >20 <SwitchPrimitive.Thumb21 data-slot="switch-thumb"22 className={cn(23 "bg-background pointer-events-none block size-4 rounded-full shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0",24 )}25 />26 </SwitchPrimitive.Root>27 )28}2930export { Switch }
What it pulls in
npm packages
Files it writes
More from acme
All 49 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | acme | Components | Free | 5 deps · 2 files | |
| alertalert | acme | Components | Free | 4 deps · 2 files | |
| alert-dialogalert-dialog | acme | Components | Free | 6 deps · 3 files | |
| aspect-ratioaspect-ratio | acme | Components | Free | 1 dep | |
| avataravatar | acme | Components | Free | 4 deps · 2 files | |
| badgebadge | acme | Components | Free | 5 deps · 2 files | |
| breadcrumbbreadcrumb | acme | Components | Free | 5 deps · 2 files | |
| buttonbutton | acme | Components | Free | 5 deps · 2 files |
