# Incident Timeline

> An animated incident timeline for React and shadcn, with live updates, a severity menu and an open-for timer.

An incident timeline with live updates, a severity menu and an open-for counter that rolls every second. New updates rise in once at the top, the severity tint crossfades, and resolving folds the composer away and stops the clock.

Also known as a status timeline or an activity timeline.

- Tier: Eased Pro
- Interaction: Loading
- Page: https://eased.dev/components/incident-timeline
- Installs: motion, @base-ui/react

## Install

Incident Timeline ships with Eased Pro (https://eased.dev/#pricing). Members add the `@eased-pro` registry with their token (https://eased.dev/account), then run:

```bash
npx shadcn add @eased-pro/incident-timeline
```

An incident's war-room timeline on timeline-core, with a severity menu on overlay-core (Base UI Menu).

## When to use

- An incident, outage or on-call page where updates arrive live and the clock matters.
- Status pages' admin side, security incidents, support escalations.

## When not to use

- A general activity feed with no open/resolved state: use timeline-core directly.
- A public status page: uptime bars communicate better there.

## Usage

```tsx example.tsx
import { IncidentTimeline } from "@/components/eased/incident-timeline/incident-timeline";

<IncidentTimeline
  id="INC-2291"
  title="Elevated 5xx on api.fathom.dev"
  severity={severity}
  onSeverityChange={setSeverity}
  startedAt={openedAt}
  resolvedAt={resolvedAt}
  events={updates}
  onPost={(text) => postUpdate(text)}
/>;
```

## API reference

### IncidentTimeline

| Prop | Type | Default | Description |
|---|---|---|---|
| `id` / `title` | `string` | | The incident's id and title. |
| `severity` | `"SEV-1" \| "SEV-2" \| "SEV-3"` | | The badge. |
| `onSeverityChange` | `(s) => void` | | Makes the badge a menu. |
| `startedAt` | `number` | | Epoch ms opened; the counter rolls from it. |
| `resolvedAt` | `number` | | Set it to fold the live region and stop the counter. |
| `events` | `TimelineEvent[]` | | Updates in any order, shown newest first; new ids rise in once. |
| `onPost` | `(text) => void` | | Shows the update composer. |
| `now` | `number` | real time | The clock for ages and the counter. |
| `live` | `ReactNode` | | Shown above the composer, e.g. who is on call. |
| `className` | `string` | `""` | Appended to the root. |

## Keyboard

| Key | Action |
|---|---|
| `Tab` | Severity menu, update field, Post, then the timeline. |
| `Enter` / `Space` / `↓` | Opens the severity menu; arrows move, `Enter` picks, `Esc` closes. |
| `Enter` | Posts the update. |

## Accessibility

- The severity trigger is named "Severity SEV-2. Change severity"; the menu is a Base UI radio menu.
- The counter is read as "Open for 1h 36m"; each update has a `time` with its ISO date.
- The timeline is an ordered list named after the incident.

## Motion

New updates rise 6px and fade in once on the enter curve, staggered 35ms within a batch; existing rows never move or replay. The severity tint crossfades in 150ms and its label swaps. The counter rolls each digit every second. Resolving folds the composer on Auto Height (smooth spring, no overshoot). The menu uses overlay-core's menu motion. Reduced motion: rows and the composer fade, the ping stops.

## Notes for AI

Pass the incident's updates as timeline-core events with `tone` set from the update type (danger for alerts, success for resolution) and an `actor`. Keep ids stable so live updates don't re-enter.

Don't sort or animate the list yourself, and don't render your own clock: pass `now` only to pin it.

## Related

- [Deploy Log](/components/deploy-log): what shipped before the incident.
- [Badge](/components/badge): the status chip on its own.
