separator.tsx 740 B

1234567891011121314151617181920212223242526272829303132
  1. "use client"
  2. import * as React from "react"
  3. import { Separator as SeparatorPrimitive } from "@base-ui/react/separator"
  4. import { cn } from "@/lib/utils/client"
  5. const Separator = React.forwardRef<
  6. HTMLDivElement,
  7. React.ComponentPropsWithoutRef<typeof SeparatorPrimitive> & {
  8. orientation?: "horizontal" | "vertical"
  9. decorative?: boolean
  10. }
  11. >(
  12. (
  13. { className, orientation = "horizontal", decorative: _decorative, ...props },
  14. ref
  15. ) => (
  16. <SeparatorPrimitive
  17. ref={ref}
  18. className={cn(
  19. "shrink-0 bg-border",
  20. orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
  21. className
  22. )}
  23. {...props}
  24. />
  25. )
  26. )
  27. Separator.displayName = "Separator"
  28. export { Separator }