Skip to main content

Queue

A collapsible agent work queue with section counts, spring expansion, FLIP item reordering, completion checks, and hover/focus row actions.

  • Compile registry manifests
    Sync registry.json and per-item payloads.
  • Audit keyboard navigation
    Verify focus rings and Escape handling.
  • Verify bilingual MDX frontmatter
    Check EN and VI heading parity.
  • Confirm motion token defaults
    Baseline speed 0.45 and blurPx 8.

Customize

Speed0.45
Blur reveal (px)8
Item stagger (ms)95

Installation

npx shadcn@latest add @kinetic/queue

Usage

Organize queued and completed tasks inside Queue, QueueSection, QueueSectionTrigger, QueueSectionLabel, QueueSectionContent, QueueList, and QueueItem.

import {
  Queue,
  QueueItem,
  QueueItemContent,
  QueueItemDescription,
  QueueItemIndicator,
  QueueList,
  QueueSection,
  QueueSectionContent,
  QueueSectionLabel,
  QueueSectionTrigger,
} from "@/components/kinetic/ui/queue";

export function WorkQueue() {
  return (
    <Queue>
      <QueueSection defaultOpen>
        <QueueSectionTrigger>
          <QueueSectionLabel label="Queued" count={2} />
        </QueueSectionTrigger>
        <QueueSectionContent>
          <QueueList>
            <QueueItem itemKey="lint">
              <QueueItemIndicator />
              <div className="min-w-0 flex-1">
                <QueueItemContent>Run formatter check</QueueItemContent>
                <QueueItemDescription>Inspect modified showcase files.</QueueItemDescription>
              </div>
            </QueueItem>
            <QueueItem itemKey="build" completed>
              <QueueItemIndicator />
              <div className="min-w-0 flex-1">
                <QueueItemContent>Compile registry manifests</QueueItemContent>
              </div>
            </QueueItem>
          </QueueList>
        </QueueSectionContent>
      </QueueSection>
    </Queue>
  );
}

Section collapse and FLIP reorder

Pass a stable itemKey on each QueueItem so QueueList tracks order changes and newly inserted items cleanly with flipReorder and staggerReveal. Add QueueItemActions and QueueItemAction to reveal row buttons on hover, keyboard focus, or touch screens.

import {
  Queue,
  QueueItem,
  QueueItemAction,
  QueueItemActions,
  QueueItemContent,
  QueueItemIndicator,
  QueueList,
  QueueSection,
  QueueSectionContent,
  QueueSectionLabel,
  QueueSectionTrigger,
} from "@/components/kinetic/ui/queue";

interface QueueTaskRow {
  readonly id: string;
  readonly title: string;
  readonly done: boolean;
}

interface InteractiveQueueProps {
  readonly items: readonly QueueTaskRow[];
  readonly onToggle: (id: string) => void;
}

export function InteractiveQueue({ items, onToggle }: InteractiveQueueProps) {
  return (
    <Queue>
      <QueueSection defaultOpen>
        <QueueSectionTrigger>
          <QueueSectionLabel label="Tasks" count={items.length} />
        </QueueSectionTrigger>
        <QueueSectionContent>
          <QueueList>
            {items.map((item) => (
              <QueueItem key={item.id} itemKey={item.id} completed={item.done}>
                <QueueItemIndicator />
                <QueueItemContent>{item.title}</QueueItemContent>
                <QueueItemActions>
                  <QueueItemAction
                    aria-label={item.done ? "Mark pending" : "Mark complete"}
                    onClick={() => onToggle(item.id)}
                  >
                    {item.done ? "Undo" : "Done"}
                  </QueueItemAction>
                </QueueItemActions>
              </QueueItem>
            ))}
          </QueueList>
        </QueueSectionContent>
      </QueueSection>
    </Queue>
  );
}

Motion preferences

Queue shares speed={0.45}, blurPx={8}, and staggerMs={95} down to every section and list. Reduced motion disables section collapse springs, FLIP transforms, stagger fades, and checkmark stroke animations.

API Reference

Queue / QueueSection / QueueSectionTrigger / QueueSectionLabel / QueueSectionContent

Zero-dependency queue root and collapsible section powered by useAnimatedSize and shared motion tuning.

PropTypeDefaultDescription
animated / speed / blurPx / staggerMs (Queue / QueueSection / QueueList)boolean / number / number / numbertrue / 0.45 / 8 / 95Shared motion configuration inherited from Queue down through QueueSection and QueueList.
open / defaultOpen / onOpenChange / disabled / keepMounted (QueueSection)boolean / boolean / (open: boolean) => void / boolean / booleantrue / - / false / falseControls section disclosure state, interaction lock, and DOM retention.
showChevron (QueueSectionTrigger)booleantrueShows or hides the overshoot-eased rotating chevron.
label / count / icon (QueueSectionLabel)React.ReactNode / number / React.ReactNode-Section label text, numeric item badge, and optional leading icon.

QueueList / QueueItem / QueueItemIndicator / QueueItemContent / QueueItemDescription / QueueItemActions / QueueItemAction

FLIP-animated list container, keyed items, popIn + drawStroke completion badge, and press-scaled row action buttons.

PropTypeDefaultDescription
itemKey / completed (QueueItem)string | number / booleanundefined / falseKey used by QueueList flipReorder to smoothly track moved rows, plus shared completion state.
completed / speed (QueueItemIndicator)boolean / numberinherited / inheritedTriggers popIn badge scale and drawStroke checkmark animation when completed turns true.