SPB Git forge

spb/fetcha

Public
11commits 1branches 0releases
1.5 MBsize
maindefault branch
16 days agolast push
TypeScript 97.5% SQL 1.4% Python 0.8%
1023 B · 19 lines tsx
Raw Blame History
1"use client";2import * as React from "react";3import * as SwitchPrimitives from "@radix-ui/react-switch";4import { cn } from "@/lib/utils";56export const Switch = React.forwardRef<React.ElementRef<typeof SwitchPrimitives.Root>, React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>>(({ className, ...props }, ref) => (7  <SwitchPrimitives.Root8    className={cn(9      "peer inline-flex h-5 w-9 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-accent/40 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-accent data-[state=unchecked]:bg-border-strong",10      className,11    )}12    {...props}13    ref={ref}14  >15    <SwitchPrimitives.Thumb className="pointer-events-none block size-4 rounded-full bg-white shadow-sm ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0" />16  </SwitchPrimitives.Root>17));18Switch.displayName = "Switch";19