Skip to content

shadcn.io is an independent project built on shadcn/ui

List Separator for Solid

Horizontal lines between three key and value rows: Item 1, Item 2, and Item 3, with muted values.

UI library: Ark UI

Three rows stack up: Item 1 with Value 1, Item 2 with Value 2, and Item 3 with Value 3. A horizontal line sits between the rows, and the values are muted.

Use the lines for a short definition list that should not look like a table. A Data List fits when the pairs are the whole component. In Solid, Ark UI does not label the line.

Preview

Preview width

Installation

MCP · Pro
Make your AI a shadcn expert
Your agent installs components, builds pages and restyles your app from one prompt, in Claude Code, Cursor or VS Code.
Part of Pro

Anatomy

Separator anatomy: horizontal, vertical

Usage

<div class="flex w-full max-w-sm flex-col gap-2 text-sm">
    <dl class="flex items-center justify-between">
      <dt>Item 1</dt>
      <dd class="text-muted-foreground">Value 1</dd>
    </dl>
    <Separator />
    <dl class="flex items-center justify-between">
      <dt>Item 2</dt>
      <dd class="text-muted-foreground">Value 2</dd>
    </dl>
    <Separator />
    <dl class="flex items-center justify-between">
      <dt>Item 3</dt>
      <dd class="text-muted-foreground">Value 3</dd>
    </dl>
  </div>

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.

Can list separators be inset?

Yes. The simplest way is horizontal padding on the list, which keeps every line at full width inside it. To inset only the lines, use margins plus a width override, as the Inset Separator example does.

Are list separators announced?

The definition list already expresses the structure, so the lines add nothing for screen reader users. They're exposed as separators; for a long list, borders on the rows are quieter than a Separator between each one.

API Reference

Separator

No extra props in this demo. The rest is on the Separator page.