Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Separator examples · Basic

Menu Separator for React

Vertical separators between menu items that each have a title and a description.

Framework
UI library

Separate a row of labeled items, each with a title and a supporting line. This React Separator stands between the items with orientation="vertical", stretches to the height of the tallest one, and the last item and its line are hidden below the md breakpoint. Use it for settings summaries, account switchers and compact tool headers.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

When should I use this menu row instead of a nav of links?

When each item has a title and a supporting line, such as Settings with Manage preferences. A plain row of links, as in the In Navigation example, is enough when the label says it all.

How does the vertical line get its height?

The row is a flex container with items-center, and a vertical Separator stretches to the row's height, which is set by the two-line items. Don't give the Separator a fixed height; let the content decide.

Why hide the last item on small screens?

Three labeled columns overflow a 320 pixel screen. The Help item and the line before it are hidden below md, so the first two items and their line still read as a split row.

What gap should I use between items?

gap-2 on small screens and md:gap-4 once there's room, as here, so the line never sits against the text.

Do I need orientation vertical on every separator?

Yes. The default is horizontal, which would draw a full-width line between the columns. Set orientation="vertical" on each separator in a row.

Should these menu separators be announced?

The titles carry the meaning; the lines are visual. If the items are destinations, wrap them in a nav; if they're static text, a plain div is enough. The lines are exposed as separators; use a border on the items instead if you don't want them announced.