# AsterUI (@fierst/ui) 1.0.2 > Code-owned TSX components for Aster. This single-file manual contains installation, theming, integration and the public API for every registry item. # AsterUI AsterUI (`@fierst/ui`) is a source registry for Aster applications. Installing a registry item copies TypeScript, TSX and CSS into your project. Import the named exports from those local files. You can edit, test and version them with the rest of your application. ## Install and render your first component Start in the root of an Aster project using Node.js 20.19 or later, `@fierst/aster@^1.2.0`, and the Aster Vite plugin. With Vite+ installed, run the following commands. You can also use `npx @fierst/ui` in place of `vp dlx @fierst/ui`. ```sh vp dlx @fierst/ui init vp add @lucide/icons vp dlx @fierst/ui add button ``` In `src/main.tsx`, mount a button into the starter page's `#app` element. ```tsx import { render } from '@fierst/aster'; import { Button } from './ui/button'; import { initTheme, setTheme } from './ui/theme'; initTheme(); render( , document.getElementById('app')!, ); ``` Run your project's development server (`vp dev` in the starter). Components import the shared stylesheet automatically. Import `./ui/theme.css` yourself on pages that use only the tokens or controller. ## Documentation - [Component and API reference](https://github.com/fierstdev/ui/blob/v1.0.2/docs/components.md) lists every registry item, companion export, prop type, callback, dependency and source file. - [Theme cookbook](https://github.com/fierstdev/ui/blob/v1.0.2/docs/themes.md) covers presets, light/dark/system switching, saved preferences, custom palettes and accessible styling. - [Integration guide](https://github.com/fierstdev/ui/blob/v1.0.2/docs/integration.md) covers CLI flags, code-owned updates, programmatic installation, state, forms, overlays, charts, AI workflows and all eight generator flows. - [Design guide](https://github.com/fierstdev/ui/blob/v1.0.2/DESIGN.md) describes the visual system. - [Single-file reference for language models](https://github.com/fierstdev/ui/blob/v1.0.2/llms.txt) combines the guides and API contracts in one text file. The showcase build serves it at `/llms.txt`. - [Release history](https://github.com/fierstdev/ui/blob/v1.0.2/CHANGELOG.md) records changes to installed components. [Explore the showcase](https://ui.fierst.dev). ## Working on the registry Install dependencies with `pnpm install --frozen-lockfile`. Edit component source under `src/ui` and item metadata in `registry.json`. Run `npm run build:registry` to refresh the static manifests and `npm run build:docs` to refresh the API reference and single-file guide. Run `npm run check`, `npm test`, `npm run build` and `npm run test:browser` before release. The browser suite uses Playwright Chromium. # Themes ## Choose a starting theme Call `initTheme()` once in the browser entry before mounting. Its defaults are system mode, blue preset, medium radius and comfortable density. CSS works before JavaScript runs. For a specific first paint, render the corresponding attributes on the document root, for example ``. If your server knows the user's preferences, use the same values on both sides. The controller stores state in a module-level signal, so keep per-request preferences in the rendered HTML during SSR. | Preset | Seed hue | Seed chroma | | ------- | -------: | ----------: | | zinc | 285 | 0.006 | | blue | 255 | 0.20 | | emerald | 158 | 0.16 | | violet | 285 | 0.20 | | rose | 16 | 0.20 | | amber | 55 | 0.18 | `THEME_PRESETS` supplies each preset's id, display label, hue and swatch for a picker. The zinc preset has explicit monochrome primary roles. Use a chromatic preset as the base for a custom accent. ## Switch and remember preferences ```tsx import { THEME_PRESETS, initTheme, setTheme, themeState } from './ui/theme'; initTheme({ preset: 'emerald' }); // A saved preference takes precedence. export function* ThemePicker() { for (;;) { const current = themeState(); yield (
Appearance {(['system', 'light', 'dark'] as const).map((mode) => ( ))} {THEME_PRESETS.map(({ id, label }) => ( ))}
); } } ``` `system` follows the OS via `prefers-color-scheme`, including later OS changes. Explicit light and dark modes override it. `setTheme(patch)` merges fields, updates the signal and root attributes, and writes the entire configuration to local storage under `aster-ui-theme`. `setTheme(patch, false)` applies a temporary change. The next persisted change saves the then-current configuration. Use `themeState()` for reactive reads and `themeState.peek()` for snapshots. Apply changes through `setTheme` so the DOM and storage stay in sync. `initTheme(defaults)` merges current state, supplied defaults, then saved values and returns the result. Storage access and JSON parse failures are tolerated. To restore factory settings and remember them, call `setTheme({ mode: 'system', preset: 'blue', radius: 'md', density: 'comfortable', customHue: undefined })`. ## Build a custom theme For a user-selected accent, supply a numeric hue in degrees. Clearing `customHue` restores the preset seed. Radius options are `none`, `sm`, `md`, and `lg` (control radii 0, 6, 8 and 12 px). Density options are `compact` (0.9) and `comfortable` (1). Coarse pointers use dedicated control sizes. ```ts setTheme({ preset: 'blue', customHue: 205, radius: 'lg', density: 'compact' }); ``` For a named brand, add an application stylesheet after the theme import. The library defines its defaults in CSS cascade layers. Keep your brand rules unlayered. Put the seed on the root where the derived tokens are computed. Give your brand its own attribute, leaving the typed preset field available to the controller. ```css :root[data-brand='lagoon'] { --aster-seed-hue: 205; --aster-seed-chroma: 0.14; --aster-neutral-tint: 0.006; --aster-font-sans: system-ui, sans-serif; } ``` ```ts setTheme({ preset: 'blue', customHue: undefined }); document.documentElement.dataset.brand = 'lagoon'; // Return to the selected built-in preset: delete document.documentElement.dataset.brand; ``` Persist the application-owned brand separately if users can select it. A controller-set custom hue is an inline CSS property and takes precedence over stylesheet seeds. To add a preset to your owned copy itself, extend `ThemePreset`, add its id/label/hue/swatch to `THEME_PRESETS`, and add its `:root[data-aster-preset='…']` seed rules in `theme.css`. Use semantic roles in app CSS, for example `background: var(--aster-surface)` and `color: var(--aster-on-surface)`. The seed drives OKLCH-derived roles where supported. The stylesheet also defines static sRGB fallbacks. For an exact brand color across browsers override the semantic roles directly, including hover, foreground, subtle fill/ink, border and focus ring. Provide dark values for both explicit dark mode and system dark mode. Verify contrast, focus, disabled controls and chart labels under each mode. Individual components can also define local styling; edit their owned source for exceptions. The shared stylesheet defines global box sizing, body colors and typography, modal scroll locking and popover surfaces. It adjusts borders for increased contrast, transition durations for reduced motion, and touch control sizes for coarse pointers. The component reference includes the full token inventory. # Integrating AsterUI ## Install, inspect and update owned files | Command or option | Behavior | | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | | `vp dlx @fierst/ui list` | List slugs, descriptions and direct registry dependencies. | | `vp dlx @fierst/ui init` | Install the shared theme controller, CSS and Lucide icon helper. | | `vp dlx @fierst/ui add dialog toast` | Resolve both items and their transitive registry dependencies once, then copy their files. You can use add without init. | | `--dir src/controls` | Change the destination from `src/ui`. Use the same directory for related items so sibling imports resolve. | | `--registry ./public/r` | Read index.json and item manifests from a local directory. The default registry ships in the npm package. | | `--registry https://ui.fierst.dev/r` | Read manifests from an HTTP(S) base URL. | | `--force` | Replace existing target files, including resolved dependencies. Without this flag existing files are skipped. | Run the npm dependency command printed by the installer. Registry dependencies are other source items, while package dependencies such as `@lucide/icons` belong in the consuming project. Use a versioned invocation such as `npx @fierst/ui@1.0.2 add dialog` for reproducible installs from the bundled registry. To update edited components, install the new version into a separate directory, compare the files and merge the changes you want. Include theme and icon dependencies in that comparison. The Node API is available after installing `@fierst/ui` as a development dependency. Both functions return promises. ```js import { addComponents, listRegistryItems } from '@fierst/ui/bin/aster-ui.mjs'; const items = await listRegistryItems(); const result = await addComponents(['dialog', 'toast'], process.cwd(), { uiDir: 'src/ui', force: false, }); console.log(items.length, result.resolved, result.dependencies, result.copied, result.skipped); ``` Pass a registry path or URL to `listRegistryItems(source)` or use `{ registry: source }` with `addComponents`. The index lists each item's name, type, title, description, dependency arrays and file targets. Each item manifest includes the source content and SHA-256 digest for each file. The installer checks supplied digests and resolves dependencies before copying. If resolution fails, check the slug and registry base; for a checksum error rebuild or replace the inconsistent manifest. ## Render and update components Use TSX with the Aster Vite plugin and `jsxImportSource: "@fierst/aster"`. Render components as JSX, including components implemented as generator functions. Aster supplies their context. In the reference, `View` denotes renderable content, `?` marks an optional prop, and destructuring defaults show the value used when omitted. Each contract names its callbacks and their payloads. Some wrap native events; others deliver the next value directly. For a controlled switch, keep the value in the parent. For a standalone switch, pass `defaultChecked` for the initial value and optionally observe changes with `onChange`. ```tsx import { signal } from '@fierst/aster'; import { Switch } from './ui/switch'; export function* Preferences() { const enabled = signal(true); for (;;) { yield ( enabled.set(next)} /> ); } } ``` For a form, install `form input button`, give the input a name, and handle the submit event. `Form` prevents the browser's default navigation. `Input` associates its label, hint and error with the field. Give icon-only buttons an accessible name. Use a title on dialogs and meaningful row keys for dynamic data. ```tsx import { Form, FormActions } from './ui/form'; import { Input } from './ui/input'; import { Button } from './ui/button'; export function ContactForm({ save }: { save: (email: string) => void }) { return (
{ const data = new FormData(event.currentTarget as HTMLFormElement); save(String(data.get('email'))); }} >
); } ``` ## Dialogs, decisions and notifications Render a controlled overlay when the parent owns its open state. For a multi-step interaction, delegate from an Aster generator with `yield*`. The helper yields views until a decision arrives, then execution resumes with the result. Set the trigger back to idle before rendering the next frame. ```tsx import { signal } from '@fierst/aster'; import { confirmDialog } from './ui/dialog'; import { Toaster, toast } from './ui/toast'; export function* Review() { const reviewing = signal(false); for (;;) { if (reviewing()) { const approved = yield* confirmDialog({ title: 'Approve the draft?' }); reviewing.set(false); if (approved) toast.success('Draft approved'); } yield ( <> ); } } ``` Mount one `Toaster` for application notifications. `showToast` returns an id for `dismissToast`. The default duration is 3500 ms; a duration of zero keeps the toast until dismissal or displacement. The store retains up to five items. | Helper | Registry item | Result | | ------------------ | ------------- | -------------------------------------------------------------------------------------------- | | confirmDialog | dialog | true on confirmation, false on cancellation or dismissal | | confirmDestructive | alert-dialog | boolean decision, with optional typed confirmation phrase | | pickCommand | command | selected CommandItem or null | | pickDate | calendar | selected YYYY-MM-DD string or null | | runWizard | stepper | final state object or null on cancel; each step renders from state and can supply canProceed | | promptDrawer | drawer | selected action id or null | | runTour | tour | true on completion, false on skip or an empty tour | | requestApproval | approval-card | true on approval, false on rejection | ## Display records and charts Install `data-table line-chart` for a sortable table and SVG chart. Column keys identify row fields. Supply a custom column render function for formatted cells. Line and area charts accept ordered label/value points. ```tsx import { DataTable } from './ui/data-table'; import { AreaChart } from './ui/line-chart'; const rows = [ { day: 'Monday', requests: 12 }, { day: 'Tuesday', requests: 18 }, ]; export function Traffic() { return ( <> row.day} columns={[ { key: 'day', header: 'Day' }, { key: 'requests', header: 'Requests', sortable: true }, ]} /> ({ label: row.day, value: row.requests }))} /> ); } ``` ## Connect AI and human review workflows Feed application messages to `ChatMessage`, response text to `StreamingText`, reasoning to `ReasoningBlock`, and tool activity to `ToolCallCard`. Use `PromptInput.onSubmit(prompt)` to start your request, update its `streaming` prop while generating, and wire `onStop` to your cancellation handler. Present sources with `CitationBadge` and `SourceList`, suggested prompts with `SuggestionChips`, and metering with `TokenUsageBar`. Map workflow records to `WorkflowGraph` nodes with a stable id, label, optional detail and status. Status values are `pending`, `running`, `waiting`, `done`, `replayed`, and `failed`. Use `ApprovalCard` callbacks or `yield* requestApproval(...)` to collect a decision. Your application connects it to the corresponding workflow run and handles persistence, authorization, retries and tool execution. The showcase's AI workspace provides a complete UI composition. # AsterUI — Design Philosophy **AsterUI** is a **104-item** code-owned UI component library built by **Fierst LLC** for Aster. Rather than chasing novelty for novelty’s sake, AsterUI models its visual discipline and ergonomics on proven modern UI conventions—crisp opaque surfaces, `1px` hairline borders, restrained shadows, predictable keyboard navigation, and tabular numerals—enhanced by a single-seed OKLCH color engine, sensible micro-animations, zero-dependency SVG charts, and 8 Aster-native `yield*` interactive flows. --- ## 1. Proven Surface & Contrast Hierarchy - **Crisp Opaque Surfaces:** Pages (`--aster-bg`), cards (`--aster-surface`), muted panels (`--aster-surface-muted`), and floating overlays (`.aster-surface-popover`) stay solid and crisp with `1px` hairline borders and restrained shadows. - **Inverted Tooltips:** Tooltips use high-contrast inverted polarity (`--aster-inverted-bg` / `--aster-inverted-fg`) for instant legibility over any light or dark canvas. - **Tinted Hairline Status Roles:** Semantic badges, alerts, diff highlights, and workflow nodes pair a gentle tinted fill with a matching `1px` border and accessible ink. ## 2. Single-Seed OKLCH Color Engine - Override `--aster-seed-hue` and `--aster-seed-chroma`—or choose from 6 curated presets (`zinc` monochrome, `blue`, `emerald`, `violet`, `rose`, `amber`)—and OKLCH computes primary fills, hover states, subtle containers, seed-based chart accents, borders, and focus rings across Light and Dark modes with sRGB fallbacks across Chrome, Safari, Firefox, and Edge. ## 3. Familiar Radius Scale (`none` / `sm` / `md` / `lg`) & Sensible Micro-Animations - Clean corner presets (`0px`, `6px`, `8px` default, `12px`) with fast `130–200ms` transitions, subtle `scale(0.98)` press feedback, spring toggle thumbs, and automatic `prefers-reduced-motion` support. ## 4. Built for Both Everyday Apps & Durable AI Workflows (`@fierst/flow`) - Beyond complete SaaS layout, form, overlay, and chart coverage, AsterUI ships 10 dedicated AI & Human-in-the-Loop primitives (`ChatMessage`, `PromptInput`, `StreamingText`, `ReasoningBlock`, `ToolCallCard`, `ApprovalCard`, `CitationBadge`, `SuggestionChips`, `TokenUsageBar`, `WorkflowGraph`) plus `DiffViewer` and `Timeline`—making `@fierst/flow` apps feel native out of the box. See [the theme cookbook](https://github.com/fierstdev/ui/blob/v1.0.2/docs/themes.md) for working examples and [the API reference](https://github.com/fierstdev/ui/blob/v1.0.2/docs/components.md#theme) for the exact tokens and controller contracts. # Component and API reference The 104 registry items below are sorted by install slug. Each entry includes its local imports, direct dependencies and public declarations. In function signatures, the first parameter describes the props; Aster supplies the context parameter. Open the implementation for internal defaults or the linked showcase for an example with application state. - [accordion](#accordion) — Accordion - [alert](#alert) — Alert & Banner - [alert-dialog](#alert-dialog) — AlertDialog & yield* confirmDestructive() - [app-shell](#app-shell) — AppShell, Sidebar & NavItem - [approval-card](#approval-card) — ApprovalCard & yield* requestApproval() - [aspect-ratio](#aspect-ratio) — AspectRatio - [avatar](#avatar) — Avatar & AvatarGroup - [back-to-top](#back-to-top) — BackToTop - [badge](#badge) — Badge - [banner-cookie](#banner-cookie) — ConsentBanner - [bar-chart](#bar-chart) — BarChart - [breadcrumb](#breadcrumb) — Breadcrumb - [button](#button) — Button & ButtonGroup - [calendar](#calendar) — Calendar, DatePicker & yield* pickDate() - [calendar-heatmap](#calendar-heatmap) — CalendarHeatmap - [card](#card) — Card - [carousel](#carousel) — Carousel - [chat-message](#chat-message) — ChatMessage & ChatList - [checkbox](#checkbox) — Checkbox, CheckboxGroup & RadioGroup - [citation-badge](#citation-badge) — CitationBadge & SourceList - [collapsible](#collapsible) — Collapsible - [color-picker](#color-picker) — ColorPicker - [combobox](#combobox) — Combobox - [command](#command) — CommandPalette & yield* pickCommand() - [command-bar](#command-bar) — FilterBar - [container](#container) — Container, Stack & Cluster - [context-menu](#context-menu) — ContextMenu - [copy-button](#copy-button) — CopyButton & CodeBlock - [currency-input](#currency-input) — CurrencyInput - [data-table](#data-table) — DataTable - [date-range-picker](#date-range-picker) — DateRangePicker - [description-list](#description-list) — DescriptionList - [dialog](#dialog) — Dialog & yield* confirmDialog() - [diff-viewer](#diff-viewer) — DiffViewer - [donut-chart](#donut-chart) — DonutChart - [drawer](#drawer) — Drawer & yield* promptDrawer() - [empty-state](#empty-state) — EmptyState - [file-upload](#file-upload) — FileUpload - [footer](#footer) — Footer - [form](#form) — Form, FormSection & FormActions - [grid](#grid) — Grid, BentoGrid & BentoCard - [hover-card](#hover-card) — HoverCard - [icon](#icon) — Icon (Lucide) - [inline-edit](#inline-edit) — InlineEdit - [input](#input) — Input & Textarea - [input-otp](#input-otp) — InputOTP - [json-viewer](#json-viewer) — JsonViewer - [kanban](#kanban) — KanbanBoard - [kbd](#kbd) — Kbd & KbdGroup - [label](#label) — Label & Field - [line-chart](#line-chart) — LineChart & AreaChart - [mention-input](#mention-input) — MentionInput - [menubar](#menubar) — Menubar - [meter](#meter) — Meter - [metric-list](#metric-list) — MetricList - [multi-select](#multi-select) — MultiSelect - [navbar](#navbar) — Navbar - [navigation-menu](#navigation-menu) — NavigationMenu - [number-input](#number-input) — NumberInput - [page-header](#page-header) — PageHeader - [pagination](#pagination) — Pagination - [password-input](#password-input) — PasswordInput - [phone-input](#phone-input) — PhoneInput - [popover](#popover) — Popover & DropdownMenu - [progress](#progress) — Progress, ProgressRing & Skeleton - [prompt-input](#prompt-input) — PromptInput - [prose](#prose) — Prose & Text - [range-slider](#range-slider) — RangeSlider - [rating](#rating) — Rating - [reasoning-block](#reasoning-block) — ReasoningBlock - [resizable](#resizable) — ResizableSplit - [scroll-area](#scroll-area) — ScrollArea - [search-input](#search-input) — SearchInput - [section-header](#section-header) — SectionHeader - [segmented-control](#segmented-control) — SegmentedControl - [select](#select) — Select (Searchable Combobox) - [separator](#separator) — Separator - [sheet](#sheet) — Sheet (Drawer) - [sidebar-nav](#sidebar-nav) — SidebarNav - [slider](#slider) — Slider - [sparkline](#sparkline) — Sparkline - [spinner](#spinner) — Spinner & LoadingOverlay - [stat-card](#stat-card) — StatCard & StatGrid - [status-dot](#status-dot) — StatusDot & UptimeBar - [stepper](#stepper) — Stepper & yield* runWizard() - [sticky-bar](#sticky-bar) — StickyActionBar - [streaming-text](#streaming-text) — StreamingText - [suggestion-chips](#suggestion-chips) — SuggestionChips - [switch](#switch) — Switch - [table](#table) — Table - [tabs](#tabs) — Tabs - [tag-input](#tag-input) — TagInput - [theme](#theme) — Theme & Design Tokens - [time-picker](#time-picker) — TimePicker - [timeline](#timeline) — Timeline - [toast](#toast) — Toast & Toaster - [toggle](#toggle) — Toggle & ToggleGroup - [token-usage](#token-usage) — TokenUsageBar - [tool-call-card](#tool-call-card) — ToolCallCard - [tooltip](#tooltip) — Tooltip - [tour](#tour) — TourCard & yield* runTour() - [tree-view](#tree-view) — TreeView - [visually-hidden](#visually-hidden) — VisuallyHidden & SkipLink - [workflow-graph](#workflow-graph) — WorkflowGraph ## accordion Zero-JS native
Accordion supporting both type='single' (auto-close inactive panels) and type='multiple' (expand all simultaneously). Install with `vp dlx @fierst/ui add accordion`. Direct registry dependencies: theme, icon. Direct npm dependencies: @lucide/icons. Exports from `./ui/accordion`: `AccordionItem`, `Accordion`. Minimal TSX usage ```tsx import { Accordion } from './ui/accordion'; ( ) ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/accordion.tsx) · [ai.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/ai.tsx#L214) API contracts ```ts export interface AccordionItem { id: string; title: string; content: View; defaultOpen?: boolean; } export function Accordion({ items, type = 'single', exclusive, class: extraClass, }: { items: readonly AccordionItem[]; type?: 'single' | 'multiple'; /** Legacy alias for `type === 'single'`. Takes precedence if explicitly passed. */ exclusive?: boolean; class?: string; }) ``` ## alert Semantic status callouts and full-bleed banners with Lucide status icons, action slots, and optional dismissal. Install with `vp dlx @fierst/ui add alert`. Direct registry dependencies: theme, icon. Direct npm dependencies: @lucide/icons. Exports from `./ui/alert`: `AlertTone`, `Alert`, `Banner`. Minimal TSX usage ```tsx import { Alert } from './ui/alert'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/alert.tsx) · [overview.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/overview.tsx#L117) API contracts ```ts export type AlertTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger'; export function* Alert( props: { tone?: AlertTone; title?: string; description?: string; action?: View; dismissible?: boolean; banner?: boolean; onDismiss?: () => void; class?: string; children?: View; }, ctx: Ctx, ) export function Banner(props: { tone?: AlertTone; title?: string; description?: string; action?: View; dismissible?: boolean; onDismiss?: () => void; class?: string; children?: View; }) ``` ## alert-dialog High-friction destructive confirmation dialog with optional phrase-typing guard and yield* confirmDestructive(). Install with `vp dlx @fierst/ui add alert-dialog`. Direct registry dependencies: theme, icon, dialog, button, input. Direct npm dependencies: @lucide/icons. Exports from `./ui/alert-dialog`: `AlertDialog`, `confirmDestructive`. Minimal TSX usage ```tsx import { AlertDialog } from './ui/alert-dialog'; {}} /> ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/alert-dialog.tsx) · [overlays.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/overlays.tsx#L354) API contracts ```ts export function* AlertDialog( props: { open?: any; title: string; description: string; confirmPhrase?: string; confirmLabel?: string; cancelLabel?: string; onConfirm: () => void; onCancel?: () => void; }, ctx: Ctx, ) export function* confirmDestructive(opts: { title: string; description: string; confirmPhrase?: string; confirmLabel?: string; }): Generator ``` ## app-shell Mobile-first application layout with icon-only collapsible desktop sidebar, automatic mobile Sheet drawer, crisp topbar, and plain NavItem. Install with `vp dlx @fierst/ui add app-shell`. Direct registry dependencies: theme, icon, sheet. Direct npm dependencies: @lucide/icons. Exports from `./ui/app-shell`: `NavItem`, `Sidebar`, `AppShell`. Minimal TSX usage ```tsx import { AppShell } from './ui/app-shell'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/app-shell.tsx) · [showcase.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase.tsx#L529) API contracts ```ts export function NavItem({ href, label, icon, active = false, compact = false, badge, onClick, class: extraClass, }: { href?: string; label: string; icon?: LucideIconInput; active?: boolean; compact?: boolean; badge?: View; onClick?: (e: MouseEvent) => void; class?: string; }) export function Sidebar({ header, footer, collapsed = false, class: extraClass, children, }: { header?: View; footer?: View; collapsed?: boolean; class?: string; children?: View; }) export function* AppShell( props: { brand?: View; sidebar: View | ((opts: { collapsed: boolean; closeMobile: () => void }) => View); topbar?: View; collapsible?: boolean; class?: string; children?: View; }, ctx: Ctx, ) ``` ## approval-card @fierst/flow HITL approval card with assignee role, SHA-256 hash, code preview, and yield* requestApproval(). Install with `vp dlx @fierst/ui add approval-card`. Direct registry dependencies: theme, icon, badge, button. Direct npm dependencies: @lucide/icons. Exports from `./ui/approval-card`: `ApprovalCard`, `requestApproval`. Minimal TSX usage ```tsx import { ApprovalCard } from './ui/approval-card'; {}} onReject={() => {}} /> ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/approval-card.tsx) · [ai.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/ai.tsx#L159) API contracts ```ts export function ApprovalCard({ title, description, assigneeRole, artifactHash, codePreview, danger = false, approveLabel = 'Approve & Resume', rejectLabel = 'Reject', onApprove, onReject, class: extraClass, }: { title: string; description?: string; assigneeRole?: string; artifactHash?: string; codePreview?: string; danger?: boolean; approveLabel?: string; rejectLabel?: string; onApprove: () => void; onReject: () => void; class?: string; }) export function* requestApproval(opts: { title: string; description?: string; assigneeRole?: string; artifactHash?: string; codePreview?: string; danger?: boolean; }): Generator ``` ## aspect-ratio Native CSS aspect-ratio media wrapper for images, videos, and embeds. Install with `vp dlx @fierst/ui add aspect-ratio`. Direct registry dependencies: theme. Direct npm dependencies: none. Exports from `./ui/aspect-ratio`: `AspectRatio`. Minimal TSX usage ```tsx import { AspectRatio } from './ui/aspect-ratio'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/aspect-ratio.tsx) · [overlays.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/overlays.tsx#L291) API contracts ```ts export function AspectRatio({ ratio = 16 / 9, class: extraClass, children, }: { ratio?: number | string; class?: string; children?: View; }) ``` ## avatar Responsive user avatar with automatic initials fallback, status indicator dots, adaptive geometry, and overlapping AvatarGroup. Install with `vp dlx @fierst/ui add avatar`. Direct registry dependencies: theme. Direct npm dependencies: none. Exports from `./ui/avatar`: `AvatarSize`, `AvatarStatus`, `Avatar`, `AvatarGroup`. Minimal TSX usage ```tsx import { Avatar } from './ui/avatar'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/avatar.tsx) · [showcase.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase.tsx#L543) · [ops.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/ops.tsx#L219) API contracts ```ts export type AvatarSize = 'sm' | 'md' | 'lg' | 'xl'; export type AvatarStatus = 'online' | 'away' | 'busy' | 'offline'; export function* Avatar( props: { name: string; src?: string; alt?: string; size?: AvatarSize; status?: AvatarStatus; class?: string; }, ctx: Ctx, ) export function AvatarGroup({ items, max = 4, size = 'md', class: extraClass, }: { items: readonly { name: string; src?: string; status?: AvatarStatus }[]; max?: number; size?: AvatarSize; class?: string; }): View ``` ## back-to-top Scroll-aware floating pill button that appears smoothly past a scroll threshold. Install with `vp dlx @fierst/ui add back-to-top`. Direct registry dependencies: theme, icon. Direct npm dependencies: @lucide/icons. Exports from `./ui/back-to-top`: `BackToTop`. Minimal TSX usage ```tsx import { BackToTop } from './ui/back-to-top'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/back-to-top.tsx) · [overview.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/overview.tsx#L405) API contracts ```ts export function* BackToTop( props: { threshold?: number; label?: string; class?: string; }, ctx: Ctx, ) ``` ## badge High-contrast semantic status pills with optional indicator dot. Install with `vp dlx @fierst/ui add badge`. Direct registry dependencies: theme. Direct npm dependencies: none. Exports from `./ui/badge`: `BadgeTone`, `Badge`. Minimal TSX usage ```tsx import { Badge } from './ui/badge'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/badge.tsx) · [showcase.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase.tsx#L534) · [ai.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/ai.tsx#L175) · [directory.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/directory.tsx#L202) · [ops.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/ops.tsx#L95) · [overview.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/overview.tsx#L99) API contracts ```ts export type BadgeTone = 'neutral' | 'primary' | 'success' | 'warning' | 'danger'; export function Badge({ tone = 'neutral', dot = false, class: extraClass, children, ...rest }: { tone?: BadgeTone; dot?: boolean; class?: string; children?: View; [key: string]: any; }) ``` ## banner-cookie Non-intrusive bottom privacy consent banner with Accept All and Essential Only actions. Install with `vp dlx @fierst/ui add banner-cookie`. Direct registry dependencies: theme, button. Direct npm dependencies: none. Exports from `./ui/banner-cookie`: `ConsentBanner`. Minimal TSX usage ```tsx import { ConsentBanner } from './ui/banner-cookie'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/banner-cookie.tsx) · [overview.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/overview.tsx#L369) API contracts ```ts export function* ConsentBanner( props: { title?: string; description?: string; onAccept?: () => void; onDecline?: () => void; class?: string; }, ctx: Ctx, ) ``` ## bar-chart Zero-dependency responsive SVG bar chart with hover callouts and gridlines. Install with `vp dlx @fierst/ui add bar-chart`. Direct registry dependencies: theme. Direct npm dependencies: none. Exports from `./ui/bar-chart`: `ChartDatum`, `BarChart`. Minimal TSX usage ```tsx import { BarChart } from './ui/bar-chart'; ( ) ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/bar-chart.tsx) · [overview.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/overview.tsx#L182) API contracts ```ts export interface ChartDatum { label: string; value: number; } export function* BarChart( props: { data: readonly ChartDatum[]; height?: number; unit?: string; label?: string; class?: string; }, ctx: Ctx, ) ``` ## breadcrumb Horizontally scrollable semantic breadcrumb trail with Lucide chevrons and plain links. Install with `vp dlx @fierst/ui add breadcrumb`. Direct registry dependencies: theme, icon. Direct npm dependencies: @lucide/icons. Exports from `./ui/breadcrumb`: `BreadcrumbItem`, `Breadcrumb`. Minimal TSX usage ```tsx import { Breadcrumb } from './ui/breadcrumb'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/breadcrumb.tsx) · [overview.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/overview.tsx#L88) API contracts ```ts export interface BreadcrumbItem { label: string; href?: string; onClick?: (e: MouseEvent) => void; } export function Breadcrumb({ items, label = 'Breadcrumb', class: extraClass, }: { items: readonly BreadcrumbItem[]; label?: string; class?: string; }) ``` ## button Proven primary/secondary/outline/ghost/destructive/link buttons with subtle press feedback, Lucide loading spinner, and connected ButtonGroup. Install with `vp dlx @fierst/ui add button`. Direct registry dependencies: theme, icon. Direct npm dependencies: @lucide/icons. Exports from `./ui/button`: `ButtonVariant`, `ButtonSize`, `ButtonProps`, `Button`, `ButtonGroup`. Minimal TSX usage ```tsx import { Button } from './ui/button'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/button.tsx) · [showcase.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase.tsx#L216) · [ai.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/ai.tsx#L60) · [directory.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/directory.tsx#L206) · [forms.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/forms.tsx#L77) · [ops.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/ops.tsx#L140) · [overlays.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/overlays.tsx#L55) · [overview.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/overview.tsx#L105) API contracts ```ts export type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive' | 'link'; export type ButtonSize = 'sm' | 'md' | 'lg' | 'icon'; export interface ButtonProps { variant?: ButtonVariant; size?: ButtonSize; loading?: boolean; disabled?: boolean; type?: 'button' | 'submit' | 'reset'; class?: string; children?: View; [key: string]: any; } export function Button({ variant = 'outline', size = 'md', loading = false, disabled = false, type = 'button', class: extraClass, children, ...rest }: ButtonProps) export function ButtonGroup(props: { class?: string; children?: View; label?: string }) ``` ## calendar Zero-dependency Intl Calendar with Month & Year dropdowns (1900–2046) + direct date input, Popover DatePicker, and yield* pickDate(). Install with `vp dlx @fierst/ui add calendar`. Direct registry dependencies: theme, icon, button, dialog. Direct npm dependencies: @lucide/icons. Exports from `./ui/calendar`: `toIsoDate`, `Calendar`, `DatePicker`, `pickDate`. Minimal TSX usage ```tsx import { Calendar } from './ui/calendar'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/calendar.tsx) · [forms.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/forms.tsx#L278) API contracts ```ts export function toIsoDate(d: Date): string export function* Calendar( props: { value?: string; defaultValue?: string; min?: string; max?: string; /** Earliest selectable year in the year dropdown (default: 1900 or min's year). */ fromYear?: number; /** Latest selectable year in the year dropdown (default: currentYear + 20 or max's year). */ toYear?: number; locale?: string; embedded?: boolean; onChange?: (isoDate: string) => void; class?: string; }, ctx: Ctx, ) export function* DatePicker( props: { label?: string; value?: string; defaultValue?: string; min?: string; max?: string; fromYear?: number; toYear?: number; placeholder?: string; locale?: string; onChange?: (isoDate: string) => void; class?: string; }, ctx: Ctx, ) export function* pickDate( opts: { title?: string; description?: string; initial?: string; min?: string; max?: string; fromYear?: number; toYear?: number; } = {}, ): Generator ``` ## calendar-heatmap Activity and contribution density heatmap grid using OKLCH primary intensity stops. Install with `vp dlx @fierst/ui add calendar-heatmap`. Direct registry dependencies: theme. Direct npm dependencies: none. Exports from `./ui/calendar-heatmap`: `CalendarHeatmap`. Minimal TSX usage ```tsx import { CalendarHeatmap } from './ui/calendar-heatmap'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/calendar-heatmap.tsx) · [overview.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/overview.tsx#L289) API contracts ```ts export function CalendarHeatmap({ values, label = 'Activity heatmap', class: extraClass, }: { /** Array of { date, count } entries (typically 7 * weeks). */ values: readonly { date: string; count: number }[]; label?: string; class?: string; }) ``` ## card Crisp opaque cards (default, elevated, muted) with 1px hairline borders, shadow-xs, and header/content/footer slots. Install with `vp dlx @fierst/ui add card`. Direct registry dependencies: theme. Direct npm dependencies: none. Exports from `./ui/card`: `CardVariant`, `Card`. Minimal TSX usage ```tsx import { Card } from './ui/card'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/card.tsx) · [ai.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/ai.tsx#L67) · [directory.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/directory.tsx#L192) · [forms.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/forms.tsx#L85) · [ops.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/ops.tsx#L212) · [overlays.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/overlays.tsx#L50) · [overview.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/overview.tsx#L160) API contracts ```ts export type CardVariant = 'default' | 'elevated' | 'muted'; export function Card({ variant = 'default', title, description, action, footer, class: extraClass, children, ...rest }: { variant?: CardVariant; title?: string; description?: string; action?: View; footer?: View; class?: string; children?: View; [key: string]: any; }) ``` ## carousel Zero-dependency CSS Scroll-Snap carousel with touch swiping, dot indicators, and Prev/Next controls. Install with `vp dlx @fierst/ui add carousel`. Direct registry dependencies: theme, icon. Direct npm dependencies: @lucide/icons. Exports from `./ui/carousel`: `Carousel`. Minimal TSX usage ```tsx import { Carousel } from './ui/carousel'; ( ) ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/carousel.tsx) · [overview.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/overview.tsx#L310) API contracts ```ts export function* Carousel( props: { slides: readonly { id: string; content: View }[]; label?: string; class?: string; }, ctx: Ctx, ) ``` ## chat-message Clean user, assistant, and system chat bubbles with avatar, timestamp, and action slots. Install with `vp dlx @fierst/ui add chat-message`. Direct registry dependencies: theme, icon. Direct npm dependencies: @lucide/icons. Exports from `./ui/chat-message`: `ChatMessage`, `ChatList`. Minimal TSX usage ```tsx import { ChatMessage } from './ui/chat-message'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/chat-message.tsx) · [ai.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/ai.tsx#L88) API contracts ```ts export function ChatMessage({ role = 'assistant', author, timestamp, actions, class: extraClass, children, }: { role?: 'user' | 'assistant' | 'system'; author?: string; timestamp?: string; actions?: View; class?: string; children?: View; }) export function ChatList(props: { class?: string; children?: View }) ``` ## checkbox Accessible checkboxes (with indeterminate state), checkbox groups, and radio groups supporting inline and card layouts. Install with `vp dlx @fierst/ui add checkbox`. Direct registry dependencies: theme, icon. Direct npm dependencies: @lucide/icons. Exports from `./ui/checkbox`: `Checkbox`, `ChoiceOption`, `CheckboxGroup`, `RadioGroup`. Minimal TSX usage ```tsx import { Checkbox } from './ui/checkbox'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/checkbox.tsx) · [forms.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/forms.tsx#L174) API contracts ```ts export function* Checkbox( props: { checked?: boolean; defaultChecked?: boolean; indeterminate?: boolean; label?: string; description?: string; disabled?: boolean; card?: boolean; name?: string; value?: string; onChange?: (checked: boolean) => void; class?: string; }, ctx: Ctx, ) export interface ChoiceOption { value: string; label: string; description?: string; disabled?: boolean; } export function* CheckboxGroup( props: { legend?: string; options: readonly ChoiceOption[]; value?: readonly string[]; defaultValue?: readonly string[]; card?: boolean; orientation?: 'vertical' | 'horizontal'; onChange?: (values: string[]) => void; class?: string; }, ctx: Ctx, ) export function* RadioGroup( props: { legend?: string; name?: string; options: readonly ChoiceOption[]; value?: string; defaultValue?: string; card?: boolean; orientation?: 'vertical' | 'horizontal'; onChange?: (value: string) => void; class?: string; }, ctx: Ctx, ) ``` ## citation-badge Inline superscript [1] citation chip and footer source link cards. Install with `vp dlx @fierst/ui add citation-badge`. Direct registry dependencies: theme, icon. Direct npm dependencies: @lucide/icons. Exports from `./ui/citation-badge`: `CitationBadge`, `SourceList`. Minimal TSX usage ```tsx import { CitationBadge } from './ui/citation-badge'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/citation-badge.tsx) · [ai.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/ai.tsx#L98) API contracts ```ts export function CitationBadge({ index, href, title, }: { index: number; href?: string; title?: string; }) export function SourceList({ sources, class: extraClass, }: { sources: readonly { title: string; href: string }[]; class?: string; }) ``` ## collapsible Accessible single disclosure section with preview slot and Lucide toggle control. Install with `vp dlx @fierst/ui add collapsible`. Direct registry dependencies: theme, icon. Direct npm dependencies: @lucide/icons. Exports from `./ui/collapsible`: `Collapsible`. Minimal TSX usage ```tsx import { Collapsible } from './ui/collapsible'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/collapsible.tsx) · [ai.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/ai.tsx#L186) API contracts ```ts export function* Collapsible( props: { title?: string; open?: boolean; defaultOpen?: boolean; preview?: View; onOpenChange?: (open: boolean) => void; class?: string; children?: View; }, ctx: Ctx, ) ``` ## color-picker Swatch palette + native color picker + hex text input inside a viewport-clamped Popover. Install with `vp dlx @fierst/ui add color-picker`. Direct registry dependencies: theme. Direct npm dependencies: none. Exports from `./ui/color-picker`: `ColorPicker`. Minimal TSX usage ```tsx import { ColorPicker } from './ui/color-picker'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/color-picker.tsx) · [forms.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/forms.tsx#L293) API contracts ```ts export function* ColorPicker( props: { label?: string; value?: string; defaultValue?: string; swatches?: readonly string[]; onChange?: (hex: string) => void; class?: string; }, ctx: Ctx, ) ``` ## combobox Autocomplete text input with filterable listbox, keyboard nav, and optional creatable values. Install with `vp dlx @fierst/ui add combobox`. Direct registry dependencies: theme, icon. Direct npm dependencies: @lucide/icons. Exports from `./ui/combobox`: `Combobox`. Minimal TSX usage ```tsx import { Combobox } from './ui/combobox'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/combobox.tsx) · [forms.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/forms.tsx#L139) API contracts ```ts export function* Combobox( props: { label?: string; options: readonly string[]; value?: string; defaultValue?: string; placeholder?: string; creatable?: boolean; onChange?: (value: string) => void; class?: string; }, ctx: Ctx, ) ``` ## command Opaque ⌘K command palette with grouped search, auto-focus, keyboard nav, ctx.signal cleanup, and yield* pickCommand(). Install with `vp dlx @fierst/ui add command`. Direct registry dependencies: theme, icon. Direct npm dependencies: @lucide/icons. Exports from `./ui/command`: `CommandItem`, `CommandPalette`, `pickCommand`. Minimal TSX usage ```tsx import { CommandPalette } from './ui/command'; ( location.assign('/') }]} /> ) ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/command.tsx) · [showcase.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase.tsx#L633) API contracts ```ts export interface CommandItem { id: string; label: string; hint?: string; group?: string; keywords?: readonly string[]; shortcut?: string; onSelect?: () => void; } export function* CommandPalette( props: { items: readonly CommandItem[]; open?: boolean; onOpenChange?: (open: boolean) => void; onSelect?: (item: CommandItem) => void; placeholder?: string; shortcut?: boolean; class?: string; }, ctx: Ctx, ) export function* pickCommand( items: readonly CommandItem[], opts: { placeholder?: string } = {}, ): Generator ``` ## command-bar Interactive dashboard and table filter toolbar with search, toggleable filter chips, and reset. Install with `vp dlx @fierst/ui add command-bar`. Direct registry dependencies: theme, icon, search-input. Direct npm dependencies: @lucide/icons. Exports from `./ui/command-bar`: `FilterBar`. Minimal TSX usage ```tsx import { FilterBar } from './ui/command-bar'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/command-bar.tsx) · [ops.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/ops.tsx#L168) API contracts ```ts export function FilterBar({ query, onQueryChange, searchPlaceholder = 'Filter items…', filters = [], activeFilters = [], onToggleFilter, onClearAll, right, class: extraClass, }: { query?: string; onQueryChange?: (q: string) => void; searchPlaceholder?: string; filters?: readonly { id: string; label: string }[]; activeFilters?: readonly string[]; onToggleFilter?: (id: string) => void; onClearAll?: () => void; right?: View; class?: string; }) ``` ## container Responsive page Container (sm/md/lg/xl/full) plus vertical Stack and wrapping Cluster layout primitives. Install with `vp dlx @fierst/ui add container`. Direct registry dependencies: theme. Direct npm dependencies: none. Exports from `./ui/container`: `Container`, `Stack`, `Cluster`. Minimal TSX usage ```tsx import { Container } from './ui/container'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/container.tsx) · [overlays.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/overlays.tsx#L42) API contracts ```ts export function Container({ size = 'xl', class: extraClass, children, }: { size?: 'sm' | 'md' | 'lg' | 'xl' | 'full'; class?: string; children?: View; }) export function Stack({ gap = '0.85rem', align, class: extraClass, children, }: { gap?: string; align?: 'stretch' | 'flex-start' | 'center' | 'flex-end'; class?: string; children?: View; }) export function Cluster({ gap = '0.5rem', justify, align = 'center', class: extraClass, children, }: { gap?: string; justify?: 'flex-start' | 'center' | 'flex-end' | 'space-between'; align?: 'flex-start' | 'center' | 'flex-end' | 'baseline'; class?: string; children?: View; }) ``` ## context-menu Right-click viewport-clamped floating menu with shortcuts, separators, destructive items, and ctx.signal cleanup. Install with `vp dlx @fierst/ui add context-menu`. Direct registry dependencies: theme. Direct npm dependencies: none. Exports from `./ui/context-menu`: `ContextMenuItem`, `ContextMenu`. Minimal TSX usage ```tsx import { ContextMenu } from './ui/context-menu'; ( window.print() }]} /> ) ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/context-menu.tsx) · [ops.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/ops.tsx#L362) API contracts ```ts export interface ContextMenuItem { id: string; label: string; shortcut?: string; danger?: boolean; disabled?: boolean; separatorBefore?: boolean; onSelect: () => void; } export function* ContextMenu( props: { items: readonly ContextMenuItem[]; class?: string; children?: View; }, ctx: Ctx, ) ``` ## copy-button Clipboard copy button with animated Check feedback and clean CodeBlock with filename header. Install with `vp dlx @fierst/ui add copy-button`. Direct registry dependencies: theme, icon. Direct npm dependencies: @lucide/icons. Exports from `./ui/copy-button`: `CopyButton`, `CodeBlock`. Minimal TSX usage ```tsx import { CopyButton } from './ui/copy-button'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/copy-button.tsx) · [directory.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/directory.tsx#L205) · [ops.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/ops.tsx#L398) API contracts ```ts export function* CopyButton( props: { text: string; label?: string; copiedLabel?: string; resetMs?: number; onCopy?: () => void; onError?: (error: unknown) => void; class?: string; }, ctx: Ctx, ) export function CodeBlock({ code, filename, class: extraClass, }: { code: string; filename?: string; class?: string; }) ``` ## currency-input Tabular-numeral monetary input with currency symbol, ISO badge, and blur precision formatting. Install with `vp dlx @fierst/ui add currency-input`. Direct registry dependencies: theme. Direct npm dependencies: none. Exports from `./ui/currency-input`: `CurrencyInput`. Minimal TSX usage ```tsx import { CurrencyInput } from './ui/currency-input'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/currency-input.tsx) · [forms.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/forms.tsx#L338) API contracts ```ts export function* CurrencyInput( props: { label?: string; currency?: 'USD' | 'EUR' | 'GBP' | 'JPY' | 'CAD'; value?: number; defaultValue?: number; placeholder?: string; onChange?: (amount: number) => void; class?: string; }, ctx: Ctx, ) ``` ## data-table Mobile-first sortable, searchable, O(n log n) LIS-keyed table that stacks into labeled cards on small screens. Install with `vp dlx @fierst/ui add data-table`. Direct registry dependencies: theme, input, icon. Direct npm dependencies: @lucide/icons. Exports from `./ui/data-table`: `ColumnDef`, `DataTable`. Minimal TSX usage ```tsx import { DataTable } from './ui/data-table'; ( row.id} /> ) ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/data-table.tsx) · [ops.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/ops.tsx#L266) API contracts ```ts export interface ColumnDef { key: string; header: string; sortable?: boolean; render?: (row: T) => View; } export function* DataTable>( props: { rows: readonly T[]; columns: readonly ColumnDef[]; rowKey: (row: T) => string | number; searchable?: boolean; searchPlaceholder?: string; emptyText?: string; class?: string; }, ctx: Ctx, ) ``` ## date-range-picker Start/End date range selector with quick range presets (7/30/90 days) and automatic range normalization. Install with `vp dlx @fierst/ui add date-range-picker`. Direct registry dependencies: theme, icon, calendar. Direct npm dependencies: @lucide/icons. Exports from `./ui/date-range-picker`: `DateRange`, `DateRangePicker`. Minimal TSX usage ```tsx import { DateRangePicker } from './ui/date-range-picker'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/date-range-picker.tsx) · [forms.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/forms.tsx#L283) API contracts ```ts export interface DateRange { start: string; end: string; } export function* DateRangePicker( props: { label?: string; value?: DateRange; defaultValue?: DateRange; onChange?: (range: DateRange) => void; class?: string; }, ctx: Ctx, ) ``` ## description-list Structured semantic
key-value detail list with responsive stacked mobile layout and optional striping. Install with `vp dlx @fierst/ui add description-list`. Direct registry dependencies: theme. Direct npm dependencies: none. Exports from `./ui/description-list`: `DescriptionItem`, `DescriptionList`. Minimal TSX usage ```tsx import { DescriptionList } from './ui/description-list'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/description-list.tsx) · [ops.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/ops.tsx#L403) API contracts ```ts export interface DescriptionItem { id?: string; term: string; detail: View; } export function DescriptionList({ items, striped = false, class: extraClass, }: { items: readonly DescriptionItem[]; striped?: boolean; class?: string; }) ``` ## dialog Opaque elevated native with Safari-safe scrollable body, backdrop light-dismiss, and Aster's yield* confirmDialog() flow. Install with `vp dlx @fierst/ui add dialog`. Direct registry dependencies: theme, button, icon. Direct npm dependencies: @lucide/icons. Exports from `./ui/dialog`: `Dialog`, `ConfirmDialogOptions`, `confirmDialog`. Minimal TSX usage ```tsx import { Dialog } from './ui/dialog'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/dialog.tsx) · [overlays.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/overlays.tsx#L327) API contracts ```ts export function Dialog({ id, open, title, description, footer, showClose = true, onClose, class: extraClass, children, }: { id?: string; open?: any; title?: string; description?: string; footer?: View; showClose?: boolean; onClose?: () => void; class?: string; children?: View; }) export interface ConfirmDialogOptions { title: string; description?: string; confirmLabel?: string; cancelLabel?: string; danger?: boolean; } export function* confirmDialog(opts: ConfirmDialogOptions): Generator ``` ## diff-viewer Unified code and SQL diff viewer with line numbers and semantic add/delete highlights. Install with `vp dlx @fierst/ui add diff-viewer`. Direct registry dependencies: theme. Direct npm dependencies: none. Exports from `./ui/diff-viewer`: `DiffLine`, `DiffViewer`. Minimal TSX usage ```tsx import { DiffViewer } from './ui/diff-viewer'; ( ) ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/diff-viewer.tsx) · [ai.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/ai.tsx#L185) API contracts ```ts export interface DiffLine { kind: 'ctx' | 'add' | 'del'; text: string; lineNo?: number; } export function DiffViewer({ filename = 'migration.sql', lines, class: extraClass, }: { filename?: string; lines: readonly DiffLine[]; class?: string; }) ``` ## donut-chart Zero-dependency SVG donut chart with center KPI total and percentage legend. Install with `vp dlx @fierst/ui add donut-chart`. Direct registry dependencies: theme. Direct npm dependencies: none. Exports from `./ui/donut-chart`: `DonutSlice`, `DonutChart`. Minimal TSX usage ```tsx import { DonutChart } from './ui/donut-chart'; ( ) ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/donut-chart.tsx) · [overview.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/overview.tsx#L195) API contracts ```ts export interface DonutSlice { label: string; value: number; color?: string; } export function DonutChart({ data, size = 136, strokeWidth = 18, centerLabel = 'Total', class: extraClass, }: { data: readonly DonutSlice[]; size?: number; strokeWidth?: number; centerLabel?: string; class?: string; }) ``` ## drawer Mobile-first bottom action drawer built on Sheet plus Aster-native yield* promptDrawer() flow. Install with `vp dlx @fierst/ui add drawer`. Direct registry dependencies: theme, sheet, button. Direct npm dependencies: none. Exports from `./ui/drawer`: `Drawer`, `DrawerAction`, `promptDrawer`. Minimal TSX usage ```tsx import { Drawer } from './ui/drawer'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/drawer.tsx) · [ops.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/ops.tsx#L474) API contracts ```ts export function Drawer({ id, open, title, description, footer, onClose, class: extraClass, children, }: { id?: string; open?: any; title?: string; description?: string; footer?: View; onClose?: () => void; class?: string; children?: View; }) export interface DrawerAction { id: string; label: string; danger?: boolean; } export function* promptDrawer(opts: { title: string; description?: string; actions: readonly DrawerAction[]; cancelLabel?: string; }): Generator ``` ## empty-state Dashed-border empty state placeholder with centered Lucide icon, copy, and call-to-action slot. Install with `vp dlx @fierst/ui add empty-state`. Direct registry dependencies: theme, icon. Direct npm dependencies: @lucide/icons. Exports from `./ui/empty-state`: `EmptyState`. Minimal TSX usage ```tsx import { EmptyState } from './ui/empty-state'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/empty-state.tsx) · [ops.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/ops.tsx#L245) API contracts ```ts export function EmptyState({ title, description, icon = Inbox, action, class: extraClass, }: { title: string; description?: string; icon?: LucideIconInput; action?: View; class?: string; }) ``` ## file-upload Drag-and-drop & click file upload dropzone with max-size validation and removable file list. Install with `vp dlx @fierst/ui add file-upload`. Direct registry dependencies: theme, icon. Direct npm dependencies: @lucide/icons. Exports from `./ui/file-upload`: `FileUpload`. Minimal TSX usage ```tsx import { FileUpload } from './ui/file-upload'; ``` [Implementation](https://github.com/fierstdev/ui/blob/v1.0.2/src/ui/file-upload.tsx) · [forms.tsx example](https://github.com/fierstdev/ui/blob/v1.0.2/src/showcase/forms.tsx#L402) API contracts ```ts export function* FileUpload( props: { label?: string; accept?: string; multiple?: boolean; maxSizeBytes?: number; hint?: string; onChange?: (files: File[]) => void; class?: string; }, ctx: Ctx, ) ``` ## footer Multi-column SaaS and documentation footer with brand block, link columns, and legal bar. Install with `vp dlx @fierst/ui add footer`. Direct registry dependencies: theme. Direct npm dependencies: none. Exports from `./ui/footer`: `FooterColumn`, `Footer`. Minimal TSX usage ```tsx import { Footer } from './ui/footer';