Card
Flat structured content with public anatomy. CSS only
<article class="ui-card"> <header data-ui-part="header"> <p data-ui-part="meta">Reference</p> <h2 data-ui-part="title">Component contract</h2> <p data-ui-part="description">Review the public anatomy before publishing.</p> </header> <footer data-ui-part="footer"> <div data-ui-part="actions"> <a class="ui-link" href="#card">Open</a> <span class="ui-badge" data-ui-variant="success">Stable</span> </div> </footer></article>Install
import '@timelessui/components/css/tokens.css'import '@timelessui/components/css/button.css'import '@timelessui/components/css/badge.css'import '@timelessui/components/css/card.css'import '@timelessui/components/css/link.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.
| Part | Required | Selector | Purpose |
|---|---|---|---|
header | No | [data-ui-part~='header'] | Top region, usually the title and meta. |
body | No | [data-ui-part~='body'] | Main content region. |
footer | No | [data-ui-part~='footer'] | Bottom region, usually actions. |
title | No | [data-ui-part~='title'] | Card heading. Use a real heading element. |
description | No | [data-ui-part~='description'] | Supporting copy under the title. |
meta | No | [data-ui-part~='meta'] | Secondary metadata such as a category or date. |
actions | No | [data-ui-part~='actions'] | Container for card actions. |
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.
| Attribute | Values | Default | Description |
|---|---|---|---|
data-ui-variant | surface · filled · ghost | surface | Background and border treatment. |
data-ui-density | compact · normal | normal | Internal spacing. |
Styling
Root identity: ui-card. Required stylesheets: tokens.css, button.css, badge.css, card.css, link.css.
This component adds no custom properties of its own. Restyle it through the design tokens or your own CSS.
Design tokens this component reads (40)
These are global Atmosphere tokens. Change them once at the theme level rather than per component.
--ui-accent · --ui-accent-hover · --ui-accent-soft · --ui-bg-accent · --ui-bg-accent-active · --ui-bg-accent-hover · --ui-bg-control · --ui-bg-control-active · --ui-bg-control-hover · --ui-bg-control-muted · --ui-bg-danger · --ui-bg-danger-active · --ui-bg-danger-hover · --ui-bg-surface · --ui-bg-surface-raised · --ui-danger · --ui-danger-soft · --ui-duration-fast · --ui-ease-standard · --ui-fg · --ui-fg-muted · --ui-focus · --ui-line · --ui-radius-control · --ui-radius-lg · --ui-radius-pill · --ui-radius-xs · --ui-shadow-control-accent · --ui-shadow-control-active · --ui-shadow-control-danger · --ui-shadow-outline-control · --ui-space-1 · --ui-space-2 · --ui-space-3 · --ui-space-4 · --ui-space-5 · --ui-success · --ui-success-soft · --ui-warning · --ui-warning-soft
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.
Before JavaScript runs
This primitive is CSS only. There is nothing to register and nothing to wait for.
More examples
Open Card in StoryLite for variants, controls, and manual testing.