A glanceable capsule for work that runs elsewhere: a pill with an icon or avatar, a title and one value that opens into a card with details and actions as one size change. Three basics come with it: status with elapsed time, stages with a sliding marker, and a countdown with draining ticks.
On this page
- Agent run status
- Background job
- Countdown to a handoff
- Approval waiting
- Glanceable status
Examples
Status and time
Stages
Countdown
Installation
npx knowns-ui@latest add live-activityPaste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install Live activity 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/live-activity
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 live-activity
```
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/status-dot.tsx
- components/ui/knowns/live-activity/live-activity.tsx
- components/ui/knowns/live-activity/activity-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/live-activity, 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: "live-activity" }) 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
- title / subtitle / trailing
ReactNode- The row: a title, a short line under it, and the one value on the right.
- leading
ReactNode- An icon or an avatar, in a 32px circle.
- tone
"auto"|"inverse"|"surface"- Default
"auto" - inverse is the opposite of the page (dark in light mode, light in dark mode), surface is the page's own card lifted with a hairline and a shadow, auto is inverse for the compact pill and surface for the card.
- state
"idle"|"busy"|"blocked"|"failed"|"finished"- Draws the dot at the right edge. busy and blocked pulse. Omit it for no dot.
- expanded / defaultExpanded / onExpandedChange
boolean- Default
false - The card is open. The row is a button with aria-expanded when there is a body or actions.
- children / actions
ReactNode- The card's body and the buttons under it. With neither, the capsule is a plain pill.
- ActivityStatus
state, startedAt, endedAt?, now?, detail?- The state in words and a clock that ticks each second and stops at endedAt.
- ActivityProgress
stages, current, finished?- Stage icons with a marker that slides to the current one. current is an index or a stage id.
- ActivityCountdown
endsAt, totalMs, onDone?, now?- Time left as a clock and a bar of ticks that drains. onDone fires once at zero.
- ActivityTicks
value (0 to 1), color?, track?- The tick bar on its own, for your own capsule.
| Prop | Type | Default | Description |
|---|---|---|---|
| title / subtitle / trailing | ReactNode | - | The row: a title, a short line under it, and the one value on the right. |
| leading | ReactNode | - | An icon or an avatar, in a 32px circle. |
| tone | "auto" | "inverse" | "surface" | "auto" | inverse is the opposite of the page (dark in light mode, light in dark mode), surface is the page's own card lifted with a hairline and a shadow, auto is inverse for the compact pill and surface for the card. |
| state | "idle" | "busy" | "blocked" | "failed" | "finished" | - | Draws the dot at the right edge. busy and blocked pulse. Omit it for no dot. |
| expanded / defaultExpanded / onExpandedChange | boolean | false | The card is open. The row is a button with aria-expanded when there is a body or actions. |
| children / actions | ReactNode | - | The card's body and the buttons under it. With neither, the capsule is a plain pill. |
| ActivityStatus | state, startedAt, endedAt?, now?, detail? | - | The state in words and a clock that ticks each second and stops at endedAt. |
| ActivityProgress | stages, current, finished? | - | Stage icons with a marker that slides to the current one. current is an index or a stage id. |
| ActivityCountdown | endsAt, totalMs, onDone?, now? | - | Time left as a clock and a bar of ticks that drains. onDone fires once at zero. |
| ActivityTicks | value (0 to 1), color?, track? | - | The tick bar on its own, for your own capsule. |
What it handles
- 01Holds a leading icon or avatar, a title, one trailing value and a status dot in a capsule that is one row tall.
- 02Opens into a card with a body and actions as a single size change: the row stays put and the body folds open under it.
- 03Keeps the dot, the colours and the text in your tokens, so it reads the same in light and dark.
- 04Shows how long something has been running, ticking each second and stopping at its end time.
- 05Moves a marker between named stages, and swaps the stage word in place instead of replacing the row.
- 06Counts down to a time with a bar of thin ticks that drains, and tells you once when it reaches zero.
States
- First render
- Nothing. The capsule paints as it is, open or shut
- none
- Open or close
- The body folds open under the row and fades in; closing is faster
- 180ms, ease out (120ms to close)
- Hover the row
- Background tint
- 120ms, ease out
- Stage change
- The marker slides to the new stage, the word swaps
- 280ms, ease in and out
- Ticks drain
- The filled ticks slide back; they never stretch
- 280ms, ease in and out
- Each second
- The clock text changes, nothing moves
- none
- Running dot
- The status dot pulses while the work runs
- loop, only while running
- Reduced motion
- Every change lands at once
- 0ms
| State | What moves | Timing |
|---|---|---|
| First render | Nothing. The capsule paints as it is, open or shut | none |
| Open or close | The body folds open under the row and fades in; closing is faster | 180ms, ease out (120ms to close) |
| Hover the row | Background tint | 120ms, ease out |
| Stage change | The marker slides to the new stage, the word swaps | 280ms, ease in and out |
| Ticks drain | The filled ticks slide back; they never stretch | 280ms, ease in and out |
| Each second | The clock text changes, nothing moves | none |
| Running dot | The status dot pulses while the work runs | loop, only while running |
| Reduced motion | Every change lands at once | 0ms |
Works with
When to use
When to use
- A glanceable status for one run, job or handoff that keeps updating while a person does something else.
- A countdown to an automatic step, such as a handoff or a retry, with a way to act before it fires.
When not to use
- Every step of a run with timings: use Trace Waterfall.
- Many agents in one view: use Agent Fleet.
- A progress bar with a percentage and nothing else: use Progress.
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 Live Activity to my app and wire it to my own data.
- I need a glanceable status for one run, job or handoff that keeps updating while a person does something else. Set that up with the Knowns UI Live Activity.
- Which Live Activity props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "live-activity" }) and search_docs({ query: "live activity" }).