Skip to contentVibraUI
Utilities

Separator

A 1px hairline between groups, across or down.

shadcn's base-nova separator, unchanged — the --border hairline, rendered as a role="separator" with its aria-orientation. Keep that role where the line ends one part of the content and starts the next — two sections of a document, the groups of a toolbar — and hide the line with aria-hidden where it is only rhythm: between words on one line, between rows a list already separates, either side of a word like "or". Where the kit draws a section divider it reaches for --rule, one weight heavier, with a className. Inside a dropdown, DropdownMenuSeparator is this same Base UI part with the menu's spacing.

Install

npx shadcn@latest add @vibra/separator

Needs the @vibra registry in your components.json — set it up once.

Examples

Decorative or semantic

Between who is billed and what they owe, a separator that is heard, in --rule; between the rows inside, hidden hairlines.

With a label

"or" between two ways to sign in: the word is read in its place, and the lines either side of it are hidden.

In a toolbar

Vertical separators between the groups of a chart toolbar: structure a screen reader hears, which the arrow keys pass over.

In a menu

A settings menu in two labelled groups, so the line between them is decoration; the current page sits on the selected plane.

In a row of figures

Hidden vertical lines between four figures, which step out of the way when the row becomes two by two on a phone.

Inset, in a list

Lines that start where the names do, past the faces, set on the inline axis so they follow a right-to-left page.

Turns with the layout

Vertical between two panes side by side, horizontal once they stack, with an aria-orientation that follows the drawing.

Props

PropTypeDefaultDescription
orientation"horizontal" | "vertical""horizontal"Which way the line runs, and its aria-orientation. A vertical line stretches to the height of its row.
aria-hiddenboolean—Set it when the line is only rhythm and the content around it is already told apart, so no separator is announced.

Dependencies

Source

components/ui/separator.tsx
"use client"

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

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

export { Separator }