Several live agent activities in one place: a stack of capsules with the newest on top, one open at a time, a +N chip past the first few, and a finished capsule that dims and leaves.
- Many agents at once
- Corner of the screen
- Background runs
- Approvals waiting
- Live status wall
Examples
Operation
Installation
Installation is part of Pro
Pro components install from a licensed registry. The live preview stays open to everyone.
Props
- items
ActivityItem[]- Newest first. Each has an id, a kind (run, eta, budget, ring, voice, handoff, operation) and that capsule's own props. An operation takes title, message, state (queued, running, cancelling, done, failed, cancelled), progress ({ done, total } or null), error, actions, onDismiss, finished, startedAt and finishedAt. Its onDismiss(reason) gets "timeout" when the finished capsule leaves and "user" from the Dismiss button, never the click event; finished overrides whether it counts as finished (a cancelled operation with actions, such as Run again, does not: it stays undimmed and does not leave until you act).
- max
number- Default
3 - How many show before the +N chip.
- expandedId / defaultExpandedId / onExpandedChange
string|null- Default
null - The one open capsule. Opening another closes it.
- tone
"auto"|"inverse"|"surface"- Default
"auto" - The surface of every capsule: inverse is the opposite of the page, surface is the page's own card, auto is inverse for pills and surface for cards.
- dismissAfterMs / onDismiss
number / (id) => void- Default
4000 - A finished item (done, a finished run, an ETA of 0, a cancelled operation with no actions) dims, then onDismiss(id) fires. Remove it from items to make it leave. 0 turns it off. An open capsule whose item is gone holds nothing.
- label
string- Default
"Agent activities" - The accessible name of the list.
- pauseOnInteract
boolean- Default
true - Hold every dismiss timer while a capsule is open, hovered or has keyboard focus, and go on with the time it had left when released (WCAG 2.2.1). Hover is ignored on touch.
- announce
boolean- Default
false - Adds a visually hidden live region that says "title: state" when an item arrives or changes state: polite, and assertive for a failed one. Silent on first render and when nothing changed. Off by default so an app with its own region is not read twice.
| Prop | Type | Default | Description |
|---|---|---|---|
| items | ActivityItem[] | - | Newest first. Each has an id, a kind (run, eta, budget, ring, voice, handoff, operation) and that capsule's own props. An operation takes title, message, state (queued, running, cancelling, done, failed, cancelled), progress ({ done, total } or null), error, actions, onDismiss, finished, startedAt and finishedAt. Its onDismiss(reason) gets "timeout" when the finished capsule leaves and "user" from the Dismiss button, never the click event; finished overrides whether it counts as finished (a cancelled operation with actions, such as Run again, does not: it stays undimmed and does not leave until you act). |
| max | number | 3 | How many show before the +N chip. |
| expandedId / defaultExpandedId / onExpandedChange | string | null | null | The one open capsule. Opening another closes it. |
| tone | "auto" | "inverse" | "surface" | "auto" | The surface of every capsule: inverse is the opposite of the page, surface is the page's own card, auto is inverse for pills and surface for cards. |
| dismissAfterMs / onDismiss | number / (id) => void | 4000 | A finished item (done, a finished run, an ETA of 0, a cancelled operation with no actions) dims, then onDismiss(id) fires. Remove it from items to make it leave. 0 turns it off. An open capsule whose item is gone holds nothing. |
| label | string | "Agent activities" | The accessible name of the list. |
| pauseOnInteract | boolean | true | Hold every dismiss timer while a capsule is open, hovered or has keyboard focus, and go on with the time it had left when released (WCAG 2.2.1). Hover is ignored on touch. |
| announce | boolean | false | Adds a visually hidden live region that says "title: state" when an item arrives or changes state: polite, and assertive for a failed one. Silent on first render and when nothing changed. Off by default so an app with its own region is not read twice. |
Accessibility
- The list is named by
label. Each capsule is its own labelled region, and a capsule opens and closes with a button. - A finished capsule leaves after
dismissAfterMs, but never while one is open, hovered or focused: the timer stops and goes on with the time left, so a message you are reading stays put. - Turn on
announceif the stack is the only place a state change shows. It says "Import customers: Done" politely and "Import customers: Failed" assertively, and says nothing when the page first loads. - If your app already announces changes, leave
announceoff so they are not read twice.
In a popover or a header
The stack is ordinary in-flow content. It sets no fixed position, no z-index and opens no portal, so it works in a popover, a drawer or a header menu as it is. What it does assume:
- Width: it fills its host up to a 24rem cap (
w-full max-w-sm). PassclassName="max-w-none"to let the popover decide. - Height: it grows with its rows, and +N more grows it further. Give the popover a
max-heightandoverflow-y: auto; the stack does not scroll itself. - Order and direction: the newest is on top and a new row slides down 6px as it opens. A popover that opens upward still lists newest first.
- Exit: a leaving row fades and folds shut in place and the rows below close the gap. It travels nowhere, so it needs no room outside the stack.
- The +N more chip sits under the last row, centred in the stack, not in a corner of the host.
- Clipping: each row clips its own overflow while it folds, so keep the popover's padding at least 8px and do not rely on a capsule's shadow spilling past the stack.
- Timers: the dismiss timers live in the stack. Keep it mounted (hide it with CSS) while the popover is closed, or finished rows will not leave until it opens again. While it is open, hover or focus holds them.
What it handles
- 01Stacks capsules with the newest on top, each one a run, an ETA, a budget, a ring, a voice call, a handoff or a plain background operation.
- 02Keeps one capsule open at a time: opening another closes the first, so the stack never grows tall.
- 03Folds everything past the first few behind a +N chip, and opens them all on demand.
- 04Lets a new capsule rise in and a finished one dim, then leave, with the rows below closing the gap.
- 05Leaves every capsule's own state to its data: change an item and only that capsule moves.
- 06Holds the dismiss timers while a capsule is open, hovered or focused and goes on with the time left, so nothing leaves while someone is reading it.
States
- First render
- Nothing. The stack paints as it is
- none
- A capsule arrives
- It rises in; if several arrive together they follow 40ms apart, four at most
- 180ms, ease out
- Open one
- The one that was open folds shut as the new one folds open
- 180ms, ease in and out
- A capsule finishes
- It dims; after the wait the stack calls onDismiss
- 180ms, then your call
- Open, hovered or focused
- The dismiss waits stop and keep the time they had left; they go on when you let go
- none
- A capsule leaves
- Its row folds shut and the rows below slide up
- 120ms, ease out
- Reduced motion
- Rows appear and go at once
- 0ms
| State | What moves | Timing |
|---|---|---|
| First render | Nothing. The stack paints as it is | none |
| A capsule arrives | It rises in; if several arrive together they follow 40ms apart, four at most | 180ms, ease out |
| Open one | The one that was open folds shut as the new one folds open | 180ms, ease in and out |
| A capsule finishes | It dims; after the wait the stack calls onDismiss | 180ms, then your call |
| Open, hovered or focused | The dismiss waits stop and keep the time they had left; they go on when you let go | none |
| A capsule leaves | Its row folds shut and the rows below slide up | 120ms, ease out |
| Reduced motion | Rows appear and go at once | 0ms |
Works with
When to use
When to use
- The corner of your app showing every agent that is running right now, as capsules.
- A glanceable list of background runs, approvals and handoffs that updates as they change.
When not to use
- Every agent with its detail and history: use Agent Fleet.
- A single capsule: use Agent Activities.
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 Activity Stack to my app and wire it to my own data.
- I need the corner of your app showing every agent that is running right now, as capsules. Set that up with the Knowns UI Activity Stack.
- Which Activity Stack props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "activity-stack" }) and search_docs({ query: "activity stack" }). Pro props, full examples and source come back once your license key is in the MCP config.