separator.tsx (707B)
1 "use client" 2 3 import { Root } from "@radix-ui/react-separator" 4 5 import { cn } from "@/lib/utils" 6 import { ComponentPropsWithoutRef, ComponentRef, forwardRef } from "react" 7 8 const Separator = forwardRef< 9 ComponentRef<typeof Root>, 10 ComponentPropsWithoutRef<typeof Root> 11 >( 12 ( 13 { className, orientation = "horizontal", decorative = true, ...props }, 14 ref 15 ) => ( 16 <Root 17 ref={ref} 18 decorative={decorative} 19 orientation={orientation} 20 className={cn( 21 "shrink-0 bg-border", 22 orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", 23 className 24 )} 25 {...props} 26 /> 27 ) 28 ) 29 Separator.displayName = Root.displayName 30 31 export { Separator }