Separator

Visually separates content.

SeparatorExample

Project Settings

Manage your project preferences.

ProfileSettingsHelp

Installation

Copy the source code below into your project:

tsx
import { Separator as BaseSeparator } from "@base-ui/react/separator";
import { cn } from "@/lib/utils";

export function Separator({ className, ...props }: BaseSeparator.Props) {
  return (
    <BaseSeparator
      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,
      )}
      data-slot="separator"
      {...props}
    />
  );
}

API Reference

The Separator component extends the Base UI Separator props and adds the following:

PropTypeDefaultDescription
orientation"horizontal" | "vertical""horizontal"The orientation of the separator.