From c25cbf08e1eeae75d4aa654cc92fe0bf319ec5af Mon Sep 17 00:00:00 2001 From: yun-cheng Date: Sun, 28 Apr 2024 20:51:13 +0800 Subject: [PATCH] feat(UI): add Switch component --- src/components/ui/Switch.tsx | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/components/ui/Switch.tsx diff --git a/src/components/ui/Switch.tsx b/src/components/ui/Switch.tsx new file mode 100644 index 0000000..856b674 --- /dev/null +++ b/src/components/ui/Switch.tsx @@ -0,0 +1,32 @@ +import * as SwitchPrimitives from '@radix-ui/react-switch' +import * as React from 'react' +import cn from 'utils/cn' + +const Switch = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + + + +)) +Switch.displayName = SwitchPrimitives.Root.displayName + +export { Switch }