Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Separator examples · Basic

Section Divider Separator for React

A horizontal separator between two titled sections with supporting text.

Framework
UI library

Give related sections one shared canvas and a clear break. This React Separator sits between two heading and description blocks in a flex column, so the line closes one section and the next heading opens the next. Use it for settings pages, profile groups and article segments that shouldn't become separate cards.

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 separators between sections instead of cards?

Use a line when the sections belong to one page or form. Use Cards when each block stands on its own, something people open or rearrange. Lines keep a continuous reading flow; cards add weight and isolation.

How much space should sit between titled sections?

gap-6 or gap-8 around the line, with a tight gap-1 inside each heading and description pair, as here. Loose between sections and tight within them is what makes the line read as a section break.

Should the heading come before or after the separator?

Section, line, next heading. A line directly above a title reads as a rule over the heading rather than a break between sections.

Should section separators look different from list separators?

Keep the same one-pixel line in the border color. The hierarchy comes from spacing and headings, not a thicker line; save thick or double lines for rare formal breaks.

How do section separators work with headings?

The headings are the structure: screen reader users jump from heading to heading. The line is exposed as a separator, which matches the break between the two sections.

Should section separators change on mobile?

Usually keep them. If vertical space is tight, reduce the outer gap rather than removing the line; switching to cards on small screens is a layout change, not a separator tweak.