List

A list brings names, icons, figures and actions onto the same grid. These examples use one-square rows, aligned icon cells and shared text styles.

Receipts and totals

Names, reference codes and tabular amounts share one baseline. The currency column stays aligned as values change.

Reading queue

A check, a title and a small reading time sit on the same row. The current destination is highlighted; muted text marks what is finished.

A working folder

Different file icons occupy the same square. Filenames use a monospace face; the names, formats and sizes keep their columns.

An afternoon programme

Times use a fixed-width face, session names use regular text, and room labels use the small size. Every session is one square high.

A small team

Initials, names, roles and availability align without pictures. The avatar and label share the lower sixteen of each row.

Titles with a second line

Each entry uses two aligned rows: a stronger title above, with a quiet description and reference below. The icon column stays open on the second line.

Put ds-row elements directly in the list. ds-list supplies the containing layout; each row supplies its alignment and content.

Payments under their day

A heading names each group; a picture on its square, the name, a tag and the amount at the end, no lines between the rows. Narrow the window to see a long name fade.

Events under their month

A date tile on the first sixteen of its square, inside the button that changes the date; four pixels on, the name starts on the next square. The status stands in a column at the end. Press a row to see the fill reach two pixels past the tile and the status.

Places with their icons

A 16px icon takes the first sixteen of its square, as a tile does, and the words start on the next square; the count stands at the end in tabular figures. Every row is one square high, edge to edge.

Words only

With no picture the words start on the column's edge and the fill reaches two pixels past them on each side; a value at the end keeps tabular figures so a column of amounts lines up.

A list of records (payments under their day, events under their month) is the same list with heading, the group’s name drawn on the square above its rows in the muted ink, and rows with href whose parts are classes: a 16px picture before the name (an Avatar tile, shape="square" with icon and color, or a large Icon) on the first sixteen of its square, the words in ds-row__name on the next square, a Tag after them, and the figure or date in ds-row__value at the row’s end. The name hugs its words and gives way first: cut, it fades over its last square (the row measures it and marks it data-cut="end"). The rows stack edge to edge with no lines between them; the pointer and a press fill the row’s layer, two pixels around what it holds. Give the list --ds-row-padding: 0px where its pictures and values stand on the column’s edges.

Every row in these lists stands on the same measures, so a picture, a name and a value line up from row to row and list to list:

WhatWhere it stands
The rowOne square high (20px at the base scale); rows stack edge to edge with no lines between them.
The pictureA tile, an avatar, a logo or a large icon, in ds-row__picture: exactly 16px square on the lower sixteen of the row’s first square, its start on the column’s edge with --ds-row-padding: 0px. A button around it (a date to change) adds no width, padding or margin.
The gapThe row’s 4px gap, and nothing else, between the picture and the words, so the words start on the next square: 20px from the row’s start.
The wordsds-row__name, on the lower sixteen of the square, hugging their words and fading over the last square when cut. Muted words for context (a client, a place) follow in the same line.
A tagAfter the words, the same 4px on; a column of tags (a status) is one fixed width at the row’s end, so the tags line up.
The valueds-row__value, at the row’s end in tabular figures.
The fillUnder the pointer, a press, the current row and focus: from 2px above the sixteen to 2px below the row’s foot, and 2px past the first and last thing the row holds at each side, with 6px corners that hug the tiles. With no picture it reaches 2px past the words.

A picture that opens something of its own (a date tile that changes the date) stands over the row’s press layer, so pressing the tile opens it and pressing the words opens the row. A plain tile lets the press through to the row.

, so the drawn words are hidden from assistive technology; a page that writes its own aria-label keeps it. Each group is its own list, one square apart on a page.

<ds-list heading="Monday" style="--ds-row-padding: 0px">
<ds-row href="/laundromat">
<ds-avatar shape="square" icon="plus" color="var(--ds-pink)"></ds-avatar>
<ds-text class="ds-row__name" literal>Laundromat, Hakodate</ds-text>
<ds-tag>JP Bank</ds-tag>
<ds-text class="ds-row__value" literal>46.29 kr</ds-text>
</ds-row>
</ds-list>

The element is a list: it takes role="list", and every element directly inside it role="listitem", including rows added later. A row taken out of the list loses the role the list gave it. Roles the page writes are left alone: a list with a role of its own (such as listbox, or none for a list used only for layout) gives its children no role, and a child with a role keeps it. Screen readers then announce the list and its number of items, as for <ul> and <li>.

The component has a default slot, the columns attribute, which lays the items out in that many equal columns, and heading, the group’s name on the square above the rows (its part is heading; --ds-list-heading-color is its ink). There is no ds-list-item custom element, sorting API or selection state built into it.

Row · Text