# Timeline

Events connected by a fine thread, with the present kept distinct.

- Family: Data, imported from `mizu-ui` or `mizu-ui/data`
- Docs: https://mizu.user64bit.world/components/timeline
- Source: https://github.com/0xuser64bit/mizu/blob/main/packages/mizu/src/data/Records.tsx

## Usage

```tsx
import { Timeline } from "mizu-ui";

export function Example() {
  return (
    <Timeline
      label="Illustrative release timeline"
      items={[
        {
          id: "a",
          title: "Foundations repaired",
          time: "Monday",
          state: "complete",
          body: "Keyboard and motion contracts checked.",
        },
        {
          id: "b",
          title: "Package validated",
          time: "Tuesday",
          state: "current",
          body: "Installed mizu-ui in a fresh app.",
        },
        {
          id: "c",
          title: "Release review",
          time: "Wednesday",
          state: "upcoming",
        },
      ]}
    />
  );
}
```

## Copy it with the shadcn CLI

```sh
npx shadcn@latest init 0xuser64bit/mizu/preset # once, where there is no components.json
npx shadcn@latest add 0xuser64bit/mizu/timeline
```

## Props

- `items`: `TimelineEvent[]`. Stable id, title, time, optional dateTime, body and state.
- `label`: `string` (default `"Timeline"`). List name.

## Accessibility

Ordered list and time elements preserve chronology. State is a visual aid, so include state information in the event content when essential.

## Motion

Static connective geometry.
