Skip to content

Structured lists with titles and descriptions. CSS only

List
Copy this markup
<ul class="ui-list">
<li data-ui-part="item">
<span data-ui-part="title">Install package CSS</span>
<span data-ui-part="description">Import tokens and only the components you use.</span>
</li>
<li data-ui-part="item">
<span data-ui-part="title">Author native markup</span>
<span data-ui-part="description">Keep behavior available when CSS is absent.</span>
</li>
<li data-ui-part="item">
<span data-ui-part="title">Style public anatomy</span>
<span data-ui-part="description">Use class hooks and namespaced data attributes.</span>
</li>
</ul>

Install

Styles and registration
import '@timelessui/components/css/tokens.css'
import '@timelessui/components/css/core/list.css'
import '@timelessui/components/css/themes/atmosphere/tokens.css'
import '@timelessui/components/css/themes/atmosphere/list.css'

Anatomy

Parts are authored in your own markup and identified by the selector below, so your CSS can target the same anatomy without loading Timeless styles. Required parts must be present for the component to work. Private data-ui-internal-* hooks are written by the runtime and must never be authored.

PartRequiredSelectorPurpose
itemNo[data-ui-part~='item']One row. Use <li>.
titleNo[data-ui-part~='title']Primary row text.
descriptionNo[data-ui-part~='description']Secondary row text.

Attributes

Every value below is implemented by the stylesheets this component ships. Boolean attributes are presence-based: author the attribute with no value, or omit it.

AttributeValuesDefaultDescription
data-ui-variantplain · divided · insetplainRow treatment. Numbering is the element's job, not the attribute's: use <ol class="ui-list"> for a numbered list and <ul class="ui-list"> for an unnumbered one.
data-ui-densitycompact · normalnormalRow padding.

Styling

Root identity: ui-list. Required stylesheets: tokens.css, core/list.css, themes/atmosphere/tokens.css, themes/atmosphere/list.css.

Set these custom properties to restyle the component:

Custom propertyControls
--ui-list-gapGap between rows. divided collapses it to zero.
--ui-list-item-padding-blockBlock padding of a divided row.
--ui-list-item-padding-inlineInline padding of a divided row.
Design tokens this component reads (9)

These are global Atmosphere tokens. Change them once at the theme level rather than per component.

--ui-bg-surface · --ui-fg · --ui-fg-muted · --ui-line · --ui-radius-lg · --ui-radius-md · --ui-space-1 · --ui-space-2 · --ui-space-3

Accessibility

Keep the native elements, roles, and relationships shown in the example. Timeless adds only the state and keyboard coordination the platform does not already provide, and it never supplies your accessible names — those depend on your content.

This component declares no keyboard contract, because it has none of its own: the markup above is native elements and native ARIA, and everything a keyboard or a screen reader does with it comes from the platform. Nothing here manages focus, and nothing here adds a role you did not author. So the accessibility of this component is the accessibility of the markup — which is why the markup is the part worth copying exactly.

Before JavaScript runs

This primitive is CSS only. There is nothing to register and nothing to wait for.

More examples

Open List in StoryLite for variants, controls, and manual testing.