Skip to content
Sign in
AgentsSession state badgeMenu

Session state badgePro

The six agent session states as one badge: pending, working, needs you, error, done and stale.

ProThe six session states, each a glyph and a word.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/session-state-badge

Usage

tsx
import { SessionStateBadge } from "@/components/ui/chatcn/pro/session-state-badge"

<SessionStateBadge state={session.state} />

Blue is working, amber needs you, green finished, red failed, gray waits or went quiet. Every state also has its own glyph and word, so it reads in mono and for people who do not see the hue. stale is for an agent that is still running but has gone quiet: pair it with agent-heartbeat.

Examples

States

ProSmall and plain, a custom label and a live change.

Props

PropTypeNotes
state"pending" | "active" | "awaiting-input" | "error" | "complete" | "stale"The session state
labelReactNodeReplaces the word: "Needs approval"
variant"badge" | "plain"plain for rows that have a surface
size"sm" | "md"Default md
announcebooleanPolite announcement of changes. Default true

Accessibility

  • The word is a polite live region, so a change is heard once. Turn announce off in lists where many badges change together.
  • The glyph is decorative; the word carries the state.

Motion

The glyph crossfades for 150 ms on a real change, never on first paint. Reduced motion swaps it.