# Card

Flat structured content with public anatomy. (CSS only.)

Reference: https://timeless.build/docs/components/card/

## Markup

```html
<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

```js
import '@timelessui/components/css/tokens.css'
import '@timelessui/components/css/core/card.css'
import '@timelessui/components/css/core/button.css'
import '@timelessui/components/css/core/badge.css'
import '@timelessui/components/css/themes/atmosphere/tokens.css'
import '@timelessui/components/css/themes/atmosphere/button.css'
import '@timelessui/components/css/themes/atmosphere/badge.css'
import '@timelessui/components/css/themes/atmosphere/card.css'
import '@timelessui/components/css/themes/atmosphere/link.css'
```

## Anatomy

Parts are authored in your own markup and identified by the selector below. 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`, `core/card.css`, `core/button.css`, `core/badge.css`, `themes/atmosphere/tokens.css`, `themes/atmosphere/button.css`, `themes/atmosphere/badge.css`, `themes/atmosphere/card.css`, `themes/atmosphere/link.css`.

This component adds no custom properties of its own. Restyle it through the design tokens at https://timeless.build/docs/styling/theming/ or your own CSS.

Design tokens this component reads (40), global and set at the theme level: `--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 markup. 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.
