separator.tsx 588 B

1234567891011121314151617181920212223242526
  1. import * as React from 'react'
  2. import * as SeparatorPrimitive from '@radix-ui/react-separator'
  3. import { cn } from '@/lib/utils'
  4. function Separator({
  5. className,
  6. orientation = 'horizontal',
  7. decorative = true,
  8. ...props
  9. }: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
  10. return (
  11. <SeparatorPrimitive.Root
  12. decorative={decorative}
  13. orientation={orientation}
  14. className={cn(
  15. 'shrink-0 bg-border',
  16. orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px',
  17. className,
  18. )}
  19. {...props}
  20. />
  21. )
  22. }
  23. export { Separator }