shadcn.io is not affiliated with official shadcn/ui
Separator examples · Basic
In Navigation Separator for React
Vertical separators between navigation links in a fixed-height row.
Keep header links readable without boxing each one. This React Separator sits between links in an h-5 flex row, set to orientation="vertical", so each line takes its height from the row. Use it for utility navigation, footer link rows and compact header clusters.
Preview
Installation
FAQ
Why set the height on the row instead of each separator?
A vertical Separator stretches to the height of its parent, so one h-5 on the nav sizes every line at once, and they always match the row. A height on each separator works too, but has to be repeated and kept in sync.
How much space belongs between links and separators?
gap-2 (8 pixels) keeps a compact header; gap-4 suits sparse utility links. Use flex gap rather than space-x-*: it spaces the links and the lines evenly, with no margins to fight.
When should nav use separators instead of borders or spacing?
When several inline links start to blur together and you want a lighter cue than button borders. Breadcrumbs usually take a chevron, not a line, and stacked mobile menus don't need vertical separators at all.
Should the separator change when a link is hovered?
No. The line is structure and the link is the target: hover and focus styles stay on the links.
Related
- Vertical SeparatorVertical separators between inline items
- Horizontal SeparatorA horizontal separator that divides a
- Menu SeparatorVertical separators between menu items
- Breadcrumb with Ellipsis (Standard)A breadcrumb trail with a text Home link
- Simple Navigation Navigation MenuA navigation menu with Products and
- Simple Line SeparatorA single horizontal separator with its