shadcn.io is not affiliated with official shadcn/ui
Separator examples · Spacing
Default Spacing Separator for React
A horizontal separator in a flex column with a 16 pixel gap on each side.
Start with a 16 pixel rhythm. This React Separator sits in a flex column with gap-4, the spacing the Separator docs use for stacked content. Use it for forms, settings and general page sections when you don't want to invent a custom scale.
Preview
Installation
FAQ
Why is gap-4 the default spacing?
16 pixels sits in the middle of the Tailwind spacing scale: enough to separate sections without wasting a phone screen.
When should I leave the default?
Tighten to gap-1 or gap-2 for lists and data rows; open to gap-6 or gap-8 for large page sections. If the default feels slightly off, move one step on the scale rather than inventing a one-off value.
Should spacing stay consistent across the app?
Pick two or three steps, such as gap-2, gap-4 and gap-8, and reuse them. Many different values make a page feel accidental.
Is gap-4 right for form sections?
Yes, between groups such as Personal info and Preferences. Inside a group, the Field components already set a tighter rhythm between label and control.
Related
- Tight Spacing SeparatorA horizontal separator in a flex column
- Wide Spacing SeparatorA horizontal separator in a flex column
- With Margins SeparatorA horizontal separator with vertical
- Horizontal SeparatorA horizontal separator that divides a
- Inset SeparatorA horizontal separator inset from both
- Section Divider SeparatorA horizontal separator between two titled