# Halaska UI > A single-file React UI kit for AI products: 40 UX patterns and 90 styled components built on the shadcn/ui base. react and react-dom only, inline styles, MIT. Made by Chris Halaska and Halaska Studio. ## Start here - [Site](https://ui.halaska.com): every screen, pattern and component with live previews - [Install guide for agents](https://ui.halaska.com/install.md): setup, usage, theming, the retrofit steps - [The kit file](https://ui.halaska.com/halaska-kit.jsx) and its [TypeScript shim](https://ui.halaska.com/halaska-kit.d.ts) - [Everything as one text file](https://ui.halaska.com/llms-full.txt): all pages, then this API reference - [Source on GitHub](https://github.com/Halaska-Studio/ui) ## Pages - [Patterns](https://ui.halaska.com/patterns): 40 AI UX patterns in six lifecycle groups - [Components](https://ui.halaska.com/components): 90 components, grouped Agents, Generative UI, Content, Feedback, Forms, Layout, Navigation, Overlays - [Screens](https://ui.halaska.com/screens): Chat and Canvas, two complete example screens - [Changelog](https://ui.halaska.com/changelog) # API reference for coding agents # https://ui.halaska.com · file: halaska-kit.jsx · by Halaska Halaska UI is a single-file React UI kit for AI products: 40 UX patterns + 90 styled components, inline styles, no CSS/Tailwind setup. Deps: react and react-dom only (no chart library). Fonts (Geist) and keyframes self-inject on import. File begins with "use client" (Next.js-safe). INSTALL curl -o src/halaska-kit.jsx https://ui.halaska.com/halaska-kit.jsx # TypeScript projects: curl -o src/halaska-kit.d.ts https://ui.halaska.com/halaska-kit.d.ts USAGE import { Button, Card, Orb, PlanPreviewPattern, usePal, tokens } from "./halaska-kit"; Every component accepts theme="light" | "dark" (or wrap in ). Colors: const pal = usePal(theme) → pal.bg, bgElevated, bgSubtle, bgMuted, border, borderSubtle, text, textSecondary, textTertiary, textMuted, accent, accentBg, success, warning, danger (+ *Bg tints). Accent: . Every accent-colored element follows. Layout: ; tokens.space {xs 4, sm 8, md 16, lg 32, xl 40}; tokens.radius {xs 4, sm 8, md 16, lg 24, xl 32, pill 999}; tokens.type {xs…display}; tokens.font.sans/mono. Motion: motion.fast/normal/smooth/spring/slow durations; motion.easeInOut/easeOut/easeIn/emphasized/springCurve. UX PATTERNS: the lifecycle set is prop-driven with demo defaults. Pass your own copy, data, and callbacks (see @prop lines below each): ThinkingTracePattern, StreamingAnswerPattern, PlanPreviewPattern, ApprovalCardPattern, AgentStatusPattern, HandoffPattern, ActionReceiptPattern, ErrorRepairPattern. The other patterns are working reference implementations with demo data (an AI operations agent named Alpha running support, releases, and renewals for a small software team): copy the source out of halaska-kit.jsx, swap the data, keep the structure, states, and motion. DESIGN HEURISTICS (apply when composing new UI) Show what the agent is doing (Orb, AgentStatusPattern) · consent before consequence (PlanPreviewPattern, ApprovalCardPattern) · undo over confirm (ActionReceiptPattern) · recognition over recall (DigestPattern, AuditLogPattern) · calm error recovery (ErrorRepairPattern). EXPORTS ## Foundations tokens motion interactiveBase usePal useThemeContext ThemeProvider({ theme = "light", children }) AccentContext useAccent injectStyles getAvatarColor setKitMotion setKitFont KIT_MOTION_PRESETS KIT_FONT_PRESETS ## Typography Text({ children, size = "base", weight = "regular", color, mono, muted, secondary, align, truncate, theme, style, as = "span" }) Heading({ children, level = 1, theme, style }) Label({ children, required, htmlFor, theme, style }) Caption({ children, theme, style }) Code({ children, theme, style }) ## Buttons Button({ children, variant = "primary", size = "md", icon, iconRight, disabled, loading, fullWidth, onClick, theme, style, type, "aria-label", "aria-expanded", "aria-haspopup", "aria-describedby" }) IconButton({ icon, size = 36, variant = "ghost", onClick, theme, label, style, "aria-expanded", "aria-haspopup", "aria-describedby" }) ButtonGroup({ children, theme }) LinkButton({ children, onClick, icon, iconRight, size = "md", theme, style }) SplitButton({ children, onClick, items = [], variant = "primary", size = "md", theme }) ## Inputs & selectors TextInput({ value, onChange, placeholder, label, caption, error, icon, disabled, type = "text", size = "md", theme, style, "aria-label" }) TextArea({ value, onChange, placeholder, label, caption, rows = 3, disabled, theme, style, "aria-label" }) Select({ value, onChange, options, placeholder, label, disabled, size = "md", theme, style }) Checkbox({ checked, onChange, label, disabled, theme, "aria-label" }) Radio({ checked, onChange, label, disabled, tabIndex, theme, "aria-label" }) RadioGroup({ options, value, onChange, label, theme }) SwitchToggle({ checked, onChange, label, theme, "aria-label" }) Slider({ value, onChange, min = 0, max = 100, label, theme, "aria-label" }) SpringSlider({ value, onChange, min = 0, max = 100, label, theme }) SpringToggle({ checked, onChange, label, theme, "aria-label" }) SegmentedControl({ options, value, onChange, theme }) InputOTP({ length = 6, value = "", onChange, theme }) InputGroup({ prefix, suffix, value, onChange, placeholder, label, theme, style }) Combobox({ options = [], value, onChange, placeholder = "Select…", label, theme }) Calendar({ value, onChange, theme }) DatePicker({ value, onChange, label, placeholder = "Pick a date", theme }) Chip({ children, selected, onToggle, onRemove, icon, theme }) Toggle({ pressed, onPress, children, theme }) ToggleGroup({ options, value, onChange, theme }) SearchInput({ value, onChange, placeholder = "Search…", shortcut = "⌘K", theme, style }) Choicebox({ options, value, onChange, multiple, theme }) CopyInput({ value, label, theme, style }) Rating({ value = 0, onChange, max = 5, size = 18, readOnly, theme }) ## Layout & data display Card({ children, theme, padding, hover, onClick, style }) CardHeader({ title, subtitle, action, theme }) Divider({ theme, spacing }) Stack({ children, gap = "md", direction = "column", align, justify, wrap, style }) Badge({ children, variant = "default", theme, style }) Tag({ children, color, removable, onRemove, theme }) StatusBadge({ status = "default", children, pulse, theme }) StatusDot({ status = "online", pulse, size = 8, label, theme }) Avatar({ name, src, size = 32, theme }) AvatarGroup({ names, max = 4, size = 28, theme }) ListItem({ title, subtitle, left, right, divider = true, onClick, theme }) Stat({ label, value, change, theme }) Table({ columns, rows, theme }) DataTable({ columns, rows, theme }) ScrollArea({ children, maxHeight = 200, theme }) Pagination({ current, total, onChange, variant = "numbers", theme }) MiddleTruncate({ text, tail = 6, mono = true, theme, style }) Kbd({ children, theme }) Sparkline({ data = [], width = 240, height = 72, color, fill = true, theme, style }) DotGrid({ theme, spacing = 20 }) ## Feedback & status Progress({ value, theme, height = 6 }) ProgressCircle({ value = 0, size = 48, stroke = 4, label, theme }) Skeleton({ width, height = 16, rounded, theme }) Spinner({ size = 16, color }) Toast({ message, variant = "default", icon, theme }) AlertBanner({ title, description, variant = "default", theme }) EmptyState({ icon, title, description, action, theme }) Stepper({ steps, current = 0, theme }) ## Navigation & menus Breadcrumb({ items, maxVisible, home, theme }) Tabs({ tabs, value, onChange, theme }) SubtleTabs({ tabs, value, onChange, theme }) Accordion({ items, defaultOpen = -1, theme }) Collapsible({ title, children, defaultOpen = false, theme }) ContextMenu({ items, children, theme }) Menubar({ menus, theme }) CommandPalette({ items = [], placeholder = "Type a command or search…", theme }) CommandMenu({ open, onClose, items = [], placeholder = "Type a command or search…", theme }) ## Overlays Dialog({ open, onClose, title, children, theme }) AlertDialog({ open, onClose, title, description, variant = "danger", confirmLabel = "Confirm", cancelLabel = "Cancel", onConfirm, theme }) FormDialog({ open, onClose, title, description, children, submitLabel = "Save", onSubmit, theme }) CardDialog({ open, onClose, cover, title, description, children, actions, theme }) Sheet({ open, onClose, title, children, side = "right", theme }) Popover({ trigger, children, theme }) DropdownMenu({ trigger, items, theme }) Tooltip({ children, text, theme }) HoverCard({ trigger, children, theme }) ChevronIcon({ size = 12, direction = "right", style }) ## Dev surfaces Snippet({ text, prompt = "$", theme, style }) FileTree({ data = [], theme, style }) BrowserFrame({ url = "localhost:3000", children, theme, style }) PhoneFrame({ children, width = 300, height = 560, theme, style }) ## AI elements Orb({ variant = "pulse", size = 20, label, pill, color, theme, style }) StreamingText({ text, speed = 30, theme }) ThinkingIndicator({ label = "Thinking", size = "md", theme }) ThinkingSteps({ steps, current = 0, theme }) ConfidenceBar({ value, label, theme }) AISuggestionBadge({ theme }) BeforeAfterToggle({ before, after, theme }) CompareSlider({ before, after, theme, initial = 0.5, labels = ["Before", "After"], style }) ZoomControl({ zoom, onChange, theme }) AgentGlyph({ size = 24, theme }) ## UX patterns: conversation core PromptInputPattern({ theme }) MessageThreadPattern({ theme }) StreamingAnswerPattern({ theme, segments = STREAM_ANSWERS.default.segments, sources = STREAM_SOURCES, followups = STREAM_ANSWERS.default.followups, thinkingLabel = "Checking the inbox", answerLabel = "Answer", sourcesLabel = n => `${n} sources`, followupsLabel = "Follow-ups", thinkMs = 700, charsPerTick = 2, tickMs = 18, autoplay = true, onFollowup, onDone }) theme {"light" | "dark"} Palette override (defaults to ThemeProvider context) segments {({ t: string } | { chip: string })[]} The answer as text runs and inline source chips, in order; streaming restarts whenever it changes (default: the Acme ticket demo answer) sources {{ name: string, domain: string }[]} Sources row shown once streaming completes (default: STREAM_SOURCES) followups {string[]} Follow-up prompts listed under the answer (default: the demo follow-ups) thinkingLabel {string} Label beside the dots while thinking (default: "Checking the inbox") answerLabel {string} Caption that replaces the thinking indicator once streaming starts (default: "Answer") sourcesLabel {(n: number) => string} Caption above the sources row, given the source count (default: n => `${n} sources`) followupsLabel {string} Caption above the follow-up list (default: "Follow-ups") thinkMs {number} Thinking duration before the first character appears (default: 700) charsPerTick {number} Characters revealed per tick (default: 2) tickMs {number} Milliseconds between ticks (default: 18) autoplay {boolean} Think → stream on mount; false renders the finished answer immediately with no timers (default: true) onFollowup {(text: string) => void} Fires when a follow-up is clicked; the parent then swaps `segments`/`followups`. When omitted, the demo toggles to its built-in second answer onDone {() => void} Fires when streaming completes (not fired when autoplay is false) AgentChatPattern({ theme }) CodeBlockPattern({ theme }) ModelContextPattern({ theme }) ## UX patterns: trust & transparency ThinkingTracePattern steps {{ label: string, detail?: string }[]} Reasoning steps, revealed one per `stepMs` (default: THINKING_TRACE_STEPS) stepMs {number} Milliseconds per step; total think time = steps.length × stepMs (default: 1100) thinkingLabel {string} Label shown while thinking (default: "Thinking") doneLabel {(seconds: number) => string} Header label once done (default: `Thought for ${seconds.toFixed(1)} seconds`) collapseDelayMs {number} Pause after done before the trace collapses (default: 1000) autoCollapse {boolean} Collapse the trace automatically after done (default: true) autoplay {boolean} Run the timed trace on mount; false renders the finished, collapsed state with no timers (default: true) defaultOpen {boolean} Initial expanded state of the trace (default: autoplay) onDone {(seconds: number) => void} Fires when thinking completes (autoplay only) onToggle {(open: boolean) => void} Fires when the trace expands/collapses, by user click or auto-collapse CitationsPattern({ theme }) ContextSourcesPattern({ theme }) ConfidencePattern({ theme }) RecommendationPattern({ theme }) FeedbackPattern({ theme }) ## UX patterns: agentic control PlanPreviewPattern({ theme, title = "Alpha wants to clear the support backlog", subtitle = "Nothing runs until you say so.", steps = PLANPREV_STEPS, badgeLabel = "Proposed", proceedLabel = "Proceed", editLabel = "Edit plan", handoffLabel = "I'll do it myself", lockLabel = "Lock plan", doneText, handoffText = "Plan handed off. Alpha is standing by.", stepDelayMs = 700, onProceed, onComplete, onEdit, onHandoff }) title {string} Card headline (default: "Alpha wants to clear the support backlog") subtitle {string} Line under the headline while reviewing (default: "Nothing runs until you say so.") steps {string[]} Plain-language steps, shown numbered; copied into state on mount so edits never mutate the prop badgeLabel {string} Status badge text in the review/edit phases (default: "Proposed") proceedLabel {string} Primary action label (default: "Proceed") editLabel {string} Secondary action label (default: "Edit plan") handoffLabel {string} Ghost action label that hands the plan back to the user (default: "I'll do it myself") lockLabel {string} Label of the button that locks an edited plan (default: "Lock plan") doneText {string | (count: number) => string} Footer text once every step has run; default renders "Done · N actions taken · view receipt" handoffText {string} Line shown after the user takes the plan over (default: "Plan handed off. Alpha is standing by.") stepDelayMs {number} Interval between steps checking off while executing (default: 700) onProceed {(steps: string[]) => void} Fires when Proceed is clicked, with the kept (possibly edited) steps onComplete {(steps: string[]) => void} Fires when the last kept step checks off onEdit {(steps: string[]) => void} Fires when the plan is locked after editing, with the kept steps onHandoff {() => void} Fires when the user chooses to do it themselves ApprovalCardPattern({ theme, eyebrow = "Needs your call", badgeLabel = "Paused", question = "How should I reply to Acme's outage complaint?", options = APPROVAL_OPTIONS, approveLabel = "Approve", skipLabel = "Skip", approvedText = APPROVAL_APPROVED_TEXT, skippedText = APPROVAL_SKIPPED_TEXT, onSelect, onApprove, onSkip }) theme {"light"|"dark"} Palette override (defaults to ThemeContext) eyebrow {string} Small caption beside the agent glyph (default: "Needs your call") badgeLabel {string} Status badge text while paused (default: "Paused") question {string} The question the agent is asking (default: "How should I reply to Acme's outage complaint?") options {{ id: string, title: string, sub?: string }[]} Radio-row choices (default: APPROVAL_OPTIONS) approveLabel {string} Primary button label (default: "Approve") skipLabel {string} Ghost button label (default: "Skip") approvedText {string | ((option) => string)} Headline of the approved state; a function receives the chosen option (default: `Approved · ${option.title}`) skippedText {string} Headline of the skipped state (default: "Skipped · nothing was changed") onSelect {(option) => void} Fires when a radio row is picked onApprove {(option) => void} Fires when Approve is clicked, with the chosen option onSkip {() => void} Fires when Skip is clicked AutonomyPattern({ theme }) PermissionScopePattern({ theme }) QueuePattern({ theme }) AgentStatusPattern({ theme, phases = AGENTSTATUS_MAIN_PHASES, redirectPhases = AGENTSTATUS_REDIRECT_PHASES, waitingLabel = "Waiting on you · 2 replies need a look", pausedLabel = "Stopped · progress kept", doneLabel = "Done · replies redrafted to your note", phaseMs = 1800, contextLabel = agentstatusContextLabel, redirectPlaceholder = "Tell Alpha what to do instead…", autoplay = true, onPause, onResume, onRedirect, onWaiting, onDone }) theme {"light" | "dark"} Palette override (defaults to ThemeContext) phases {(string | { label: string, orb?: "pulse" | "orbit" | "sweep" | "globe" | "spark" })[]} Main working phases, shown in order (default: AGENTSTATUS_MAIN_PHASES with orbit → globe → sweep orbs) redirectPhases {(string | { label: string, orb?: "pulse" | "orbit" | "sweep" | "globe" | "spark" })[]} Phases run after a redirect note is sent (default: AGENTSTATUS_REDIRECT_PHASES with globe → sweep orbs) waitingLabel {string} Pill text once the main cycle ends and the agent needs the user (default: "Waiting on you · 2 replies need a look") pausedLabel {string} Pill text while stopped (default: "Stopped · progress kept") doneLabel {string} Pill text once the redirect cycle finishes (default: "Done · replies redrafted to your note") phaseMs {number} Milliseconds per phase (default: 1800) contextLabel {string | ((step: number, total: number) => string)} Footer line under the pill (default: (step, total) => `Alpha · step ${step} of ${total}`) redirectPlaceholder {string} Placeholder for the redirect note input (default: "Tell Alpha what to do instead…") autoplay {boolean} Cycle phases on mount; false renders the waiting state immediately and a redirect jumps straight to done (default: true) onPause {() => void} Fires when the user stops the run (the control reads Stop) onResume {() => void} Fires when the user resumes onRedirect {(note: string) => void} Fires with the trimmed note when the user sends a redirect onWaiting {() => void} Fires when the main cycle ends and the agent needs the user onDone {() => void} Fires when the redirect cycle finishes ToolStreamPattern({ theme }) AgentTasksPattern({ theme }) HandoffPattern({ theme, workingLabel = "Reviewing Acme's refund request…", workingMs = 2000, headline = "Alpha is handing this to you", reason = "Refund exceeds your $2, 500 approval cap", context = HANDOFF_CONTEXT_ROWS, takeOverLabel = "Take over", resumeLabel = "Raise cap to $5, 000 & let Alpha finish", takenOverText = "You have control. Alpha left notes in the thread.", resumingLabel = "Resuming with new cap…", resumedText = HANDOFF_RESUMED_TEXT, resumeMs = 1500, autoplay = true, onTakeOver, onResume, onResumed }) theme {"light" | "dark"} Palette override; falls back to ThemeContext workingLabel {string} ThinkingIndicator label while the agent is still working (default: "Reviewing Acme's refund request…") workingMs {number} How long the working beat lasts before the handoff card appears (default: 2000) headline {string} Handoff headline on the accent rail (default: "Alpha is handing this to you") reason {string} Because-line under the headline (default: "Refund exceeds your $2,500 approval cap") context {{ label: string, value: string }[]} Prepared context rows the human inherits (value renders mono) takeOverLabel {string} Primary action label (default: "Take over") resumeLabel {string} Secondary action label that raises the cap and lets the agent finish (default: "Raise cap to $5,000 & let Alpha finish") takenOverText {string} Confirmation line after Take over (default: "You have control. Alpha left notes in the thread.") resumingLabel {string} ThinkingIndicator label while the agent resumes (default: "Resuming with new cap…") resumedText {ReactNode} Resolved line after the agent finishes (default: "Done · refunded $3,900 to Acme", amount in mono) resumeMs {number} How long the resuming beat lasts before it resolves (default: 1500) autoplay {boolean} Play the working beat on mount; false shows the handoff card immediately (default: true) onTakeOver {() => void} Fires when the user clicks Take over onResume {() => void} Fires when the user clicks the raise-cap action onResumed {() => void} Fires when the resumed run resolves (after resumeMs) ActionReceiptPattern({ theme, title = "Credit issued", reversedTitle = "Reversed", timestamp = "14:32:07 UTC", reversedTimestamp = "14:32:19 UTC", meta = RECEIPT_META, reversedMeta = RECEIPT_META_REVERSED, before = 0, after = 180, unit = "USD", decimals = 0, stripLabel = "Acme credit", undoSeconds = RECEIPT_UNDO_SECONDS, undoLabel = "Undo", expiredLabel = "Undo window closed", reversedLabel = "Reversal logged · nothing else was affected", auditLabel = "View in audit log", autoplay = true, onUndo, onExpire, onAudit }) title {string} Headline while the action stands (default: "Credit issued") reversedTitle {string} Headline after undo (default: "Reversed") timestamp {string} Mono timestamp shown top-right (default: "14:32:07 UTC") reversedTimestamp {string} Timestamp shown after undo (default: "14:32:19 UTC") meta {{ label: string, value: string }[]} What / Where / Authority rows (default: RECEIPT_META) reversedMeta {{ label: string, value: string }[]} Rows shown after undo (default: RECEIPT_META_REVERSED) before {number} Credit balance before the action (default: 0) after {number} Credit balance after the action; counts up on mount (default: 180) unit {string} Unit suffix on the strip and delta (default: "USD") decimals {number} Decimal places for before/after/delta (default: 0) stripLabel {string} Label at the left of the before → after strip (default: "Acme credit") undoSeconds {number} Length of the undo window; drives the ring and countdown (default: 10) undoLabel {string} Undo button text (default: "Undo") expiredLabel {string} Caption once the window closes (default: "Undo window closed") reversedLabel {string} Caption after undo (default: "Reversal logged · nothing else was affected") auditLabel {string} Audit link text in the expired and reversed states (default: "View in audit log") autoplay {boolean} Run the countdown + count-up on mount; false renders the expired state with no timers (default: true) onUndo {() => void} Fires when the user clicks Undo inside the window onExpire {() => void} Fires when the undo window closes untouched onAudit {() => void} Fires when the user clicks the audit link CheckpointPattern({ theme }) AuditLogPattern({ theme }) ErrorRepairPattern({ theme, headline = "Alpha got this one wrong", acknowledgment = "Alpha archived the Stripe payout notice as a newsletter. It matched the sender rule and never reached your inbox.", fixesTitle = "What Alpha did about it", fixes = REPAIR_FIXES, diff = REPAIR_DIFF, reviewLabel = "Review the fix", flagLabel = "Flag for a human", footer = "Logged to audit · nothing else was affected.", beatMs = 1200, autoplay = true, onReview, onFlag }) theme {"light" | "dark"} Palette override (defaults to ThemeProvider context) headline {string} Plain-language admission (default: "Alpha got this one wrong") acknowledgment {string} One sentence on what went wrong, no blame (default: the archived-payout-notice line) fixesTitle {string} Eyebrow above the fix list (default: "What Alpha did about it") fixes {string[]} Corrective actions taken, each drawn in with a check (default: REPAIR_FIXES) diff {{ label: string, before: string, after: string } | null} Before/after line revealed by Review; null hides the Review button and the diff (default: REPAIR_DIFF) reviewLabel {string} Toggle-diff button label (default: "Review the fix") flagLabel {string} Escalation button label (default: "Flag for a human") footer {string} Quiet audit note under the actions; empty string hides it (default: "Logged to audit · nothing else was affected.") beatMs {number} Delay between the three beats when autoplaying (default: 1200) autoplay {boolean} Reveal beats on a timer; false shows all three at once, no timers (default: true) onReview {() => void} Fires when the user toggles the diff open or closed onFlag {() => void} Fires when the user asks for a human ## UX patterns: output & generative UI ArtifactPattern({ theme }) DiffViewPattern({ theme }) DiffTablePattern({ theme }) StructuredDataPattern({ theme }) InsightCardsPattern({ theme }) ComparisonPattern({ theme }) ## UX patterns: ambient & beyond chat TaskboardPattern({ theme }) InlineAssistPattern({ theme }) NudgePattern({ theme }) DigestPattern({ theme }) NotificationCenterPattern({ theme }) CommandSearchPattern({ theme }) AgentSetupPattern({ theme }) ## UX patterns: agentic navigation ContextBarPattern({ theme }) SpaceDeckPattern({ theme }) ## Example screens (one per UX paradigm) ChatParadigmExample({ theme, layout = "desktop" }) CanvasParadigmExample({ theme, layout = "desktop" }) ChatParadigmBefore({ theme, layout = "desktop" }) BeforeAfterSection({ theme }) PARADIGM_STAGE PARADIGM_STAGE_MOBILE ## Accessibility helpers useModalFocus arrowNav ## Layout helpers useNarrow useFitScale TraceWaterfall({ theme, spans = TRACE_SPANS, totals, title = "Refund sweep · run 4f2a", onSelect }) spans {{ id: string, name: string, kind: "model" | "tool" | "wait" | "handoff" | "failed", startMs: number, endMs: number, parentId?: string, tokens?: number, costUsd?: number, model?: string }[]} Spans of the run; children nest under parentId (default: TRACE_SPANS) totals {{ durationMs?: number, costUsd?: number, tokens?: number, llmCalls?: number, toolCalls?: number, errors?: number }} Overrides for the stat row; anything left out is computed from the spans title {string} Header text (default: "Refund sweep · run 4f2a") onSelect {(span: Span) => void} Fires when a row is clicked or activated with the keyboard TaskList({ theme, title = "Clearing the support backlog", tasks = TASKLIST_TASKS, autoplay = true, stepMs = 1400, collapsible = false, defaultOpen = true, retryLabel = "Retry", onChange, onRetry, onToggle }) title {string} Header text (default: "Clearing the support backlog") tasks {{ id: string, label: string, status: "todo" | "running" | "done" | "failed" | "blocked", detail?: string }[]} The job's tasks in order; copied into state on mount (default: TASKLIST_TASKS) autoplay {boolean} Advance statuses on a timer: the running task finishes and the next to-do starts, until none are left (default: true) stepMs {number} Milliseconds between autoplay steps (default: 1400) collapsible {boolean} The header toggles the list; the count and bar stay visible (default: false) defaultOpen {boolean} Initial list state when collapsible (default: true) retryLabel {string} Label of the button on a failed task (default: "Retry") onChange {(tasks: Task[]) => void} Fires with the whole list whenever a status changes, by autoplay or retry onRetry {(task: Task) => void} Fires when a failed task's retry is pressed; the task is set to running onToggle {(open: boolean) => void} Fires when a collapsible list opens or closes ResultCards({ theme, items = RESULT_ITEMS, layout = "row", columns = 2, intro = "Four support tools fit Northwind's stack. Helpdesk Pro is the closest match.", actionLabel = "Choose", selectedLabel = "Chosen", onSelect }) items {{ id: string, title: string, subtitle?: string, meta?: string, badge?: string, image?: string | ReactNode, href?: string, actionLabel?: string, onAction?: (item) => void }[]} Cards to show; without an image a neutral placeholder tile renders (default: RESULT_ITEMS) layout {"row" | "grid"} row scrolls horizontally with snap points, grid wraps into `columns` (default: "row") columns {number} Columns in grid layout on wide containers; narrow containers collapse to one (default: 2) intro {string} One line above the cards, written as the agent's sentence (default: "Four support tools fit Northwind's stack. Helpdesk Pro is the closest match.") actionLabel {string} Label of each card's outline action unless the item sets its own (default: "Choose") selectedLabel {string} Action label on the selected card (default: "Chosen") onSelect {(item) => void} Fires when a card's title or action is activated; the card is also marked as selected ReasoningSteps({ theme, steps = REASON_STEPS, autoplay = true, stepMs = 900, runningLabel = "Thinking", summaryLabel, collapsed = true, collapseDelayMs = 700, onDone, onToggle }) steps {{ id: string, kind: "thought" | "search" | "read" | "tool" | "write", label: string, detail?: string, durationMs?: number }[]} Steps in order; each shows for its durationMs, or stepMs when absent (default: REASON_STEPS) autoplay {boolean} Stream the steps in on mount; false renders the finished trace with no timers (default: true) stepMs {number} Fallback duration for a step without durationMs (default: 900) runningLabel {string} Header text while running (default: "Thinking") summaryLabel {string | (seconds: number) => string} Header text once done; a function receives the total seconds (default: `Thought for ${seconds} seconds`) collapsed {boolean} Fold to the summary line once done; false leaves the steps open (default: true) collapseDelayMs {number} Pause between the last step and the fold (default: 700) onDone {(seconds: number) => void} Fires when the last step finishes (autoplay only) onToggle {(open: boolean) => void} Fires when the trace opens or folds, by click or by the automatic fold QuestionCard({ theme, title = "Before Alpha continues", questions = QCARD_QUESTIONS, skipLabel = "Skip, use defaults", nextLabel = "Next", doneLabel = "Continue", otherLabel = "Other", otherPlaceholder = "Tell Alpha what you would prefer", skippedText = "Skipped. Alpha will go with its defaults.", onAnswer, onComplete, onSkip }) title {string} Header line beside the agent mark (default: "Before Alpha continues") questions {{ id: string, question: string, context?: string, options: { id: string, label: string, sub?: string }[], allowOther?: boolean }[]} Questions in order (default: QCARD_QUESTIONS) skipLabel {string} Ghost action that hands the decision back to the agent (default: "Skip, use defaults") nextLabel {string} Primary action between questions (default: "Next") doneLabel {string} Primary action on the last question (default: "Continue") otherLabel {string} Label of the free-text option when a question allows it (default: "Other") otherPlaceholder {string} Placeholder of the free-text field (default: "Tell Alpha what you would prefer") skippedText {string} Line shown after skipping (default: "Skipped. Alpha will go with its defaults.") onAnswer {(questionId: string, optionId: string) => void} Fires when an option is picked; "other" for the free-text option onComplete {(answers: Record) => void} Fires once with every answer when the last question is confirmed onSkip {() => void} Fires when the user skips the remaining questions Message({ theme, role = "agent", text = MSG_DEMO_TEXT, children, name, time, avatar, status, actions = [], streaming = false, sources = [], compact = false }) role {"user" | "agent" | "system"} Who is speaking; sets alignment, bubble and default avatar (default: "agent") text {string} The message as plain text (default: MSG_DEMO_TEXT); `children` replaces it with any content children {node} Rich content for the turn; wins over `text` name {string} Speaker name; shown above an agent turn, used for the user's default avatar time {string} Timestamp label shown with the turn, for example "2:47 PM" avatar {node} Replaces the default avatar; `null` hides it. Default is AgentGlyph for the agent and Avatar with the name for the user status {"sending" | "sent" | "failed"} Delivery state of a user turn; failed keeps the actions visible so Retry is reachable actions {{ label: string, icon?: node | "copy" | "retry" | "up" | "down" | "check" | "edit", onClick: () => void, active?: boolean }[]} Quiet actions shown on hover and focus streaming {boolean} Shows a caret at the end of the text while it arrives (default: false) sources {{ name: string, href?: string }[]} Source chips under an agent turn compact {boolean} Tighter spacing, smaller avatar and type (default: false) MediaGeneration({ theme, prompt = MEDIAGEN_PROMPT, status = "generating", progress = 42, etaSeconds = 9, src, aspect = "16:9", variations = 1, autoplay = true, generateMs = 4200, error = "The image service timed out. Nothing was charged.", onRegenerate, onDownload, onVariation }) prompt {string} The prompt that produced the media, shown above the frame (default: MEDIAGEN_PROMPT) status {"queued" | "generating" | "done" | "failed"} Current state when autoplay is off (default: "generating") progress {number} 0 to 100 while generating, when autoplay is off (default: 42) etaSeconds {number} Seconds left, shown beside the progress bar (default: 9) src {string} Image url once done; without one a neutral tile placeholder renders (default: undefined) aspect {"1:1" | "4:3" | "16:9" | "9:16"} Frame proportion, kept in every state (default: "16:9") variations {number} Number of frames shown when done (default: 1) autoplay {boolean} Walks queued, generating and done on its own over `generateMs`; false renders `status` with no timers (default: true) generateMs {number} Length of the generating phase in autoplay (default: 4200) error {string} Message shown in the failed state (default: "The image service timed out. Nothing was charged.") onRegenerate {() => void} Fires from Regenerate and from Retry onDownload {() => void} Fires from Download onVariation {(index: number) => void} Fires when a variation frame is chosen Marker({ theme, n = 1, source = MARKER_SOURCE, variant = "number", onOpen }) n {number | string} The marker's number or label (default: 1) source {{ name: string, title?: string, url?: string, snippet?: string }} What the marker points at; shown in the card on hover or focus (default: MARKER_SOURCE) variant {"number" | "dot" | "name"} Number shows `n` in mono, dot shows a small accent dot, name shows the source name (default: "number") onOpen {(source) => void} Fires on click or Enter; the card stays a hover and focus preview DocumentAgent({ theme, title = "Refund policy · runbook", agentName = "Alpha", blocks = DOCAGENT_BLOCKS, edits = DOCAGENT_EDITS, autoplay = true, stepMs = 1400, acceptAllLabel = "Accept all", onAccept, onReject, onAcceptAll }) title {string} Document name shown in the header (default: "Refund policy · runbook") agentName {string} Name of the agent proposing the edits (default: "Alpha") blocks {{ id: string, type: "h1" | "h2" | "p" | "li", text: string }[]} The document as blocks (default: DOCAGENT_BLOCKS) edits {{ id: string, blockId: string, kind: "replace" | "insert" | "delete", text?: string, reason?: string }[]} Suggested edits; insert places a new block after blockId (default: DOCAGENT_EDITS) autoplay {boolean} Edits arrive one by one every `stepMs`; false shows them all at once with no timers (default: true) stepMs {number} Milliseconds between arriving edits (default: 1400) acceptAllLabel {string} Header action label (default: "Accept all") onAccept {(edit) => void} Fires when one edit is accepted onReject {(edit) => void} Fires when one edit is rejected onAcceptAll {() => void} Fires when every pending edit is accepted from the header Conversation({ theme, messages = CONV_MESSAGES, renderMessage, children, autoScroll = true, jumpLabel = "Jump to latest", typing = false, typingLabel = "Thinking", height = 420, frame = true, emptyState, compact = false }) messages {{ id: string, role: "user" | "agent" | "system", text?: string, time?: string, status?: string, sources?: object[], actions?: object[], streaming?: boolean, name?: string }[]} Turns in order; every field is passed on to Message (default: CONV_MESSAGES) renderMessage {(message: object, index: number) => node} Replaces the default Message for a turn children {node} Turns rendered instead of `messages`, for fully custom content autoScroll {boolean} Follow new content while the reader is at the bottom; scrolling up pauses it and shows a jump pill (default: true) jumpLabel {string} Text of the jump pill (default: "Jump to latest") typing {boolean} Shows the agent's thinking indicator after the last turn (default: false) typingLabel {string} Label beside the thinking dots (default: "Thinking") height {number} Height of the log in px (default: 420) frame {boolean} Draw a hairline border and rounded corners around the log (default: true) emptyState {node} Shown when there are no turns; the default invites the first question compact {boolean} Passed on to every Message (default: false) ChatInput({ theme, value, onChange, onSubmit, placeholder = "Ask Alpha about your inbox…", suggestions = CHATIN_SUGGESTIONS, onSuggestion, attachments = [], onAttach, onRemoveAttachment, models = CHATIN_MODELS, model, onModelChange, streaming = false, onStop, onVoice, disabled = false, maxRows = 6 }) value {string} Controlled text; leave undefined and the field keeps its own state onChange {(text: string) => void} Fires on every edit, and with "" after a send onSubmit {(text: string) => void} Fires with the trimmed text on Enter or the send button placeholder {string} Placeholder and accessible name of the field (default: "Ask Alpha about your inbox…") suggestions {string[]} Prompt chips above the field; [] hides the row (default: CHATIN_SUGGESTIONS) onSuggestion {(text: string) => void} Fires when a chip is picked; without it the chip fills the field attachments {{ id: string, name: string, kind?: string }[]} Files shown as removable chips (default: []) onAttach {() => void} Shows the attach button and fires when it is pressed onRemoveAttachment {(id: string) => void} Fires from an attachment chip's remove control models {{ id: string, label: string }[]} Choices in the model pill; [] hides the pill (default: CHATIN_MODELS) model {string} Controlled model id; leave undefined and the pill keeps its own state onModelChange {(id: string) => void} Fires when a model is picked streaming {boolean} Turns the send button into Stop (default: false) onStop {() => void} Fires when Stop is pressed onVoice {() => void} Shows the mic button and fires when it is pressed disabled {boolean} Disables the field and every control (default: false) maxRows {number} Rows the field grows to before it scrolls (default: 6) ChatHistory({ theme, threads = CHATHIST_THREADS, activeId, onSelect, onNew, onRename, onDelete, onPin, search = true, groupBy = "day", title = "Chats", width = 280, height = 420 }) threads {{ id: string, title: string, preview?: string, time: string | Date, pinned?: boolean, unread?: boolean }[]} Threads to list; `time` is an ISO string or a Date (default: CHATHIST_THREADS) activeId {string} Controlled selection; leave undefined and the list keeps its own onSelect {(id: string) => void} Fires when a row is picked onNew {() => void} Shows the new-thread button in the header and fires when it is pressed onRename {(id: string, title: string) => void} Enables Rename in the row menu; the new name is typed inline onDelete {(id: string) => void} Enables Delete in the row menu onPin {(id: string) => void} Enables Pin / Unpin in the row menu search {boolean} Shows a search field that filters titles and previews (default: true) groupBy {"day" | "none"} Group rows under Pinned, Today, Yesterday and Earlier headings, or list them flat (default: "day") title {string} Header label (default: "Chats") width {number} Width of the list in px (default: 280) height {number} Height of the list in px; content scrolls inside it (default: 420) Attachment({ theme, name = "refund-policy.pdf", kind = "pdf", size = "1.2 MB", status = "ready", progress = 0, thumbnail, variant = "chip", onRemove, onOpen }) name {string} File name, truncated in the middle of the row when long (default: "refund-policy.pdf") kind {"image" | "pdf" | "doc" | "sheet" | "code" | "audio" | "file"} Picks the two or three letter glyph and its tint (default: "pdf") size {string} Human size shown beside the name, for example "1.2 MB" (default: "1.2 MB") status {"uploading" | "ready" | "failed"} Ready shows the glyph, uploading shows progress, failed tints the tile and says so (default: "ready") progress {number} 0 to 100 while uploading (default: 0) thumbnail {string} Image url, used in the tile for kind "image" only (default: undefined) variant {"chip" | "card"} Chip is one line for a composer; card adds a second line and a progress bar (default: "chip") onRemove {() => void} Shows a labelled remove button and fires when it is pressed onOpen {() => void} Makes the name a button that fires when pressed ## shadcn/ui names (aliases of the components above) Input Textarea Switch Separator Alert Empty Item Command ## Registries (for building indexes and docs) PATTERN_GROUPS UX_PATTERNS DESIGN_HEURISTICS ACCENT_COLORS INSTALL_PROMPT