Queue
A collapsible agent work queue with section counts, spring expansion, FLIP item reordering, completion checks, and hover/focus row actions.
- Compile registry manifestsSync registry.json and per-item payloads.
- Audit keyboard navigationVerify focus rings and Escape handling.
- Verify bilingual MDX frontmatterCheck EN and VI heading parity.
- Confirm motion token defaultsBaseline speed 0.45 and blurPx 8.
Customize
Installation
npx shadcn@latest add @kinetic/queueUsage
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.
| Prop | Type | Default | Description |
|---|---|---|---|
animated / speed / blurPx / staggerMs (Queue / QueueSection / QueueList) | boolean / number / number / number | true / 0.45 / 8 / 95 | Shared motion configuration inherited from Queue down through QueueSection and QueueList. |
open / defaultOpen / onOpenChange / disabled / keepMounted (QueueSection) | boolean / boolean / (open: boolean) => void / boolean / boolean | true / - / false / false | Controls section disclosure state, interaction lock, and DOM retention. |
showChevron (QueueSectionTrigger) | boolean | true | Shows 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.
| Prop | Type | Default | Description |
|---|---|---|---|
itemKey / completed (QueueItem) | string | number / boolean | undefined / false | Key used by QueueList flipReorder to smoothly track moved rows, plus shared completion state. |
completed / speed (QueueItemIndicator) | boolean / number | inherited / inherited | Triggers popIn badge scale and drawStroke checkmark animation when completed turns true. |