One record's history in one place: emails, calls, meetings, notes and stage changes grouped by day, filtered by type or person, with a note field at the top.
On this page
Used for
- Contact history
- Account activity
- Deal log
- Support case history
- Candidate record
Examples
Order
Zone
Without filters or a note field
Installation
npx knowns-ui@latest add record-timelineFor Claude Code, Cursor or Codex: installs it and wires the props to your own data.
Paste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install prompt
Install Record timeline from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/record-timeline
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add record-timeline
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/use-floating.ts
- components/ui/knowns/tooltip.tsx
- components/ui/knowns/tooltip-utils.ts
- components/ui/knowns/avatar.tsx
- components/ui/knowns/badge.tsx
- components/ui/knowns/spinner.tsx
- components/ui/knowns/button.tsx
- components/ui/knowns/dialog.tsx
- components/ui/knowns/kbd.tsx
- components/ui/knowns/field-class.ts
- components/ui/knowns/textarea.tsx
- components/ui/knowns/chat-composer/use-autosize.ts
- components/ui/knowns/input.tsx
- components/ui/knowns/menu.tsx
- components/ui/knowns/tag.tsx
- components/ui/knowns/combobox.tsx
- components/ui/knowns/popover.tsx
- components/ui/knowns/filter-chips.tsx
- components/ui/knowns/blocks/crm/record-timeline.tsx
- components/ui/knowns/blocks/crm/record-timeline-utils.ts
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0, class-variance-authority@^0.7.1.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/record-timeline, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "record-timeline" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.Props
- events
TimelineEvent[]- { id, kind, at, title, body?, author?, detail?, from?, to? }. kind is email, call, meeting, note or stage. at is an ISO date-time with a zone. A stage event shows from and to.
- today
string- ISO date (YYYY-MM-DD) that makes the first group read Today and Yesterday.
- timeZone
string- Default
"UTC" - IANA zone for the days and times. An unknown zone falls back to UTC.
- order
"newest"|"oldest"- Default
"newest" - Days and events inside a day follow it.
- onAddNote
(text) => void|Promise<void>- Shows the note field. The text is trimmed and limited to 2,000 characters. A rejection keeps the text and shows an error.
- filter / onFilterChange
{ kinds, authors } / (filter) => void- Controlled filter. Without them the block keeps its own.
- avatarFor
(author) => string|undefined- A picture for an author by name, shown small before the name.
- filterable
boolean- Default
true - Show the Type and Person filters.
- title
ReactNode- Heading above the note field.
| Prop | Type | Default | Description |
|---|---|---|---|
| events | TimelineEvent[] | - | { id, kind, at, title, body?, author?, detail?, from?, to? }. kind is email, call, meeting, note or stage. at is an ISO date-time with a zone. A stage event shows from and to. |
| today | string | - | ISO date (YYYY-MM-DD) that makes the first group read Today and Yesterday. |
| timeZone | string | "UTC" | IANA zone for the days and times. An unknown zone falls back to UTC. |
| order | "newest" | "oldest" | "newest" | Days and events inside a day follow it. |
| onAddNote | (text) => void | Promise<void> | - | Shows the note field. The text is trimmed and limited to 2,000 characters. A rejection keeps the text and shows an error. |
| filter / onFilterChange | { kinds, authors } / (filter) => void | - | Controlled filter. Without them the block keeps its own. |
| avatarFor | (author) => string | undefined | - | A picture for an author by name, shown small before the name. |
| filterable | boolean | true | Show the Type and Person filters. |
| title | ReactNode | - | Heading above the note field. |
What it handles
- 01Lists one record's history grouped by day, newest first (or oldest first), with Today and Yesterday when you pass today.
- 02Gives each type its own icon and tint: email, call, meeting, note and stage change. A stage change reads Proposal to Negotiation.
- 03Shows who did it, a short detail (Received, 32 min) and the time in the zone you pass. Long bodies fold behind Show more.
- 04Filters by type and by person; a filter that matches nothing offers Clear filters.
- 05Composes a note inline: Ctrl or Cmd with Enter adds it, a saving state shows while your promise runs, and a failed save keeps the text.
- 06Holds no data and reads no clock: events, today and the time zone come in, a new note goes out.
States
- First render
- Nothing plays; the list paints as it is
- none
- No events
- A line that says history will appear here
- none
- Filter matches nothing
- A line and a Clear filters button
- none
- Saving a note
- The button shows its loading state and the field is locked
- button loading
- Save failed
- The text stays and the line under the field turns red
- none
- Reduced motion
- Nothing here depends on motion
- 0ms
| State | What moves | Timing |
|---|---|---|
| First render | Nothing plays; the list paints as it is | none |
| No events | A line that says history will appear here | none |
| Filter matches nothing | A line and a Clear filters button | none |
| Saving a note | The button shows its loading state and the field is locked | button loading |
| Save failed | The text stays and the line under the field turns red | none |
| Reduced motion | Nothing here depends on motion | 0ms |
Works with
When to use
When to use
- The history of one contact, company or deal: emails, calls, meetings, notes and stage changes.
- An activity column beside a record header, with a note field.
When not to use
- A feed of everything that happens across the product: use Activity Feed.
- Versions of one document: use Revision History.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI Record Timeline to my app and wire it to my own data.
- I need the history of one contact, company or deal: emails, calls, meetings, notes and stage changes. Set that up with the Knowns UI Record Timeline.
- Which Record Timeline props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "record-timeline" }) and search_docs({ query: "record timeline" }).