shadcn.io is not affiliated with official shadcn/ui
Separator examples · Basic
List Separator for React
Horizontal separators between the rows of a key and value list.
Divide stacked key and value rows without turning them into a table. This React Separator sits between definition list rows (dl, dt, dd) in a flex column, with the value muted at the end of each row. Use it for invoices, order summaries, account details and any short definition list.
Preview
Installation
FAQ
When should I use list separators instead of a table?
For a short vertical stack of names and values, three to seven rows. Switch to a Table when you have columns, sorting or more than a handful of rows.
Why use dl, dt and dd?
Each row is a name and a value. A definition list tells assistive tech that the two belong together; the Separator only draws the line. A stack of div elements loses that pairing.
How tight should the list be?
gap-2 between rows and lines, as here. At gap-4 the rows start to feel like separate sections rather than one list.
Should the last row have a separator under it?
No. The lines go between rows; a trailing line usually clashes with the card or page edge below the list.
Related
- Horizontal SeparatorA horizontal separator that divides a
- Section Divider SeparatorA horizontal separator between two titled
- Menu SeparatorVertical separators between menu items
- Tight Spacing SeparatorA horizontal separator in a flex column
- Standard CardA basic card with a title, a description
- Simple Line SeparatorA single horizontal separator with its