Separator

PreviousNext

A customizable separator component

Docs
pureuiui

Preview

Loading preview…
registry/pure-ui/ui/separator/index.tsx
import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";

import { cn } from "@/lib/classes";

function Separator({
  className,
  orientation = "horizontal",
  ...props
}: SeparatorPrimitive.Props) {
  return (
    <SeparatorPrimitive
      data-slot="separator"
      orientation={orientation}
      className={cn(
        "shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:not-[[class^='h-']]:not-[[class*='_h-']]:self-stretch",
        className
      )}
      {...props}
    />
  );
}

export { Separator };

Installation

npx shadcn@latest add @pureui/separator

Usage

import { Separator } from "@/components/ui/separator"
<Separator />