Skip to content

Live Activity

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
Used for
  • Agent run status
  • Background job
  • Countdown to a handoff
  • Approval waiting
  • Glanceable status

Examples

State

Status and time

Stages

Stage

Countdown

Installation

npx knowns-ui@latest add live-activity
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

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
Defaultfalse
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

  1. 01Holds a leading icon or avatar, a title, one trailing value and a status dot in a capsule that is one row tall.
  2. 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.
  3. 03Keeps the dot, the colours and the text in your tokens, so it reads the same in light and dark.
  4. 04Shows how long something has been running, ticking each second and stopping at its end time.
  5. 05Moves a marker between named stages, and swaps the stage word in place instead of replacing the row.
  6. 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

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

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" }).

Need help?

Stuck on Live Activity, or found something off? We read every message.