# Incident — Detent

> An incident page built around the number that broke. Every event in the activity is pinned to the line it changed, from the first drop to the fix going out.

Canonical: https://detentui.com/blocks/incident
Last updated: 2026-12-04

## About

An incident page built around the number that broke. Every event in the activity is pinned to the line it changed, from the first drop to the fix going out.

## Details

- The metric that broke leads the page: what it is now, what it was before the release, and the gap shaded between them.
- Each event sits on the line at the moment it happened. Hover one in the activity and its point lifts with a label; hover a point and its event lights up.
- The cause arrives as a sentence with the file under it, folded open on the two lines that changed.
- The fix is a pull request whose checks fill one segment at a time. Only when they are green does one question appear above the composer: ship it, or not now.
- Ship it and the line draws its way back up in green while the number rolls to where it was, and the status turns Fixed.
- Status, priority and owner are menus, and every change you make lands in the activity with your name. J and K move between incidents.
- Below 768px the two panels stack and the page scrolls as one.

## Keyboard shortcuts

| Keys | Action |
| --- | --- |
| J | Next incident |
| K | Previous incident |
| Esc | Close a menu |

## Placement

Its own route, filling the area below the app header (full width, at least the viewport height). Not inside a card or beside other content.

## Install (Pro required)

```bash
npx shadcn add @detent-pro/incident
```

## For agents

Prompt to give a coding agent: "Add Detent's Incident to this project. Fetch https://detentui.com/blocks/incident.md and follow its "For agents" steps. It's a Detent Pro piece: if the @detent-pro registry isn't set up here yet, do https://detentui.com/pro-setup.md first."

1. Check package.json: Detent needs React 19 and Tailwind CSS v4. If either is missing or older, stop and tell the user.
2. If the project root has no components.json, run `npx shadcn@latest init --defaults --yes` there.
3. This is a Pro piece. If components.json has no "@detent-pro" registry, or .env.local has no DETENT_PRO_KEY, follow https://detentui.com/pro-setup.md first. If the user has no Pro key, don't install it: tell them it needs Detent Pro and what it would add (this page's About), and only offer a free piece from https://detentui.com/agents.md if one genuinely does the same job.
4. Install it from the project root: `npx shadcn@latest add @detent-pro/incident`
5. Make sure the root layout (in Next.js, app/layout.tsx) wraps its children once in `<MotionConfig reducedMotion="user">` from motion/react. Add it only if it is not there.
6. Import `IssueRecord` from `@/components/detent/blocks/incident/IssueRecord` and render it where the user asked, sized and placed as the Placement section says. Use the props table on this page and pass the project's real data, not the demo values.
7. If the project has no real data for it yet, put clearly marked placeholders in one content file. Never invent customer quotes, names or numbers and present them as real.
8. Detent pieces are client components. If you pass them functions (format, onChange, render props), do it from a client component; a server page can only pass plain data, so load the data on the server and hand it to a small client wrapper.
9. Use the Detent theme tokens (like bg-surface, text-ink, text-ink-3) for anything you draw around it, and className where the piece takes one. Don't rewrite its motion or internals.
10. Run the project's typecheck (for example `npx tsc --noEmit`; on a fresh Next.js project run `npx next typegen` first, or it can't find types like LayoutProps). If you can run the app, open the page at a desktop and a phone width and check it renders with no console errors.
11. If AGENTS.md or CLAUDE.md has no Detent section yet, add the block from https://detentui.com/agents.md so later tasks pick the right pieces.
12. Tell the user what you added, where, and anything they still need to fill in.

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `incidents` | `Incident[]` |  | The incidents to page through. The first one plays its events in order, runs its fix’s checks and asks to ship. |
| `people` | `IncidentPerson[]` |  | Who can own an incident or comment. Each has an id, a name, and an optional photo or hue for the initial. |
| `me` | `string` | `'hana'` | The id of the person using it. Their changes and notes are signed with this name. |
| `assistant` | `string` | `'Harbor'` | What the watcher that notices drops and opens fixes is called. |
| `product` | `string` | `'Harbor'` | The product’s name beside its mark. |
| `onShip` | `(incident: Incident) => void` |  | Called once the fix is live, with the incident now marked fixed. |
| `onStatusChange` | `(incident: Incident, status: IncidentStatus) => void` |  | Called when someone picks a new status. |
| `onComment` | `(incident: Incident, text: string) => void` |  | Called when someone posts a note. |
| `accent` | `string` | `'#3a5bf6'` | The one accent colour. Selection, focus, links and the AI’s glow all derive from it. |
| `autoplay` | `boolean` | `false` | Plays the scripted demo the site shows: it types, clicks and, in a chat, sends and approves. Leave it off in a real app. It hands over for good the moment someone touches the block. |
| `className` | `string` |  | Added to the root. The block fills its container and lays itself out by its width. |

## Related
- [All blocks](https://detentui.com/blocks)
- [Pro](https://detentui.com/pro)
