Skip to content

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

Free

Vertical Table for Solid

A two-column profile table, Field and Value. Rows run from Full Name John Doe through Role Administrator.

UI library: Ark UI

A two-column table headed Field and Value. The rows are Full Name, Email, Phone, Location, Joined and Role. Full Name is John Doe. Role is Administrator.

Use two columns for one record, such as a profile. A Data List is the same idea without a table grid. Ark UI in Solid does not pair the labels with the values.

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

Table anatomy: header, head, row, cell, footer, caption

Usage

<div class="w-full max-w-md rounded-md border bg-background">
    <Table>
      <TableHeader>
        <TableRow>
          <TableHead class="w-1/3">Field</TableHead>
          <TableHead>Value</TableHead>
        </TableRow>
      </TableHeader>
      <TableBody>
        {userInfo.map(info => <TableRow>
            <TableCell class="font-medium">{info.label}</TableCell>
            <TableCell>{info.value}</TableCell>
          </TableRow>)}
      </TableBody>
    </Table>
  </div>

FAQ

How is this table organized?

Two columns, Field and Value. userInfo has six pairs, and each pair is a TableRow keyed by info.label. The label cell is font-medium. The value cell is plain text.

How wide is the field column?

The Field TableHead has w-1/3, so the labels take a third of the table and the values take the rest. The frame is max-w-md.

Which fields are shown?

Full Name, Email, Phone, Location, Joined and Role, in that order, from the userInfo array.

Do the rows still have dividers?

Yes. This file does not set border-b-0. TableRow keeps its bottom border and hover:bg-muted/50, and TableHeader separates the Field and Value labels.

Does this table scroll sideways?

Table still sits in a container with overflow-x-auto. At max-w-md the two columns usually fit, and the container scrolls if a value is wider than the frame.

How do I add another field?

Push another { label, value } onto userInfo. The map renders a TableRow with the label in the font-medium cell and the value beside it.

API Reference

Table

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