shadcn.io is not affiliated with official shadcn/ui
Separator examples · Spacing
Tight Spacing Separator for React
A horizontal separator in a flex column with a 4 pixel gap for compact lists.
Keep related rows grouped. This React Separator sits in a flex column with gap-1, so the line divides the rows without a section-sized pause. Use it for list items, settings rows and mobile stacks where vertical space is scarce.
Preview
Installation
FAQ
When should I use tight spacing?
For dense lists, sidebar rows and mobile stacks. When the items are siblings in one group, a 4 pixel gap plus a one-pixel line is enough; use wider gaps when they're different sections.
Does tight spacing work better on mobile?
Often, because more content fits on screen. Keep interactive rows at least 44 pixels tall, though: the gap doesn't make a hit area bigger.
Does tight spacing hurt accessibility?
Screen readers ignore visual gaps. People with low vision still need contrast on the line and a clear type hierarchy, so test the layout at 200 percent zoom.
Should tight spacing open up on desktop?
Use gap-1 md:gap-4 when the same list becomes a roomy settings page on large screens. Keep it tight everywhere for data-dense dashboards.
Related
- Default Spacing SeparatorA horizontal separator in a flex column
- Wide Spacing SeparatorA horizontal separator in a flex column
- With Margins SeparatorA horizontal separator with vertical
- List SeparatorHorizontal separators between the rows of
- Horizontal SeparatorA horizontal separator that divides a
- Standard CardA basic card with a title, a description