({ className, ...rest })
| 3 | import { cn } from '~/utils/style' |
| 4 | |
| 5 | export const Toggle: FC<RadixSwitch.SwitchProps> = ({ className, ...rest }) => ( |
| 6 | <RadixSwitch.Root |
| 7 | className={cn( |
| 8 | 'w-11', |
| 9 | 'h-6', |
| 10 | 'bg-zinc-600', |
| 11 | 'rounded-full', |
| 12 | 'relative', |
| 13 | 'data-[state=checked]:bg-orange-400', |
| 14 | className |
| 15 | )} |
| 16 | {...rest} |
| 17 | > |
| 18 | <RadixSwitch.Thumb |
| 19 | className={cn( |
| 20 | 'block', |
| 21 | 'w-5', |
| 22 | 'h-5', |
| 23 | 'bg-white', |
| 24 | 'rounded-full', |
| 25 | 'shadow-zinc-900/70', |
| 26 | 'transition-transform', |
| 27 | 'translate-x-[2px]', |
| 28 | 'data-[state=checked]:translate-x-[22px]' |
| 29 | )} |
| 30 | /> |
| 31 | </RadixSwitch.Root> |
| 32 | ) |