Captain UI

Avatar stack

Overlapping marks for the agents and people on a piece of work. Hover or tab in and they fan out with their names; +N lists the rest.

npx shadcn@latest add https://captain-ui.vercel.app/r/avatar-stack.json

Fix checkout race in the webhook handler

#482 · 3 files · +38 −12

Cache font files on the CDN for a year

#479 · 1 file · +9 −2

Usage

import { AvatarStack } from "@/components/ui/avatar-stack"

<AvatarStack label="Agents on #482" items={agents} max={4} />

Props

PropTypeDefaultWhat it does
itemsStackItem[]{ id, name, detail?, mark?, initials?, tone? }. A mark is any Captain icon; without one, initials.
maxnumber4Avatars shown, counting the +N.
labelstringNames the group for screen readers.
size"sm" | "md""md"26 or 34px. The hit area is always 44px.
ringstring"var(--captain-surface)"The colour behind the stack, so the ring between avatars matches it.
onSelect(item: StackItem) => voidCalled when an avatar is pressed.

Keyboard

Tab
Enter the stack
← →
Move between avatars
Home / End
First or last
Esc
Hide the tooltip

Accessibility

  • role=group with a label; one tab stop, arrows move between avatars.
  • Each avatar is a button named for its agent; the tooltip is wired with aria-describedby.
  • The +N button's name lists every hidden name, so nothing is hover-only.