Skip to main content
Clever Ops

Agent Status Strip

A slim strip for app headers, agent name, state lamp, a one-line current step that shimmers while running, and an SSR-safe elapsed mono timer that starts post-mount.

Preview & code

Loading Agent Status Strip preview

Installation

pnpm dlx shadcn@latest add @cleverui/agent-status-strip

Requires the @cleverui registry in your components.json, a one-off, two-line setup.

Usage

tsx
import { AgentStatusStrip } from '@/components/ui/agent-status-strip'
Exampletsx
'use client'

import { useEffect, useState } from 'react'
import { useReducedMotion } from 'motion/react'
import {
  AgentStatusStrip,
  type AgentStatusState,
} from '@/components/ui/agent-status-strip'

type StatusFrame = { state: AgentStatusState; step: string; holdMs: number }

const IDLE_FRAME: StatusFrame = {
  state: 'idle',
  step: 'Standing by for the next ledger close.',
  holdMs: 1600,
}

const RUNNING_FRAME: StatusFrame = {
  state: 'running',
  step: 'Reconciling 128 invoices against Xero.',
  holdMs: 3200,
}

const SEQUENCE: StatusFrame[] = [
  IDLE_FRAME,
  RUNNING_FRAME,
  {
    state: 'awaiting-approval',
    step: 'Needs sign-off on a $1,240 refund to Acme Logistics.',
    holdMs: 2800,
  },
  {
    state: 'running',
    step: 'Posting approved refund and refreshing the trial balance.',
    holdMs: 3000,
  },
  {
    state: 'idle',
    step: 'Close pack ready, no open exceptions.',
    holdMs: 2400,
  },
]

export default function AgentStatusStripDemo() {
  const reduced = useReducedMotion()
  const [index, setIndex] = useState(0)
  const current = SEQUENCE[index] ?? IDLE_FRAME

  useEffect(() => {
    if (reduced) {
      // composed running frame under reduced motion, no state walk
      setIndex(1)
      return
    }
    const hold = current.holdMs
    const id = window.setTimeout(() => {
      setIndex((i) => (i + 1) % SEQUENCE.length)
    }, hold)
    return () => window.clearTimeout(id)
  }, [index, current.holdMs, reduced])

  const frame = reduced ? RUNNING_FRAME : current

  return (
    <div className="mx-auto flex min-h-[320px] w-full max-w-3xl flex-col justify-center px-4 py-16 sm:px-6">
      <div className="overflow-hidden rounded-2xl border border-border/60 bg-card">
        <div className="border-b border-border/60 px-4 py-3 sm:px-5">
          <p className="font-mono text-[11px] uppercase tracking-[0.2em] text-muted-foreground sm:text-xs">
            Meridian · agent run
          </p>
        </div>
        <AgentStatusStrip
          name="meridian-ops"
          state={frame.state}
          step={frame.step}
          showTimer
          onClick={() => {
            /* demo: open run panel */
          }}
        />
        <div className="space-y-3 px-4 py-8 sm:px-5">
          <p className="text-sm font-medium tracking-tight text-foreground">
            March close, Apex Holdings control account
          </p>
          <p className="max-w-md text-sm leading-relaxed text-muted-foreground">
            The strip sits flush in the app header while the agent walks invoices,
            pauses for human sign-off, then posts the approved refund.
          </p>
        </div>
      </div>
    </div>
  )
}

API reference

AgentStatusStrip accepts the following props.

PropTypeDefaultDescription
name*stringagent identity in mono, e.g. 'meridian-ops'
stateAgentStatusState'idle'drives lamp, shimmer, and timer; fully prop-driven
stepstringcurrent-step one-liner; truncates to one line
showTimerbooleantrueelapsed mono timer; 00:00 in server markup, counts post-mount while running
onClick() => voidmakes the whole strip a button; omitted renders a plain status bar

…plus everything from Omit<React.HTMLAttributes<HTMLElement>, 'onClick'>: className, event handlers, aria attributes and the rest pass straight through.

Referenced types

Typestsx
export type AgentStatusState =
  | 'idle'
  | 'running'
  | 'awaiting-approval'
  | 'error'

Frequently asked questions

How do I install the Agent Status Strip component?

Register the @cleverui registry in your components.json ("@cleverui": "https://cleverops.com.au/r/{name}.json"), then run `npx shadcn@latest add @cleverui/agent-status-strip`. The shadcn CLI copies the source into your project, you own the code from that point. You can also copy the source directly from this page.

What dependencies does Agent Status Strip require?

Agent Status Strip uses motion on top of React and Tailwind CSS. You don't need to install it manually, the shadcn CLI resolves and installs npm dependencies automatically when you add the component.

Can I theme Agent Status Strip to match my brand?

Yes. The component is styled entirely with Tailwind utilities over standard design tokens (primary, background, muted, border), so it inherits your existing shadcn/ui theme automatically. Change your CSS variables and the component follows, no source edits needed for palette, radius, or fonts.

Want this built for you?

CleverUI is built by the Clever Ops web team. If you'd rather ship a hand-coded, fast, custom website than assemble one, we build them for Australian businesses every week.

Explore web development services