Skip to main content

Basic and divided

Use ul for items without an order and ol when the order matters; the browser then tells a screen reader how many items there are. Tailwind removes the bullets, so add list-disc or list-decimal when you want them. divide-y draws the lines between rows, alone or inside a bordered box.

  • Create a product
  • Upload photos
  • Set the price
  1. Fill in the details
  2. Add photos
  3. Publish
  • Internet $59.00
  • Electricity $84.20
  • Water $21.50
  • Internet Due Nov 20
  • Electricity Due Nov 24
  • Water Due Dec 2

Rich items

An avatar or an icon, a title with secondary text, and something on the right: an icon button or a badge. min-w-0 flex-1 with truncate keeps long names from pushing the right side out. An icon button has no text, so it needs an aria-label that names the item.

  • Alex Morgan

    Product designer

  • Jordan Lee

    IT administrator

  • Sam Kim

    Finance

  • Invoice 2041

    Sent Nov 3 to Northwind Ltd

    Paid
  • Invoice 2042

    Sent Nov 9 to Acme Inc

    Overdue

Description list

Pairs of a label and a value are a dl with dt and dd, not a table or two columns of div: assistive technology then knows which value belongs to which label. Wrap each pair in a div to lay it out. The first one stacks on a phone and goes to three columns from sm; the second keeps label and value on one line.

Name
Portable SSD
Category
Storage · Storage Devices
Price
$129.99
Description
Fast and compact external solid state drive, 1TB.
Workspace
Acme Workspace
Your role
Editor
Expires
in 7 days

Interactive

Each row is a real button (or a link when it goes to another page), so the keyboard and the focus ring work. The chosen row sets aria-current="true" and the style follows the attribute with aria-[current=true]:, so the state a screen reader hears and the one you see cannot differ. Use aria-current="page" for links to the current page.

Options reference

Lists are plain HTML with Tailwind classes; the only script is the small x-data of the interactive example, which you replace with your own state.

Part Value Description
ul, ol element Items without and with an order. Add list-disc or list-decimal and pl-5 for markers.
divide-y divide-dominant-200 dark:divide-dominant-700 on the list Lines between rows. Add rounded-xl border border-dominant-200 dark:border-dominant-700 for a box.
Row flex items-center gap-3 px-4 py-3 An avatar or icon, a block with min-w-0 flex-1, and an end element.
dl, dt, dd elements Label and value pairs. Wrap each pair in a div.
aria-current "true" or "page" Marks the chosen row. Style it with aria-[current=true]: or aria-[current=page]:.
Icon button aria-label Required on a button without text: name the action and the item.