Queue

Collapsible sections for queued messages, todos, and attachments — built for AI workflow progress and pending work.

Queued messages & todos

Collapsible sections for pending prompts and todos. Hover an item for send/remove actions; attachments render as images or file chips.

Loading…

Installation

CLI
npx @sonojs/ui@latest add queue
Also needsnpx @sonojs/ui@latest add button collapsible scroll-area && npm i lucide-react

Usage

queue.tsx
import {
  Queue,
  QueueItem,
  QueueItemAction,
  QueueItemActions,
  QueueItemContent,
  QueueItemIndicator,
  QueueList,
  QueueSection,
  QueueSectionContent,
  QueueSectionLabel,
  QueueSectionTrigger,
} from "@/components/sonojs/queue"

export function Example() {
  return (
    <Queue>
      <QueueSection>
        <QueueSectionTrigger>
          <QueueSectionLabel count={2} label="Queued" />
        </QueueSectionTrigger>
        <QueueSectionContent>
          <QueueList>
            <QueueItem>
              <div className="flex items-center gap-2">
                <QueueItemIndicator />
                <QueueItemContent>How do I set up the project?</QueueItemContent>
                <QueueItemActions>
                  <QueueItemAction aria-label="Remove">…</QueueItemAction>
                </QueueItemActions>
              </div>
            </QueueItem>
          </QueueList>
        </QueueSectionContent>
      </QueueSection>
    </Queue>
  )
}

Props

PropTypeDefaultDescription
defaultOpenbooleantrue`QueueSection` — start expanded.
completedbooleanfalse`QueueItemIndicator` / `Content` / `Description` — muted + strike-through.
count / labelnumber / string—`QueueSectionLabel` — e.g. `3 Queued`.
QueueMessage / QueueTodotypes—Optional data shapes for message parts and todo status.