# About: mission and values > A mission statement beside a concise list of company values. - Kind: block · Category: About · Interactivity: none - Install: `npx shadcn@latest add @haze/about-values-list` - File: `src/components/haze/blocks/about-values-list.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/about-values-list ## Use when - An about page needs a short statement of purpose and principles - Each value deserves a sentence of explanation ## Avoid when - Explaining steps in a process rather than beliefs; use process-numbered-steps ## Alternatives - [process-numbered-steps](https://hazeui.com/blocks/process-numbered-steps.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "about-values-list" | no | Unique ID prefix for the section. | | eyebrow | `string` | "What we believe" | no | Label above the mission. | | title | `string` | demo heading | no | Mission heading. | | description | `string` | demo copy | no | Supporting mission statement. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Heading level; value headings follow one level below. | | values | `{ title: string; description: string }[]` | 3 demo values | no | Values and their explanations. | | class | `string` | | no | Additional section classes. | ## Accessibility - Values are a semantic list with headings beneath the mission heading. - The small visual numbers are decorative because the values have no required order. ## Agent prompts ### Install and use Install the Haze UI block "About: mission and values" with `npx shadcn@latest add @haze/about-values-list`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AboutValuesList from "@/components/haze/blocks/about-values-list.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/about-values-list.md ### Customize with real content Adapt the Haze about-values-list block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, description, headingLevel, values, class. Keep the layout, the heading level rules and these accessibility details: Values are a semantic list with headings beneath the mission heading. The small visual numbers are decorative because the values have no required order. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using about-values-list, check it fits: use it when an about page needs a short statement of purpose and principles; each value deserves a sentence of explanation. Avoid it when explaining steps in a process rather than beliefs; use process-numbered-steps. Alternatives: @haze/process-numbered-steps. ## Example requests that should lead here - Write an about section with a mission statement and three company values ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; eyebrow?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; values?: { title: string; description: string }[]; class?: string; } const { id = "about-values-list", eyebrow = "What we believe", title = "Good tools make space for good work", description = "We believe the best products help people focus on the work in front of them and stay connected to the people around them.", headingLevel = 2, values = [ { title: "Make the useful thing clear", description: "Choose clarity over novelty and make the next step easy to understand." }, { title: "Respect people's attention", description: "Share the right context without turning every update into an interruption." }, { title: "Keep getting better", description: "Listen closely, learn in the open and improve the details one at a time." }, ], class: className, } = Astro.props; const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel]; const ValueHeading = ({ 1: "h2", 2: "h3", 3: "h4" } as const)[headingLevel]; ---

{eyebrow}

{title}

{description}

``` --- # Agent approvals > Human-in-the-loop approval queue for pending agent tool calls with priority badges, JSON arguments and Deny/Always allow/Approve controls. - Kind: block · Category: Agents · Interactivity: script - Install: `npx shadcn@latest add @haze/agent-approvals` - File: `src/components/haze/blocks/agent-approvals.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/agent-approvals ## Use when - Reviewing high-impact agent tool calls (refunds, merges, deploys) before execution - Offering Deny, Always allow and one-time Approve actions in a structured queue ## Avoid when - Showing a single inline code diff inside one coding run; use agent-run ## Alternatives - [agent-run](https://hazeui.com/blocks/agent-run.md) - [alert-dialog](https://hazeui.com/ui/alert-dialog.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-agent-approvals" | no | Unique prefix for section heading IDs. | | heading | `string` | "Pending tool approvals" | no | Queue heading. | | queue | `ApprovalItem[]` | 2 pending tool calls | no | Queued tool requests with agent, priority, rationale and JSON args. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Tool arguments render inside a horizontally scrollable pre block so long payloads never break mobile layouts. - Reviewing an item updates the pending counter, reveals an empty state when clear and announces the decision via role="status". - Key Tab: Move across Deny, Always allow and Approve buttons for each pending request - Key Enter / Space: Deny, always allow or approve the focused tool call ## Agent prompts ### Install and use Install the Haze UI block "Agent approvals" with `npx shadcn@latest add @haze/agent-approvals`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AgentApprovals from "@/components/haze/blocks/agent-approvals.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/agent-approvals.md ### Customize with real content Adapt the Haze agent-approvals block for our product. Replace the demo values of these props with our real content: id, heading, queue, class. Keep the layout, the heading level rules and these accessibility details: Tool arguments render inside a horizontally scrollable pre block so long payloads never break mobile layouts. Reviewing an item updates the pending counter, reveals an empty state when clear and announces the decision via role="status". Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using agent-approvals, check it fits: use it when reviewing high-impact agent tool calls (refunds, merges, deploys) before execution; offering deny, always allow and one-time approve actions in a structured queue. Avoid it when showing a single inline code diff inside one coding run; use agent-run. Alternatives: @haze/agent-run, @haze/alert-dialog. ## Example requests that should lead here - Build a human-in-the-loop agent approvals queue with tool arguments and Deny, Always allow, and Approve buttons ## Source ```astro --- import { Check, ShieldCheck, ShieldQuestion, Terminal, X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface ApprovalItem { id: string; agent: string; priority: "High" | "Standard"; tool: string; rationale: string; args: string; } interface Props { id?: string; heading?: string; queue?: ApprovalItem[]; class?: string; } const { id = "haze-agent-approvals", heading = "Pending tool approvals", queue = [ { id: "ap1", agent: "Release bot", priority: "High", tool: "stripe.refunds.create", rationale: "Issue duplicate-charge refund of $149.00 requested in ticket 8812.", args: '{ "charge": "ch_3Q9aK1", "amount": 14900, "reason": "duplicate" }', }, { id: "ap2", agent: "Repo maintainer", priority: "Standard", tool: "github.merge_pull_request", rationale: "All 6 CI checks passed on PR 492 (token contrast audit).", args: '{ "repo": "haze/ui", "pull_number": 492, "merge_method": "squash" }', }, ], class: className, } = Astro.props; ---
{queue.length} pending

``` --- # Agent builder > Agent configuration studio with inline-editable title, model selector, instructions, tool toggles, Test mode chat and Publish state. - Kind: block · Category: Agents · Interactivity: script - Install: `npx shadcn@latest add @haze/agent-builder` - File: `src/components/haze/blocks/agent-builder.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/agent-builder ## Use when - Letting users configure, test and publish custom workspace agents in one card - Tracking unsaved draft edits alongside a Configure/Test sandbox switcher ## Avoid when - Editing a single raw prompt template without tools or knowledge files; use prompt-studio ## Alternatives - [prompt-studio](https://hazeui.com/blocks/prompt-studio.md) - [ai-setup-wizard](https://hazeui.com/blocks/ai-setup-wizard.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-agent-builder" | no | Unique prefix for form control IDs. | | agentName | `string` | "Support Triage Specialist" | no | Editable agent title. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Configure and Test panes switch with labelled role="tab" buttons, and every form input has an explicit label. - Unsaved state, test messages and Publish confirmation are announced via a polite role="status" footer. - Key Tab: Move across agent name, Configure/Test tabs, Publish, model/instructions and tool toggles - Key Enter / Space: Switch between Configure and Test, toggle tools, send a test message or publish ## Agent prompts ### Install and use Install the Haze UI block "Agent builder" with `npx shadcn@latest add @haze/agent-builder`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AgentBuilder from "@/components/haze/blocks/agent-builder.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/agent-builder.md ### Customize with real content Adapt the Haze agent-builder block for our product. Replace the demo values of these props with our real content: id, agentName, class. Keep the layout, the heading level rules and these accessibility details: Configure and Test panes switch with labelled role="tab" buttons, and every form input has an explicit label. Unsaved state, test messages and Publish confirmation are announced via a polite role="status" footer. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using agent-builder, check it fits: use it when letting users configure, test and publish custom workspace agents in one card; tracking unsaved draft edits alongside a configure/test sandbox switcher. Avoid it when editing a single raw prompt template without tools or knowledge files; use prompt-studio. Alternatives: @haze/prompt-studio, @haze/ai-setup-wizard. ## Example requests that should lead here - Add an agent builder block with inline-editable name, instructions, tool toggles, Configure/Test switcher and Publish button ## Source ```astro --- import { ArrowUp, Bot, Check, FileText, Rocket, Wrench } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; agentName?: string; class?: string; } const { id = "haze-agent-builder", agentName = "Support Triage Specialist", class: className, } = Astro.props; const tools = [ { id: "linear", label: "Linear · Create & link issues", enabled: true }, { id: "stripe", label: "Stripe · Read invoices & charges", enabled: true }, { id: "slack", label: "Slack · Post escalations", enabled: false }, ]; ---

All changes saved

Agent configuration studio

{ tools.map((t) => ( )) }

support-handbook.pdf

Draft ready

``` --- # Agent gallery > AI agent template marketplace with team filter chips, search by agent or app, ratings, install counts and one-click install. - Kind: block · Category: Agents · Interactivity: script - Install: `npx shadcn@latest add @haze/agent-gallery` - File: `src/components/haze/blocks/agent-gallery.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/agent-gallery ## Use when - Offering a searchable catalog of pre-built workspace agents grouped by team - Showing required app integrations and ratings before installing an agent template ## Avoid when - Configuring a custom agent from scratch with system instructions; use agent-builder ## Alternatives - [agent-builder](https://hazeui.com/blocks/agent-builder.md) - [gallery-project-grid](https://hazeui.com/blocks/gallery-project-grid.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-agent-gallery" | no | Unique prefix for search label and heading IDs. | | heading | `string` | "Agent template gallery" | no | Marketplace heading. | | templates | `AgentTemplate[]` | 5 team templates | no | Agent templates with team, rating, installs, apps and summary. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Team filter buttons expose aria-pressed and work alongside the labelled search field. - Installing a template disables the button and announces confirmation in a polite role="status" element. - Key Tab: Move across search input, team filter buttons and template Install buttons - Key Enter / Space: Filter templates by team or install a template into the workspace ## Agent prompts ### Install and use Install the Haze UI block "Agent gallery" with `npx shadcn@latest add @haze/agent-gallery`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AgentGallery from "@/components/haze/blocks/agent-gallery.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/agent-gallery.md ### Customize with real content Adapt the Haze agent-gallery block for our product. Replace the demo values of these props with our real content: id, heading, templates, class. Keep the layout, the heading level rules and these accessibility details: Team filter buttons expose aria-pressed and work alongside the labelled search field. Installing a template disables the button and announces confirmation in a polite role="status" element. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using agent-gallery, check it fits: use it when offering a searchable catalog of pre-built workspace agents grouped by team; showing required app integrations and ratings before installing an agent template. Avoid it when configuring a custom agent from scratch with system instructions; use agent-builder. Alternatives: @haze/agent-builder, @haze/gallery-project-grid. ## Example requests that should lead here - Add an AI agent template marketplace with team filters, app search, ratings and inline Install buttons ## Source ```astro --- import { Bot, Check, Download, Search, Star } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface AgentTemplate { id: string; name: string; team: "Engineering" | "Sales" | "Support" | "Marketing" | "Ops"; rating: string; installs: string; apps: string[]; summary: string; } interface Props { id?: string; heading?: string; templates?: AgentTemplate[]; class?: string; } const { id = "haze-agent-gallery", heading = "Agent template gallery", templates = [ { id: "ag1", name: "PR Review Companion", team: "Engineering", rating: "4.9", installs: "12.4k", apps: ["GitHub", "Linear"], summary: "Reviews pull requests for accessibility, token compliance and missing E2E assertions." }, { id: "ag2", name: "Inbound Lead Qualifier", team: "Sales", rating: "4.8", installs: "8.1k", apps: ["HubSpot", "Slack"], summary: "Enriches new signups, computes ICP fit scores and posts high-intent alerts." }, { id: "ag3", name: "Tier-1 Ticket Resolver", team: "Support", rating: "4.9", installs: "15.2k", apps: ["Zendesk", "Notion"], summary: "Answers common billing and onboarding questions with cited docs links." }, { id: "ag4", name: "Changelog Storyteller", team: "Marketing", rating: "4.7", installs: "5.3k", apps: ["GitHub", "Slack"], summary: "Turns merged pull requests into customer-ready release notes every week." }, { id: "ag5", name: "Invoice Anomaly Watcher", team: "Ops", rating: "4.8", installs: "4.6k", apps: ["Stripe", "Gmail"], summary: "Flags unexpected vendor invoice spikes and routes approvals to finance." }, ], class: className, } = Astro.props; const teams = ["All", "Engineering", "Sales", "Support", "Marketing", "Ops"] as const; ---

{heading}

Install pre-built team agents with scoped app permissions.

{ teams.map((team, idx) => ( )) }

``` --- # Agent memory > Assistant memory settings card with reference toggles, search, category filters, inline editing and one-click forget controls. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/agent-memory` - File: `src/components/haze/blocks/agent-memory.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/agent-memory ## Use when - Giving users transparent control over facts an assistant remembers across chats - Building a memory management screen with category filters and inline edit/delete ## Avoid when - Managing general account toggles without searchable memory records; use switch or field ## Alternatives - [switch](https://hazeui.com/ui/switch.md) - [inbox-list](https://hazeui.com/ui/inbox-list.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-agent-memory" | no | Unique prefix for search label and heading IDs. | | title | `string` | "Assistant memory" | no | Card heading. | | items | `MemoryItem[]` | 4 demo memories | no | Saved memory records grouped by category. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Memory preference switches use native checkboxes with visible titles and descriptions. - Edit and Forget buttons include the memory summary in their aria-label and announce updates via role="status". - Key Tab: Move across toggles, search input, category filters, and per-row edit/forget buttons - Key Enter / Space: Toggle settings, filter by category, edit a memory inline or forget it ## Agent prompts ### Install and use Install the Haze UI block "Agent memory" with `npx shadcn@latest add @haze/agent-memory`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AgentMemory from "@/components/haze/blocks/agent-memory.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/agent-memory.md ### Customize with real content Adapt the Haze agent-memory block for our product. Replace the demo values of these props with our real content: id, title, items, class. Keep the layout, the heading level rules and these accessibility details: Memory preference switches use native checkboxes with visible titles and descriptions. Edit and Forget buttons include the memory summary in their aria-label and announce updates via role="status". Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using agent-memory, check it fits: use it when giving users transparent control over facts an assistant remembers across chats; building a memory management screen with category filters and inline edit/delete. Avoid it when managing general account toggles without searchable memory records; use switch or field. Alternatives: @haze/switch, @haze/inbox-list. ## Example requests that should lead here - Create an AI memory management card with saved-memory toggles, search, category pills and edit/forget actions ## Source ```astro --- import { Brain, Check, Pencil, Search, Trash2 } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface MemoryItem { id: string; category: "About you" | "Preferences" | "Projects" | "People"; text: string; saved: string; } interface Props { id?: string; title?: string; items?: MemoryItem[]; class?: string; } const { id = "haze-agent-memory", title = "Assistant memory", items = [ { id: "mem-1", category: "Preferences", text: "Prefers TypeScript strict mode, pnpm workspaces and concise code reviews.", saved: "2 days ago" }, { id: "mem-2", category: "Projects", text: "Building Haze UI, an Astro-first dark component library with zero React runtime.", saved: "5 days ago" }, { id: "mem-3", category: "About you", text: "Based in CET timezone; ships weekly changelogs on Thursdays.", saved: "1 week ago" }, { id: "mem-4", category: "People", text: "Design reviews go to Nina; infrastructure approvals go to Marco.", saved: "2 weeks ago" }, ], class: className, } = Astro.props; const categories = ["All", "About you", "Preferences", "Projects", "People"] as const; ---

{title}

Control what the assistant remembers across sessions.

{items.length} saved
{ categories.map((cat, idx) => ( )) }

``` --- # Agent orchestrator > Multi-agent fan-out view with planner goal, parallel worker lanes showing model and progress, and synthesized verdict card. - Kind: block · Category: Agents · Interactivity: script - Install: `npx shadcn@latest add @haze/agent-orchestrator` - File: `src/components/haze/blocks/agent-orchestrator.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/agent-orchestrator ## Use when - Visualizing a lead planner fanning subtasks out across specialized parallel worker agents - Showing each worker's model, progress and merged output in one consolidated view ## Avoid when - Tracking a single linear coding-agent session; use agent-run ## Alternatives - [agent-run](https://hazeui.com/blocks/agent-run.md) - [workflow-steps](https://hazeui.com/ui/workflow-steps.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-agent-orchestrator" | no | Unique prefix for section heading IDs. | | goal | `string` | Release readiness audit goal | no | Top-level goal planned by the orchestrator. | | workers | `WorkerLane[]` | 3 parallel worker lanes | no | Worker cards with role, model, progress and output. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Each worker lane uses an article with a clear heading and model badge, followed by the merged synthesis card. - Re-running the fan-out announces dispatch and completion via a polite role="status" element. - Key Tab: Focus the Re-run fan-out button - Key Enter / Space: Replay the parallel worker fan-out and merge ## Agent prompts ### Install and use Install the Haze UI block "Agent orchestrator" with `npx shadcn@latest add @haze/agent-orchestrator`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AgentOrchestrator from "@/components/haze/blocks/agent-orchestrator.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/agent-orchestrator.md ### Customize with real content Adapt the Haze agent-orchestrator block for our product. Replace the demo values of these props with our real content: id, goal, workers, class. Keep the layout, the heading level rules and these accessibility details: Each worker lane uses an article with a clear heading and model badge, followed by the merged synthesis card. Re-running the fan-out announces dispatch and completion via a polite role="status" element. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using agent-orchestrator, check it fits: use it when visualizing a lead planner fanning subtasks out across specialized parallel worker agents; showing each worker's model, progress and merged output in one consolidated view. Avoid it when tracking a single linear coding-agent session; use agent-run. Alternatives: @haze/agent-run, @haze/workflow-steps. ## Example requests that should lead here - Build a multi-agent orchestrator block with 3 parallel worker lanes, model badges and a merged summary card ## Source ```astro --- import { CheckCircle2, GitMerge, Layers, Play, Sparkles } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface WorkerLane { id: string; role: string; model: string; progress: number; output: string; } interface Props { id?: string; goal?: string; workers?: WorkerLane[]; class?: string; } const { id = "haze-agent-orchestrator", goal = "Audit v2.8 release readiness across security, performance and docs", workers = [ { id: "w1", role: "Security auditor", model: "Opus 4.5", progress: 100, output: "0 XSS sinks, CSP headers verified across 12 routes." }, { id: "w2", role: "Web perf worker", model: "Sonnet 4.5", progress: 100, output: "Home LCP 0.9s, 0 CLS, client JS bundle 4.2 kB gzip." }, { id: "w3", role: "Docs verifier", model: "Flash 3.8", progress: 100, output: "llms.txt, sitemap.xml and 239 Markdown twins in sync." }, ], class: className, } = Astro.props; ---

Lead planner · 3 parallel workers

{goal}

{ workers.map((w) => (

{w.role}

{w.model}

{w.output}

)) }

All three worker lanes passed with zero blockers. v2.8 is cleared to tag and deploy to production.

``` --- # Agent routines > Scheduled background-agent list showing cadence, next run, source-to-destination flow, run history dots, active toggle and Run now. - Kind: block · Category: Agents · Interactivity: script - Install: `npx shadcn@latest add @haze/agent-routines` - File: `src/components/haze/blocks/agent-routines.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/agent-routines ## Use when - Managing recurring AI automations with human-readable cadences and recent run health - Letting operators pause a routine, inspect its routing or trigger an immediate run ## Avoid when - Running one-off ad-hoc coding tasks; use agent-tasks ## Alternatives - [uptime-tracker](https://hazeui.com/ui/uptime-tracker.md) - [agent-tasks](https://hazeui.com/blocks/agent-tasks.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-agent-routines" | no | Unique prefix for section heading IDs. | | heading | `string` | "Scheduled agent routines" | no | Card heading. | | routines | `Routine[]` | 3 demo routines | no | Scheduled routines with cadence, next run and run history. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Inline settings expand with native details/summary, and active switches use native checkboxes. - Run now and active toggles announce feedback via a polite role="status" line. - Key Tab: Move across Run now buttons, Active checkboxes and Schedule settings disclosures - Key Enter / Space: Trigger a run, toggle active status or expand schedule settings ## Agent prompts ### Install and use Install the Haze UI block "Agent routines" with `npx shadcn@latest add @haze/agent-routines`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AgentRoutines from "@/components/haze/blocks/agent-routines.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/agent-routines.md ### Customize with real content Adapt the Haze agent-routines block for our product. Replace the demo values of these props with our real content: id, heading, routines, class. Keep the layout, the heading level rules and these accessibility details: Inline settings expand with native details/summary, and active switches use native checkboxes. Run now and active toggles announce feedback via a polite role="status" line. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using agent-routines, check it fits: use it when managing recurring ai automations with human-readable cadences and recent run health; letting operators pause a routine, inspect its routing or trigger an immediate run. Avoid it when running one-off ad-hoc coding tasks; use agent-tasks. Alternatives: @haze/uptime-tracker, @haze/agent-tasks. ## Example requests that should lead here - Add a scheduled agent routines card with cadence, next-run badges, run history indicators, active toggle and Run now ## Source ```astro --- import { ArrowRight, CalendarClock, Check, ChevronDown, Play } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Routine { id: string; name: string; cadence: string; nextRun: string; flow: string; active: boolean; history: ("ok" | "warn")[]; } interface Props { id?: string; heading?: string; routines?: Routine[]; class?: string; } const { id = "haze-agent-routines", heading = "Scheduled agent routines", routines = [ { id: "rt1", name: "Morning dependency audit", cadence: "Every weekday at 08:00", nextRun: "In 11h", flow: "GitHub → Slack #eng", active: true, history: ["ok", "ok", "ok", "ok", "ok"] }, { id: "rt2", name: "Weekly churn risk digest", cadence: "Mondays at 09:00", nextRun: "In 3d", flow: "Stripe + Linear → Email", active: true, history: ["ok", "ok", "warn", "ok", "ok"] }, { id: "rt3", name: "Stale PR cleanup reminder", cadence: "Fridays at 16:00", nextRun: "Paused", flow: "GitHub → Linear", active: false, history: ["ok", "warn", "ok", "ok", "ok"] }, ], class: className, } = Astro.props; ---
2 active · 1 paused

``` --- # Agent run > Single coding-agent run card with expandable step log, two-file diff approval gate and collapsible completed PR summary. - Kind: block · Category: Agents · Interactivity: script - Install: `npx shadcn@latest add @haze/agent-run` - File: `src/components/haze/blocks/agent-run.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/agent-run ## Use when - Monitoring a coding agent run that pauses for human approval before modifying files - Collapsing completed execution steps into a single summary bar with a Create PR action ## Avoid when - Managing multiple background agent tasks across repos at once; use agent-tasks ## Alternatives - [check-runs](https://hazeui.com/ui/check-runs.md) - [workflow-steps](https://hazeui.com/ui/workflow-steps.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-agent-run" | no | Unique prefix for section heading IDs. | | taskTitle | `string` | "Fix focus restoration when closing command palette" | no | Task description in the card header. | | branch | `string` | "agent/fix-palette-focus" | no | Git branch created by the agent. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Step logs use a native details/summary disclosure that collapses cleanly once approved. - Approve, Deny and Create PR actions announce outcomes via a polite role="status" message. - Key Tab: Move across the steps disclosure, Deny, Approve and Create PR buttons - Key Enter / Space: Toggle step log visibility, approve/deny the diff or open a pull request ## Agent prompts ### Install and use Install the Haze UI block "Agent run" with `npx shadcn@latest add @haze/agent-run`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AgentRun from "@/components/haze/blocks/agent-run.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/agent-run.md ### Customize with real content Adapt the Haze agent-run block for our product. Replace the demo values of these props with our real content: id, taskTitle, branch, class. Keep the layout, the heading level rules and these accessibility details: Step logs use a native details/summary disclosure that collapses cleanly once approved. Approve, Deny and Create PR actions announce outcomes via a polite role="status" message. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using agent-run, check it fits: use it when monitoring a coding agent run that pauses for human approval before modifying files; collapsing completed execution steps into a single summary bar with a create pr action. Avoid it when managing multiple background agent tasks across repos at once; use agent-tasks. Alternatives: @haze/check-runs, @haze/workflow-steps. ## Example requests that should lead here - Add a coding-agent run block with expandable steps, a 2-file diff approval gate and Create pull request action ## Source ```astro --- import { Bot, Check, CheckCircle2, ChevronDown, FileCode2, GitPullRequest, ShieldAlert, X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; taskTitle?: string; branch?: string; class?: string; } const { id = "haze-agent-run", taskTitle = "Fix focus restoration when closing command palette", branch = "agent/fix-palette-focus", class: className, } = Astro.props; const steps = [ { label: "Read src/site/client.ts and tests/keyboard.spec.ts", tool: "read_file · 2 files" }, { label: "Reproduced focus loss on Escape in headless Chromium", tool: "run_test · 1 failed" }, { label: "Prepared two-file patch awaiting write approval", tool: "edit_file · 2 files (+14 / -4)" }, ]; ---

{taskTitle}

{branch} · Sonnet 4.5

3 agent steps · paused before file write
    { steps.map((s) => (
  1. {s.tool}
  2. )) }

+14 / -4 lines

src/site/client.ts

- palette.close();

+ palette.close(); lastFocus?.focus();

tests/keyboard.spec.ts

+ await expect(trigger).toBeFocused();

``` --- # Agent tasks > Background coding-agent task hub with task launcher, status filters (All, Running, Ready, Merged), cancel and Open PR actions. - Kind: block · Category: Agents · Interactivity: script - Install: `npx shadcn@latest add @haze/agent-tasks` - File: `src/components/haze/blocks/agent-tasks.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/agent-tasks ## Use when - Launching and tracking multiple asynchronous coding-agent runs across branches - Filtering background tasks by lifecycle state with quick Cancel and Open PR controls ## Avoid when - Inspecting a single agent's step-by-step diff approval; use agent-run ## Alternatives - [agent-run](https://hazeui.com/blocks/agent-run.md) - [kanban-board](https://hazeui.com/ui/kanban-board.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-agent-tasks" | no | Unique prefix for form and heading IDs. | | heading | `string` | "Background agent tasks" | no | Hub heading. | | tasks | `AgentTask[]` | 3 demo tasks | no | Background tasks with repo, branch, status and progress. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Status filter tabs expose aria-selected and dynamically filter the task list without page reloads. - Starting, cancelling or opening a PR announces the result in a polite role="status" element. - Key Tab: Move across status tabs, task launcher inputs, Cancel and Open PR buttons - Key Enter / Space: Filter tasks, launch a new background task, cancel a run or open a PR ## Agent prompts ### Install and use Install the Haze UI block "Agent tasks" with `npx shadcn@latest add @haze/agent-tasks`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AgentTasks from "@/components/haze/blocks/agent-tasks.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/agent-tasks.md ### Customize with real content Adapt the Haze agent-tasks block for our product. Replace the demo values of these props with our real content: id, heading, tasks, class. Keep the layout, the heading level rules and these accessibility details: Status filter tabs expose aria-selected and dynamically filter the task list without page reloads. Starting, cancelling or opening a PR announces the result in a polite role="status" element. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using agent-tasks, check it fits: use it when launching and tracking multiple asynchronous coding-agent runs across branches; filtering background tasks by lifecycle state with quick cancel and open pr controls. Avoid it when inspecting a single agent's step-by-step diff approval; use agent-run. Alternatives: @haze/agent-run, @haze/kanban-board. ## Example requests that should lead here - Create a background coding-agent task hub with repo/branch launcher, status filter tabs and Open PR buttons ## Source ```astro --- import { Bot, GitBranch, GitPullRequest, Play, XCircle } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface AgentTask { id: string; title: string; repo: string; branch: string; status: "Running" | "Ready" | "Merged"; progress: number; summary: string; } interface Props { id?: string; heading?: string; tasks?: AgentTask[]; class?: string; } const { id = "haze-agent-tasks", heading = "Background agent tasks", tasks = [ { id: "tk1", title: "Add keyboard navigation tests for command palette", repo: "haze/ui", branch: "agent/palette-e2e", status: "Running", progress: 68, summary: "Running Playwright suite (14/21 specs)" }, { id: "tk2", title: "Migrate dark contrast tokens to OKLCH scale", repo: "haze/ui", branch: "agent/oklch-tokens", status: "Ready", progress: 100, summary: "4 files changed · 148/148 contrast pairs pass" }, { id: "tk3", title: "Generate sitemap.xml and llms.txt on build", repo: "haze/docs", branch: "agent/seo-gen", status: "Merged", progress: 100, summary: "Merged in PR 484 · 261 URLs indexed" }, ], class: className, } = Astro.props; const filters = ["All", "Running", "Ready", "Merged"] as const; ---
{ filters.map((f, idx) => ( )) }

``` --- # AI agent lanes > Parallel multi-agent timeline with play controls, lane filters, interactive time scrubber, overlapping span bars and live step inspector. - Kind: block · Category: Agents · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-agent-lanes` - File: `src/components/haze/blocks/ai-agent-lanes.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-agent-lanes ## Use when - Visualizing concurrent sub-agent execution across overlapping search, read, thinking and write spans - Letting operators scrub a multi-agent run to inspect exact tool calls and trace outputs at any timestamp ## Avoid when - Displaying a single linear agent execution trace without parallel workers; use agent-run instead - Showing only raw tool payloads without time alignment; use ai-tool-calls ## Alternatives - [agent-orchestrator](https://hazeui.com/blocks/agent-orchestrator.md) - [agent-run](https://hazeui.com/blocks/agent-run.md) - [ai-tool-calls](https://hazeui.com/blocks/ai-tool-calls.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-agent-lanes" | no | Unique prefix for headings and scrubber labels. | | title | `string` | "Plan a 3-day offsite in Zurich for 14 engineers" | no | Task title displayed in the header. | | duration | `number` | 12 | no | Total run duration in seconds for the timeline scrubber. | | lanes | `AgentLane[]` | 4 demo lanes | no | Parallel agent lanes and their timed tool spans. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - The timeline scrubber is a native range input labeled Run time, and each horizontal span button carries an explicit lane, tool and time range label. - Playback state, lane filter selections and scrubbed step updates announce cleanly through a polite role="status" region. - Key Tab: Move across Play, Reset, lane filter buttons, the Run time scrubber and span bars - Key ArrowLeft / ArrowRight: Scrub the Run time slider in 0.5 second increments while focused ## Agent prompts ### Install and use Install the Haze UI block "AI agent lanes" with `npx shadcn@latest add @haze/ai-agent-lanes`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiAgentLanes from "@/components/haze/blocks/ai-agent-lanes.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-agent-lanes.md ### Customize with real content Adapt the Haze ai-agent-lanes block for our product. Replace the demo values of these props with our real content: id, title, duration, lanes, class. Keep the layout, the heading level rules and these accessibility details: The timeline scrubber is a native range input labeled Run time, and each horizontal span button carries an explicit lane, tool and time range label. Playback state, lane filter selections and scrubbed step updates announce cleanly through a polite role="status" region. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-agent-lanes, check it fits: use it when visualizing concurrent sub-agent execution across overlapping search, read, thinking and write spans; letting operators scrub a multi-agent run to inspect exact tool calls and trace outputs at any timestamp. Avoid it when displaying a single linear agent execution trace without parallel workers; use agent-run instead; showing only raw tool payloads without time alignment; use ai-tool-calls. Alternatives: @haze/agent-orchestrator, @haze/agent-run, @haze/ai-tool-calls. ## Example requests that should lead here - Add a parallel AI agent lanes timeline with play controls, lane filter buttons, time scrubber and live tool call inspector - Build a multi-agent execution Gantt view showing Lead, Flights, Venues and Weather spans across 12 seconds ## Source ```astro --- import { Pause, Play } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; type ToolKind = "Search" | "Read" | "Thinking" | "Write"; interface AgentSpan { id: string; start: number; end: number; tool: ToolKind; command: string; output: string; } interface AgentLane { id: string; name: string; role: string; spans: AgentSpan[]; } interface Props { id?: string; title?: string; duration?: number; lanes?: AgentLane[]; class?: string; } const { id = "haze-ai-agent-lanes", title = "Plan a 3-day offsite in Zurich for 14 engineers", duration = 12, lanes = [ { id: "lead", name: "Lead", role: "Coordinator", spans: [ { id: "lead-1", start: 0, end: 2.5, tool: "Thinking", command: "decompose_offsite_brief(headcount=14, days=3)", output: "Decompose brief into three parallel tracks", }, { id: "lead-2", start: 2.5, end: 4, tool: "Write", command: "dispatch_agents([flights, venues, weather])", output: "Dispatch travel, venue, and weather subagents", }, { id: "lead-3", start: 8.5, end: 12, tool: "Write", command: "compose_itinerary_summary()", output: "Synthesize Lakefront Loft plan and morning ZRH arrivals", }, ], }, { id: "flights", name: "Flights", role: "Travel", spans: [ { id: "flights-1", start: 2.5, end: 5.5, tool: "Search", command: "search_routes(dest=\"ZRH\", hubs=[\"BER\",\"LHR\",\"AMS\"])", output: "Compare 28 nonstop morning departures into Zurich", }, { id: "flights-2", start: 5.5, end: 8.5, tool: "Read", command: "verify_group_holds(seats=14)", output: "Verify refundable group holds landing before 11:15 CET", }, ], }, { id: "venues", name: "Venues", role: "Spaces", spans: [ { id: "venues-1", start: 3, end: 6.5, tool: "Search", command: "query_spaces(city=\"Zurich\", capacity=14)", output: "Query Seefeld and District 1 studios with symmetric fiber", }, { id: "venues-2", start: 6.5, end: 9.5, tool: "Read", command: "inspect_quotes([\"Lakefront Loft\", \"Kraftwerk\"])", output: "Confirm Lakefront Loft availability and breakout rooms", }, ], }, { id: "weather", name: "Weather", role: "Forecast", spans: [ { id: "weather-1", start: 3.5, end: 6, tool: "Search", command: "fetch_forecast(region=\"Lake Zurich\", days=10)", output: "Fetch Lake Zurich hourly rain and temperature outlook", }, { id: "weather-2", start: 6, end: 8, tool: "Read", command: "evaluate_outdoor_risk()", output: "Flag Day 2 afternoon showers and prepare indoor backup", }, ], }, ], class: className, } = Astro.props; const ticks = [0, 2, 4, 6, 8, 10, 12]; const initialTime = 0.5; const initialPct = (initialTime / duration) * 100; const spanFillClass = (tool: ToolKind): string => { switch (tool) { case "Search": return "bg-muted-foreground/15 border-frame"; case "Read": return "bg-muted-foreground/30 border-frame-strong"; case "Thinking": return "bg-muted border-frame"; case "Write": return "bg-foreground/20 border-frame-strong"; } }; ---

{lanes[0]?.name ?? "Lead"} agent · {initialTime.toFixed(1)}s

{title}

{ lanes.map((lane, idx) => ( )) }
{ lanes.map((lane) => (
{lane.spans.map((span) => { const leftPct = (span.start / duration) * 100; const widthPct = ((span.end - span.start) / duration) * 100; return ( ); })}
)) }
{ticks.map((tick) => {tick}s)}
{lanes[0]?.name ?? "Lead"}
Search Read Thinking Write
{lanes[0]?.spans[0]?.tool ?? "Thinking"} {lanes[0]?.spans[0]?.output ?? ""}

``` --- # AI answer > Article-style AI answer with compact source cards, inline citation highlights, version switcher, feedback controls and follow-up bar. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-answer` - File: `src/components/haze/blocks/ai-answer.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-answer ## Use when - Presenting a single grounded answer with inline sentence-level citations - Building a documentation or search answer card with regenerate, share and follow-up actions ## Avoid when - Users need a multi-turn back-and-forth conversation sidebar; use ai-chat instead ## Alternatives - [ai-chat](https://hazeui.com/blocks/ai-chat.md) - [card](https://hazeui.com/ui/card.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-answer" | no | Unique prefix for headings and input labels. | | question | `string` | Astro islands question | no | Question displayed as the article heading. | | citations | `{ id: number; title: string; source: string; excerpt: string }[]` | 3 demo citations | no | Source cards paired with numbered inline citations. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Every citation card and inline citation chip is a native button that highlights its supporting sentence on hover or activation. - Copy, version switches and follow-up submissions announce their result in a polite role="status" element. - Key Tab: Move across source cards, inline citation buttons, toolbar actions and follow-up input - Key Enter / Space: Highlight a cited sentence, copy, rate, switch versions or submit a follow-up ## Agent prompts ### Install and use Install the Haze UI block "AI answer" with `npx shadcn@latest add @haze/ai-answer`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiAnswer from "@/components/haze/blocks/ai-answer.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-answer.md ### Customize with real content Adapt the Haze ai-answer block for our product. Replace the demo values of these props with our real content: id, question, citations, class. Keep the layout, the heading level rules and these accessibility details: Every citation card and inline citation chip is a native button that highlights its supporting sentence on hover or activation. Copy, version switches and follow-up submissions announce their result in a polite role="status" element. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-answer, check it fits: use it when presenting a single grounded answer with inline sentence-level citations; building a documentation or search answer card with regenerate, share and follow-up actions. Avoid it when users need a multi-turn back-and-forth conversation sidebar; use ai-chat instead. Alternatives: @haze/ai-chat, @haze/card. ## Example requests that should lead here - Add an AI answer card with source cards, interactive inline citations that highlight sentences, and a follow-up input ## Source ```astro --- import { ArrowRight, BookOpen, ChevronLeft, ChevronRight, Copy, RotateCw, Share2, Sparkles, ThumbsDown, ThumbsUp } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Citation { id: number; title: string; source: string; excerpt: string; } interface Props { id?: string; question?: string; citations?: Citation[]; class?: string; } const { id = "haze-ai-answer", question = "How does Astro islands hydration affect Core Web Vitals on content-heavy pages?", citations = [ { id: 1, title: "Astro Islands Architecture", source: "docs.astro.build", excerpt: "Static HTML ships with zero client JavaScript by default; only opted-in islands hydrate." }, { id: 2, title: "Web Vitals Field Report", source: "web.dev", excerpt: "Reducing main-thread hydration work directly improves INP and Time to Interactive." }, { id: 3, title: "Client Directives Reference", source: "docs.astro.build", excerpt: "Use client:visible for below-the-fold widgets so hero LCP stays unblocked." }, ], class: className, } = Astro.props; ---
3 sources · 1.4s

{question}

{ citations.map((c) => ( )) }

Astro renders every page to static HTML at build time and strips component JavaScript unless you explicitly attach a hydration directive. Because the browser does not parse or execute a full application bundle up front, main-thread blocking drops sharply and INP stays responsive on mid-tier devices.

For interactive widgets below the fold, pairing native HTML disclosures with deferred hydration keeps hero LCP fast while preserving full interactivity.

1 / 2
``` --- # AI attachment reader > Chat column animating a PDF upload ring into a compact 6-page scan strip with clickable inline page citations and extracted excerpts. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-attachment` - File: `src/components/haze/blocks/ai-attachment.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-attachment ## Use when - Visualizing PDF upload progress followed by page-by-page document indexing inside an AI chat flow - Linking inline page citations directly to extracted document excerpts and an interactive page strip ## Avoid when - Extracting structured key-value fields into an editable form table; use document-extract instead - Citing external web URLs rather than pages of an uploaded file; use ai-citations ## Alternatives - [document-extract](https://hazeui.com/blocks/document-extract.md) - [ai-citations](https://hazeui.com/blocks/ai-citations.md) - [file-upload](https://hazeui.com/ui/file-upload.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-attachment" | no | Unique prefix for section landmark heading ID. | | heading | `string` | "Document attachment exchange" | no | Screen-reader landmark heading for the chat exchange. | | fileName | `string` | "Q3-operations-brief.pdf" | no | Filename displayed on the right-aligned PDF attachment card. | | fileSizeMb | `number` | 4.2 | no | Total file size in megabytes used for the live upload progress readout. | | question | `string` | "What changed this quarter? Keep it short." | no | User prompt bubble paired beneath the attached document. | | pages | `{ page: number; title: string; snippet: string }[]` | 6 demo PDF pages | no | Page metadata and extracted excerpts linked to the page strip and citation pills. | | class | `string` | | no | Extra classes applied to the outer section. | ## Accessibility - Circular upload ring is exposed via role="progressbar" with aria-valuemin, aria-valuemax and live aria-valuenow updates. - Every page pill and inline page citation is a button with aria-pressed state that updates the extracted excerpt and announces changes politely. - Key Tab: Move across the 6 document page pills, inline page citation pills and the Replay button - Key Enter / Space: Highlight a referenced page and show its excerpt, or replay the upload sequence ## Agent prompts ### Install and use Install the Haze UI block "AI attachment reader" with `npx shadcn@latest add @haze/ai-attachment`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiAttachment from "@/components/haze/blocks/ai-attachment.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-attachment.md ### Customize with real content Adapt the Haze ai-attachment block for our product. Replace the demo values of these props with our real content: id, heading, fileName, fileSizeMb, question, pages, class. Keep the layout, the heading level rules and these accessibility details: Circular upload ring is exposed via role="progressbar" with aria-valuemin, aria-valuemax and live aria-valuenow updates. Every page pill and inline page citation is a button with aria-pressed state that updates the extracted excerpt and announces changes politely. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-attachment, check it fits: use it when visualizing pdf upload progress followed by page-by-page document indexing inside an ai chat flow; linking inline page citations directly to extracted document excerpts and an interactive page strip. Avoid it when extracting structured key-value fields into an editable form table; use document-extract instead; citing external web urls rather than pages of an uploaded file; use ai-citations. Alternatives: @haze/document-extract, @haze/ai-citations, @haze/file-upload. ## Example requests that should lead here - Add an AI attachment chat column with a PDF circular upload ring, user prompt bubble, 6-page scan strip and clickable inline p. 2, p. 4 and p. 6 citations ## Source ```astro --- import { Check, RotateCcw } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface DocumentPage { page: number; title: string; snippet: string; } interface Props { id?: string; heading?: string; fileName?: string; fileSizeMb?: number; question?: string; pages?: DocumentPage[]; class?: string; } const { id = "haze-ai-attachment", heading = "Document attachment exchange", fileName = "Q3-operations-brief.pdf", fileSizeMb = 4.2, question = "What changed this quarter? Keep it short.", pages = [ { page: 1, title: "Executive overview", snippet: "Q3 regional throughput rose 18% quarter over quarter while onboarding three logistics accounts.", }, { page: 2, title: "Capacity bottlenecks", snippet: "Peak batch indexing hit 84% of EU worker queues during Tuesday billing runs, adding 9-minute delays.", }, { page: 3, title: "Support desk SLA", snippet: "Median first response dropped to 14 minutes after automated priority routing went live.", }, { page: 4, title: "Cost reduction plan", snippet: "Consolidating idle staging clusters and moving archives to cold storage saves $42k per month.", }, { page: 5, title: "Vendor renewals", snippet: "Warehouse and telemetry contracts renew on November 15 with an optional multi-year discount.", }, { page: 6, title: "Q4 rollout dates", snippet: "Autoscaling EU worker pools ship October 8, followed by archive tier validation on October 22.", }, ], class: className, } = Astro.props; const formattedSize = fileSizeMb.toFixed(1); const initialPage = pages.find((p) => p.page === 2) ?? pages[0]; ---

{heading}

{fileName}

0.0 MB of {formattedSize} MB

{question}

``` --- # AI ghost autocomplete > Email reply composer with live ghost completion, Tab full-accept, ArrowRight word-accept, prefix matching and accessible toolbar buttons. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-autocomplete` - File: `src/components/haze/blocks/ai-autocomplete.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-autocomplete ## Use when - Offering inline AI sentence completions while composing an email, reply or support note - Letting keyboard users accept full or word-level suggestions without leaving the textarea - Pairing ghost completions with visible buttons and kbd hints for touch and pointer users ## Avoid when - Users need to highlight and rewrite existing paragraphs in place; use ai-inline-rewrite instead - You need a dropdown list of matching option items; use autocomplete instead ## Alternatives - [ai-inline-rewrite](https://hazeui.com/blocks/ai-inline-rewrite.md) - [ai-inline-edit](https://hazeui.com/blocks/ai-inline-edit.md) - [autocomplete](https://hazeui.com/ui/autocomplete.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-autocomplete" | no | Unique prefix for textarea label and hint references. | | heading | `string` | "AI ghost autocomplete" | no | Screen-reader section heading for the reply compose card. | | recipient | `string` | "Hana Sato" | no | Recipient name shown in the compose header. | | subject | `string` | "Re: Launch review" | no | Subject line displayed in the compose header. | | initialText | `string` | "Thanks for the update on the " | no | Pre-filled starting draft text before the ghost suggestion. | | suggestions | `string[]` | 3 contextual continuations | no | Ghost completion candidates users can accept or cycle through. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Tab only intercepts focus when an active ghost suggestion is visible, preventing keyboard traps once accepted or dismissed. - Every keyboard shortcut has a matching accessible toolbar button with kbd hints and polite role="status" feedback. - Key Tab: Accept the entire active ghost completion - Key ArrowRight: Accept one word at a time when the caret is at the end of the draft - Key Escape: Dismiss the current ghost completion ## Agent prompts ### Install and use Install the Haze UI block "AI ghost autocomplete" with `npx shadcn@latest add @haze/ai-autocomplete`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiAutocomplete from "@/components/haze/blocks/ai-autocomplete.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-autocomplete.md ### Customize with real content Adapt the Haze ai-autocomplete block for our product. Replace the demo values of these props with our real content: id, heading, recipient, subject, initialText, suggestions, class. Keep the layout, the heading level rules and these accessibility details: Tab only intercepts focus when an active ghost suggestion is visible, preventing keyboard traps once accepted or dismissed. Every keyboard shortcut has a matching accessible toolbar button with kbd hints and polite role="status" feedback. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-autocomplete, check it fits: use it when offering inline ai sentence completions while composing an email, reply or support note; letting keyboard users accept full or word-level suggestions without leaving the textarea; pairing ghost completions with visible buttons and kbd hints for touch and pointer users. Avoid it when users need to highlight and rewrite existing paragraphs in place; use ai-inline-rewrite instead; you need a dropdown list of matching option items; use autocomplete instead. Alternatives: @haze/ai-inline-rewrite, @haze/ai-inline-edit, @haze/autocomplete. ## Example requests that should lead here - Build an email reply frame with inline AI ghost autocomplete supporting Tab full-accept and ArrowRight word-by-word accept - Create an accessible ghost completion textarea with Accept all, Next word and Cycle suggestion toolbar controls ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; heading?: string; recipient?: string; subject?: string; initialText?: string; suggestions?: string[]; class?: string; } const { id = "haze-ai-autocomplete", heading = "AI ghost autocomplete", recipient = "Hana Sato", subject = "Re: Launch review", initialText = "Thanks for the update on the ", suggestions = [ "launch timeline.", "rollout checklist before Thursday's release.", "staging latency numbers we reviewed earlier.", ], class: className, } = Astro.props; const firstName = recipient.split(/\s+/)[0] || "there"; const firstGhost = suggestions[0] ?? ""; ---

{heading}

To {recipient}
Subject {subject}

Hi {firstName},

Press Tab to accept the full ghost suggestion, ArrowRight at the end of the text to accept one word, or Escape to dismiss.

``` --- # AI conversation branches > Branching AI conversation workspace with inline message editing, version steppers, tailored fork replies and a clickable branch tree. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-branches` - File: `src/components/haze/blocks/ai-branches.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-branches ## Use when - Letting users explore alternate directions from an earlier chat turn without losing the original thread - Comparing multiple prompt variations side by side through version steppers and a branch tree sidebar ## Avoid when - You only need a linear multi-turn conversation without prompt forking; use ai-chat instead - You want token-level wording alternatives rather than full conversation forks; use ai-token-alternatives ## Alternatives - [ai-chat](https://hazeui.com/blocks/ai-chat.md) - [ai-token-alternatives](https://hazeui.com/blocks/ai-token-alternatives.md) - [chat-thread](https://hazeui.com/ui/chat-thread.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-branches" | no | Unique prefix for headings and inline edit inputs. | | title | `string` | "Trip planning" | no | Workspace title shown in the card header. | | branches | `ConversationBranch[]` | 3 demo branches | no | Initial conversation forks with parent links and turns. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Version steppers expose explicit Previous version and Next version labels, while the active node in the Branches tree sets aria-current="true". - Branch creation, edit cancellation, and path switches are announced in a polite role="status" live region. - Key Tab: Move across version steppers, Edit message buttons, inline edit forms and branch tree nodes - Key Enter / Space: Step between versions, open inline prompt editing, save a new fork or switch branches ## Agent prompts ### Install and use Install the Haze UI block "AI conversation branches" with `npx shadcn@latest add @haze/ai-branches`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiBranches from "@/components/haze/blocks/ai-branches.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-branches.md ### Customize with real content Adapt the Haze ai-branches block for our product. Replace the demo values of these props with our real content: id, title, branches, class. Keep the layout, the heading level rules and these accessibility details: Version steppers expose explicit Previous version and Next version labels, while the active node in the Branches tree sets aria-current="true". Branch creation, edit cancellation, and path switches are announced in a polite role="status" live region. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-branches, check it fits: use it when letting users explore alternate directions from an earlier chat turn without losing the original thread; comparing multiple prompt variations side by side through version steppers and a branch tree sidebar. Avoid it when you only need a linear multi-turn conversation without prompt forking; use ai-chat instead; you want token-level wording alternatives rather than full conversation forks; use ai-token-alternatives. Alternatives: @haze/ai-chat, @haze/ai-token-alternatives, @haze/chat-thread. ## Example requests that should lead here - Create a branching AI chat block where editing a user prompt spawns a new fork and updates a sidebar branch tree - Build a conversation workspace with previous and next version steppers for comparing alternate assistant answers ## Source ```astro --- import { Check, ChevronLeft, ChevronRight, Pencil, X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface BranchTurn { role: "user" | "assistant"; text: string; } interface ConversationBranch { id: string; label: string; parentId: string | null; forkTurnIndex: number; turns: BranchTurn[]; } interface Props { id?: string; title?: string; branches?: ConversationBranch[]; class?: string; } const { id = "haze-ai-branches", title = "Trip planning", branches = [ { id: "main", label: "Zurich to Milan · Regional rail", parentId: null, forkTurnIndex: 0, turns: [ { role: "user", text: "Plan three days from Zurich to Milan in early October.", }, { role: "assistant", text: "Day 1: Morning train to Chur, cross the Albula pass to St. Moritz, dinner by the lake.\nDay 2: Descend via Tirano, afternoon espresso along Lake Como.\nDay 3: Regional rail into Milano Centrale, walk Brera and Navigli.", }, { role: "user", text: "Make day 3 quieter and closer to the water.", }, { role: "assistant", text: "Skip central Milan until dusk. Take the morning ferry from Varenna to Bellagio, walk the Villa Melzi gardens, and linger over lakeside lunch before the 18:20 regional train south.", }, ], }, { id: "mountain-pass", label: "Day 3 · Lugano detour", parentId: "main", forkTurnIndex: 2, turns: [ { role: "user", text: "Plan three days from Zurich to Milan in early October.", }, { role: "assistant", text: "Day 1: Morning train to Chur, cross the Albula pass to St. Moritz, dinner by the lake.\nDay 2: Descend via Tirano, afternoon espresso along Lake Como.\nDay 3: Regional rail into Milano Centrale, walk Brera and Navigli.", }, { role: "user", text: "Keep lodging near stations with fast transfers under 20 minutes.", }, { role: "assistant", text: "Stay beside Chur Bahnhof on night one and Como San Giovanni on night two. Every connection stays on Saver Day Passes with 14 to 18 minute platform transfers into Milano Centrale.", }, ], }, { id: "geneva-turin", label: "Alternate · Geneva to Turin", parentId: "main", forkTurnIndex: 0, turns: [ { role: "user", text: "Plan three days from Geneva to Turin by mountain rail.", }, { role: "assistant", text: "Day 1: Rhone valley train to Brig, evening stroll through the old town.\nDay 2: Cross the Simplon pass into Domodossola, local wine bar for dinner.\nDay 3: Morning train to Torino Porta Nuova, visit the cinema museum and Piazza Vittorio.", }, ], }, ], class: className, } = Astro.props; const activeBranch = branches[0]; const rootSiblingCount = new Set(branches.map((b) => b.turns[0]?.text ?? "")).size; const turn2Siblings = branches.filter( (b) => b.turns.length > 2 && b.turns[0]?.text === activeBranch?.turns[0]?.text, ); const turn2Count = new Set(turn2Siblings.map((b) => b.turns[2]?.text ?? "")).size; ---

{title}

{branches.length} {branches.length === 1 ? "branch" : "branches"}
    { activeBranch?.turns.map((turn, idx) => (
  1. {turn.role === "user" ? (
    {turn.text}
    {(idx === 0 ? rootSiblingCount : idx === 2 ? turn2Count : 1) > 1 && (
    1/{idx === 0 ? rootSiblingCount : turn2Count}
    )}
    ) : (
    {turn.text.split("\n").map((line) => (

    {line}

    ))}
    )}
  2. )) }

``` --- # AI chat > Conversational AI workspace with thread switcher, collapsible reasoning, tool chips, source cards, feedback actions and stop control. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-chat` - File: `src/components/haze/blocks/ai-chat.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-chat ## Use when - Building a full workspace assistant where replies include reasoning steps, tool calls and cited sources - Users need to switch between recent threads, pick a model and stop or regenerate answers ## Avoid when - You only need a single prompt input bar without a message history; use ai-composer instead - You want an editorial single-answer layout rather than a multi-turn chat; use ai-answer ## Alternatives - [chat-thread](https://hazeui.com/ui/chat-thread.md) - [bento-assistant](https://hazeui.com/blocks/bento-assistant.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-chat" | no | Unique prefix for headings and form controls. | | title | `string` | "Workspace assistant" | no | Header title for the active chat workspace. | | models | `string[]` | 3 demo models | no | Model choices shown in the header selector. | | threads | `{ id: string; title: string; updated: string }[]` | 3 demo threads | no | Sidebar conversation list. | | messages | `Message[]` | 2 demo messages | no | Initial conversation turns with optional reasoning, tools and sources. | | placeholder | `string` | "Ask a follow-up or reference a PR…" | no | Composer textarea placeholder. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Reasoning uses a native details disclosure so keyboard and screen-reader users can expand or collapse thinking steps without script. - Live status updates (thread switch, copy, feedback, streaming state) are announced through a polite role="status" region. - Key Tab: Move across thread buttons, model select, reasoning disclosures, message actions and composer - Key Enter / Space: Toggle reasoning disclosure, rate a reply, switch threads or submit a message ## Agent prompts ### Install and use Install the Haze UI block "AI chat" with `npx shadcn@latest add @haze/ai-chat`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiChat from "@/components/haze/blocks/ai-chat.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-chat.md ### Customize with real content Adapt the Haze ai-chat block for our product. Replace the demo values of these props with our real content: id, title, models, threads, messages, placeholder, class. Keep the layout, the heading level rules and these accessibility details: Reasoning uses a native details disclosure so keyboard and screen-reader users can expand or collapse thinking steps without script. Live status updates (thread switch, copy, feedback, streaming state) are announced through a polite role="status" region. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-chat, check it fits: use it when building a full workspace assistant where replies include reasoning steps, tool calls and cited sources; users need to switch between recent threads, pick a model and stop or regenerate answers. Avoid it when you only need a single prompt input bar without a message history; use ai-composer instead; you want an editorial single-answer layout rather than a multi-turn chat; use ai-answer. Alternatives: @haze/chat-thread, @haze/bento-assistant. ## Example requests that should lead here - Add a dark AI chat workspace with thread sidebar, collapsible reasoning, tool chips and source citations - Build a multi-turn assistant chat with model selection and stop-generation control ## Source ```astro --- import { ArrowUp, Bot, Check, ChevronDown, Copy, Plus, RotateCw, Sparkles, Square, ThumbsDown, ThumbsUp, Wrench } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Thread { id: string; title: string; updated: string; } interface Source { label: string; domain: string; } interface Message { id: string; role: "user" | "assistant"; content: string; reasoning?: string; tools?: string[]; sources?: Source[]; } interface Props { id?: string; title?: string; models?: string[]; threads?: Thread[]; messages?: Message[]; placeholder?: string; class?: string; } const { id = "haze-ai-chat", title = "Workspace assistant", models = ["Sonnet 4.5", "Opus 4.5", "Flash 3.8"], threads = [ { id: "t1", title: "Q4 checkout latency spike", updated: "2m ago" }, { id: "t2", title: "Migrate billing webhooks", updated: "1h ago" }, { id: "t3", title: "Draft release notes v2.8", updated: "Yesterday" }, ], messages = [ { id: "m1", role: "user", content: "Why did p95 checkout latency jump after yesterday's deploy?", }, { id: "m2", role: "assistant", reasoning: "Checked the 24h trace histogram for /api/checkout, correlated deploy sha 9f3c2a1, and inspected the Stripe tax calculation middleware added in PR 418.", tools: ["query_traces(/api/checkout)", "inspect_pr(418)"], content: "The p95 increase from 180 ms to 490 ms started 4 minutes after deploy 9f3c2a1. PR 418 moved tax-rate resolution into the synchronous request path without caching postal lookups. Caching normalized postal prefixes in KV recovers ~290 ms.", sources: [ { label: "PR 418 diff", domain: "github.com" }, { label: "Checkout trace 8841", domain: "traces.internal" }, ], }, ], placeholder = "Ask a follow-up or reference a PR…", class: className, } = Astro.props; ---

{title}

    { messages.map((msg) => (
  1. {msg.role === "user" ? (
    {msg.content}
    ) : (
    {msg.reasoning && (

    {msg.reasoning}

    )} {msg.tools && msg.tools.length > 0 && (
    {msg.tools.map((tool) => ( ))}
    )}

    {msg.content}

    {msg.sources && msg.sources.length > 0 && (
    {msg.sources.map((src, i) => ( {i + 1} {src.label} {src.domain} ))}
    )}
    )}
  2. )) }

``` --- # AI in-chat checkout > In-chat merchant checkout card with quantity stepper, dynamic shipping and tax totals, animated pay progress, and collapsible receipt. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-checkout` - File: `src/components/haze/blocks/ai-checkout.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-checkout ## Use when - Completing a fast reorder or one-item purchase directly inside an assistant conversation - Showing live subtotal, free-shipping threshold, tax calculation, and saved card confirmation before charging - Folding a finished purchase card into a compact receipt row without leaving the chat thread ## Avoid when - Collecting full billing addresses, multi-item carts, or new card details; use payment-card-input in a dedicated checkout flow - Tracking a shipment after checkout has completed; use ai-order-status instead ## Alternatives - [payment-card-input](https://hazeui.com/ui/payment-card-input.md) - [ai-order-status](https://hazeui.com/blocks/ai-order-status.md) - [ai-send](https://hazeui.com/blocks/ai-send.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-checkout" | no | Unique prefix for section heading and aria-labelledby IDs. | | heading | `string` | "In-chat checkout" | no | Screen-reader section heading for landmark navigation. | | userPrompt | `string` | "Reorder the coffee beans I got last month" | no | User message bubble requesting the purchase. | | assistantReply | `string` | "Same as October, two bags of Ethiopia Worka. Want me to place it?" | no | Assistant reply introducing the checkout card. | | merchant | `string` | "Verve Roasters" | no | Merchant title shown in the checkout header. | | itemName | `string` | "Ethiopia Worka" | no | Product name inside the order line. | | itemMeta | `string` | "Whole bean, 250 g" | no | Variant or weight detail shown under the product name. | | unitPrice | `number` | 19 | no | Price per unit in USD used for live total recalculation. | | initialQuantity | `number` | 2 | no | Starting item quantity between 1 and 8. | | freeShippingAt | `number` | 35 | no | Subtotal threshold at which shipping becomes free. | | shippingFee | `number` | 4.5 | no | Flat shipping charge applied below the free-shipping threshold. | | taxRate | `number` | 0.08 | no | Decimal tax rate applied to the subtotal. | | cardSummary | `string` | "Card •••• 4242 · Arrives in 2 days" | no | Saved payment method and delivery estimate line. | | orderCode | `string` | "VR-8042" | no | Order reference displayed in the collapsed paid receipt. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Quantity stepper buttons carry explicit Decrease quantity and Increase quantity labels, disable at bounds (1 and 8), and announce recalculated totals through a polite status region. - Payment progress honors prefers-reduced-motion and shifts focus cleanly to the Start over action once the checkout card folds into the paid receipt. - Key Tab: Move between the quantity stepper buttons, the Pay button, and Start over after payment - Key Enter / Space: Adjust item quantity, submit the simulated payment, or reset the checkout card ## Agent prompts ### Install and use Install the Haze UI block "AI in-chat checkout" with `npx shadcn@latest add @haze/ai-checkout`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiCheckout from "@/components/haze/blocks/ai-checkout.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-checkout.md ### Customize with real content Adapt the Haze ai-checkout block for our product. Replace the demo values of these props with our real content: id, heading, userPrompt, assistantReply, merchant, itemName, itemMeta, unitPrice, initialQuantity, freeShippingAt, shippingFee, taxRate, cardSummary, orderCode, class. Keep the layout, the heading level rules and these accessibility details: Quantity stepper buttons carry explicit Decrease quantity and Increase quantity labels, disable at bounds (1 and 8), and announce recalculated totals through a polite status region. Payment progress honors prefers-reduced-motion and shifts focus cleanly to the Start over action once the checkout card folds into the paid receipt. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-checkout, check it fits: use it when completing a fast reorder or one-item purchase directly inside an assistant conversation; showing live subtotal, free-shipping threshold, tax calculation, and saved card confirmation before charging; folding a finished purchase card into a compact receipt row without leaving the chat thread. Avoid it when collecting full billing addresses, multi-item carts, or new card details; use payment-card-input in a dedicated checkout flow; tracking a shipment after checkout has completed; use ai-order-status instead. Alternatives: @haze/payment-card-input, @haze/ai-order-status, @haze/ai-send. ## Example requests that should lead here - Build an AI in-chat checkout card with a working quantity stepper, free-shipping threshold, pay progress bar, and paid receipt fold - Add an assistant reorder bubble for coffee beans that recalculates subtotal, shipping, and tax before charging a saved card ## Source ```astro --- import { Check, CreditCard, Lock, Minus, Plus, RotateCcw } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; heading?: string; userPrompt?: string; assistantReply?: string; merchant?: string; itemName?: string; itemMeta?: string; unitPrice?: number; initialQuantity?: number; freeShippingAt?: number; shippingFee?: number; taxRate?: number; cardSummary?: string; orderCode?: string; class?: string; } const { id = "haze-ai-checkout", heading = "In-chat checkout", userPrompt = "Reorder the coffee beans I got last month", assistantReply = "Same as October, two bags of Ethiopia Worka. Want me to place it?", merchant = "Verve Roasters", itemName = "Ethiopia Worka", itemMeta = "Whole bean, 250 g", unitPrice = 19, initialQuantity = 2, freeShippingAt = 35, shippingFee = 4.5, taxRate = 0.08, cardSummary = "Card •••• 4242 · Arrives in 2 days", orderCode = "VR-8042", class: className, } = Astro.props; const qty = Math.min(8, Math.max(1, Math.round(initialQuantity))); const subtotal = unitPrice * qty; const shipping = subtotal >= freeShippingAt ? 0 : shippingFee; const tax = Math.round(subtotal * taxRate * 100) / 100; const total = subtotal + shipping + tax; const fmt = (n: number) => `$${n.toFixed(2)}`; ---

{heading}

{userPrompt}

{assistantReply}

{merchant}

{itemName}

{fmt(unitPrice)} · {itemMeta}

{qty}
Subtotal
{fmt(subtotal)}
Shipping
{shipping === 0 ? "Free" : fmt(shipping)}
Tax
{fmt(tax)}
Total {fmt(total)}
{cardSummary}

``` --- # AI inline citations > Borderless grounded AI prose with inline domain pills that highlight sentences, open a source preview card and toggle all sources. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-citations` - File: `src/components/haze/blocks/ai-citations.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-citations ## Use when - Attributing individual claims in an AI summary to one or more verifiable web or document sources - Letting readers hover, focus or click inline domain pills to inspect backing excerpts without cluttering initial prose ## Avoid when - You need a full answer layout with thumbs feedback, version pagination and a follow-up bar; use ai-answer instead - Showing citations pinned to page numbers inside an uploaded PDF file; use ai-attachment ## Alternatives - [ai-answer](https://hazeui.com/blocks/ai-answer.md) - [ai-attachment](https://hazeui.com/blocks/ai-attachment.md) - [hover-card](https://hazeui.com/ui/hover-card.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-citations" | no | Unique prefix for landmark heading and source-list ARIA IDs. | | heading | `string` | "Grounded answer with inline citations" | no | Screen-reader landmark heading for the cited prose section. | | sources | `{ id: string; domain: string; title: string; excerpt: string; url: string }[]` | 4 demo web sources | no | Reference items displayed in the hover/click preview card and expandable sources list. | | claims | `{ text: string; sourceIds: string[] }[]` | 4 cited claims | no | Ordered sentences mapped to one or more source IDs. | | class | `string` | | no | Extra classes applied to the outer section. | ## Accessibility - Inline citation pills and multi-source preview tabs are native buttons with aria-pressed state, hover/focus highlight and Escape dismissal. - The footer sources button uses aria-expanded and aria-controls to toggle the full reference list, announcing changes in a polite status region. - Key Tab: Move across inline citation pills, preview controls and the sources toggle button - Key Enter / Space: Pin a citation preview card, switch paired sources or expand the full source list - Key Escape: Dismiss the active citation preview card and clear the sentence highlight ## Agent prompts ### Install and use Install the Haze UI block "AI inline citations" with `npx shadcn@latest add @haze/ai-citations`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiCitations from "@/components/haze/blocks/ai-citations.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-citations.md ### Customize with real content Adapt the Haze ai-citations block for our product. Replace the demo values of these props with our real content: id, heading, sources, claims, class. Keep the layout, the heading level rules and these accessibility details: Inline citation pills and multi-source preview tabs are native buttons with aria-pressed state, hover/focus highlight and Escape dismissal. The footer sources button uses aria-expanded and aria-controls to toggle the full reference list, announcing changes in a polite status region. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-citations, check it fits: use it when attributing individual claims in an ai summary to one or more verifiable web or document sources; letting readers hover, focus or click inline domain pills to inspect backing excerpts without cluttering initial prose. Avoid it when you need a full answer layout with thumbs feedback, version pagination and a follow-up bar; use ai-answer instead; showing citations pinned to page numbers inside an uploaded pdf file; use ai-attachment. Alternatives: @haze/ai-answer, @haze/ai-attachment, @haze/hover-card. ## Example requests that should lead here - Add a borderless AI inline citations prose block with tinted initial domain pills, hover preview card and overlapping avatar sources toggle ## Source ```astro --- import { ChevronDown, ExternalLink, X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface CitationSource { id: string; domain: string; title: string; excerpt: string; url: string; } interface CitationClaim { text: string; sourceIds: string[]; } interface Props { id?: string; heading?: string; sources?: CitationSource[]; claims?: CitationClaim[]; class?: string; } const { id = "haze-ai-citations", heading = "Grounded answer with inline citations", sources = [ { id: "s1", domain: "astro.build", title: "Islands architecture overview", excerpt: "Pages render static HTML on the server and selectively hydrate interactive islands only when needed.", url: "https://docs.astro.build/en/concepts/islands/", }, { id: "s2", domain: "web.dev", title: "Optimize Interaction to Next Paint (INP)", excerpt: "Breaking up long tasks and trimming upfront hydration keeps interaction callbacks snappy on mobile hardware.", url: "https://web.dev/articles/inp", }, { id: "s3", domain: "mdn.io", title: "Native HTML controls and focus semantics", excerpt: "Built-in browser elements expose keyboard navigation and accessibility roles without extra runtime scripts.", url: "https://developer.mozilla.org/en-US/docs/Web/HTML", }, { id: "s4", domain: "ecma.dev", title: "Reduced motion and progressive enhancement", excerpt: "Honoring user motion preferences swaps spatial transitions for crisp state changes with zero layout shift.", url: "https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion", }, ], claims = [ { text: "Keep interactive widgets lightweight. Shipping static HTML first lets pages paint immediately before small scripts hydrate on demand.", sourceIds: ["s1"], }, { text: "Trimming long main-thread tasks preserves crisp input latency across lower-powered devices.", sourceIds: ["s2", "s3"], }, { text: "Native buttons and disclosures provide keyboard support and focus semantics without extra framework overhead.", sourceIds: ["s3"], }, { text: "When a reader requests reduced motion, replace movement with a direct state swap so nothing feels jarring.", sourceIds: ["s4"], }, ], class: className, } = Astro.props; const badgeTones = [ "bg-muted text-foreground", "bg-muted text-foreground", "bg-muted text-foreground", "bg-muted text-foreground", ]; const sourceIndexMap = new Map(sources.map((s, idx) => [s.id, idx])); const sourceMap = new Map(sources.map((s) => [s.id, s])); const getTone = (sourceId: string) => { const idx = sourceIndexMap.get(sourceId) ?? 0; return badgeTones[idx % badgeTones.length]; }; const getInitial = (domain: string) => (domain.trim().charAt(0) || "S").toUpperCase(); const pillLabel = (ids: string[]) => { const first = sourceMap.get(ids[0] ?? ""); const base = first?.domain ?? "source"; return ids.length > 1 ? `${base} +${ids.length - 1}` : base; }; ---

{heading}

{ claims.map((claim, idx) => { const primaryId = claim.sourceIds[0] ?? ""; const primary = sourceMap.get(primaryId); const label = pillLabel(claim.sourceIds); return ( <> {claim.text} {" "} {" "} ); }) }

``` --- # AI code run > Assistant Python execution card with line-by-line stepping, streaming stdout or ValueError traceback, responsive bar chart and synthesis. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-code-run` - File: `src/components/haze/blocks/ai-code-run.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-code-run ## Use when - Showing an assistant executing a short data-analysis script directly inside a chat reply - Pairing numbered code execution with live stdout, error tracebacks and a visual summary chart - Letting users re-run a computation or inspect structured failure handling inline ## Avoid when - Displaying static syntax documentation without execution state or chart output; use code-block - Simulating a raw interactive shell session without structured code stepping; use terminal-window ## Alternatives - [code-block](https://hazeui.com/ui/code-block.md) - [terminal-window](https://hazeui.com/ui/terminal-window.md) - [agent-run](https://hazeui.com/blocks/agent-run.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-code-run" | no | Unique prefix for section heading IDs. | | heading | `string` | "Python analysis run" | no | Card header title. | | userPrompt | `string` | "Summarize this week's signups and plot the daily breakdown." | no | User prompt rendered above the script card. | | filename | `string` | "signups.py" | no | Script filename displayed in the runner header and traceback. | | data | `DayDatum[]` | Mon–Fri signup totals | no | Daily signup counts plotted in the bar chart and embedded in the script. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Code lines and terminal output sit in horizontally scrollable containers so narrow mobile viewports never clip or overflow. - Reduced-motion preferences skip line-by-line animation frames and announce completion or ValueError failure immediately via role="status". - Key Tab: Move between the Run again and Simulate error buttons - Key Enter / Space: Re-execute the Python script or trigger the structured ValueError traceback ## Agent prompts ### Install and use Install the Haze UI block "AI code run" with `npx shadcn@latest add @haze/ai-code-run`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiCodeRun from "@/components/haze/blocks/ai-code-run.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-code-run.md ### Customize with real content Adapt the Haze ai-code-run block for our product. Replace the demo values of these props with our real content: id, heading, userPrompt, filename, data, class. Keep the layout, the heading level rules and these accessibility details: Code lines and terminal output sit in horizontally scrollable containers so narrow mobile viewports never clip or overflow. Reduced-motion preferences skip line-by-line animation frames and announce completion or ValueError failure immediately via role="status". Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-code-run, check it fits: use it when showing an assistant executing a short data-analysis script directly inside a chat reply; pairing numbered code execution with live stdout, error tracebacks and a visual summary chart; letting users re-run a computation or inspect structured failure handling inline. Avoid it when displaying static syntax documentation without execution state or chart output; use code-block; simulating a raw interactive shell session without structured code stepping; use terminal-window. Alternatives: @haze/code-block, @haze/terminal-window, @haze/agent-run. ## Example requests that should lead here - Build an AI code execution card that steps through a Python signup script, streams stdout, and animates a Mon–Fri bar chart - Create an assistant code runner block with Run again and Simulate error controls plus a one-sentence summary ## Source ```astro --- import { CircleX, Play } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface DayDatum { day: string; count: number; } interface Props { id?: string; heading?: string; userPrompt?: string; filename?: string; data?: DayDatum[]; class?: string; } const { id = "haze-ai-code-run", heading = "Python analysis run", userPrompt = "How did signups do over the last five days?", filename = "signups.py", data = [ { day: "Mon", count: 142 }, { day: "Tue", count: 188 }, { day: "Wed", count: 215 }, { day: "Thu", count: 264 }, { day: "Fri", count: 231 }, ], class: className, } = Astro.props; const total = data.reduce((sum, item) => sum + item.count, 0); const maxCount = Math.max(...data.map((d) => d.count), 1); const peak = data.reduce((best, item) => (item.count > best.count ? item : best), data[0]); const first = data[0]?.count ?? 1; const last = data[data.length - 1]?.count ?? first; const growthPct = Math.round(((last - first) / Math.max(first, 1)) * 100); const growthStr = `${growthPct >= 0 ? "+" : ""}${growthPct}%`; const codeLines = [ "import pandas as pd", "", 'df = pd.read_csv("signups.csv")', 'daily = df.groupby("day").size().tail(5)', "growth = daily.iloc[-1] / daily.iloc[0] - 1", "", 'print(f"{daily.sum():,} signups, {growth:+.0%}")', "daily.plot.bar()", ]; const stdoutLine = `${total.toLocaleString("en-US")} signups, ${growthStr} · peak ${peak.day} (${peak.count})`; ---

{heading}

{/* User bubble */}

{userPrompt}

{/* Plain 1-line assistant intro */}

I'll pull them from the export and plot it.

{/* Nested code execution card */}
{/* Slim header */}
py {filename}
Done
{/* Inner code + output surface */}
{/* Numbered Python listing */}
    { codeLines.map((line, index) => (
  1. {index + 1} {line || " "}
  2. )) }
{/* Compact stdout + bar chart */}
{stdoutLine}
0.42s
    { data.map((item) => { const pct = Math.max(14, Math.round((item.count / maxCount) * 100)); const isPeak = item.day === peak.day; return (
  • {item.count}
    {item.day}
  • ); }) }

``` --- # AI composer > Rich prompt composer with starter chips, slash-command and @-mention pickers, file attachments, model effort controls and stop button. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-composer` - File: `src/components/haze/blocks/ai-composer.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-composer ## Use when - Providing a dedicated prompt entry bar with structured commands, file context and model controls - Embedding an AI ask box at the bottom of a workspace or empty state ## Avoid when - You need a full multi-turn conversation thread with history; use ai-chat instead ## Alternatives - [expanding-search](https://hazeui.com/ui/expanding-search.md) - [mention-input](https://hazeui.com/ui/mention-input.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-composer" | no | Unique prefix for form controls and labels. | | heading | `string` | "Ask anything about your workspace" | no | Prompt section heading above starter chips. | | placeholder | `string` | "Type a prompt, / for commands, or @ to mention a file…" | no | Placeholder text inside the textarea. | | starters | `string[]` | 3 starter prompts | no | Clickable starter prompt suggestions. | | models | `string[]` | 3 demo models | no | Model options in the composer toolbar. | | commands | `{ name: string; description: string }[]` | 3 slash commands | no | Slash commands shown in the command picker. | | mentions | `string[]` | 3 file mentions | no | Workspace files shown in the mention picker. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Command and mention panels expose aria-expanded on their toggle buttons and keep all actions keyboard reachable. - Attachment changes and submission states are announced via a polite role="status" message. - Key Tab: Move across starter chips, attachments, textarea, pickers, selectors and send button - Key Enter / Space: Insert a starter prompt, open commands or mentions, remove an attachment, or send ## Agent prompts ### Install and use Install the Haze UI block "AI composer" with `npx shadcn@latest add @haze/ai-composer`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiComposer from "@/components/haze/blocks/ai-composer.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-composer.md ### Customize with real content Adapt the Haze ai-composer block for our product. Replace the demo values of these props with our real content: id, heading, placeholder, starters, models, commands, mentions, class. Keep the layout, the heading level rules and these accessibility details: Command and mention panels expose aria-expanded on their toggle buttons and keep all actions keyboard reachable. Attachment changes and submission states are announced via a polite role="status" message. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-composer, check it fits: use it when providing a dedicated prompt entry bar with structured commands, file context and model controls; embedding an ai ask box at the bottom of a workspace or empty state. Avoid it when you need a full multi-turn conversation thread with history; use ai-chat instead. Alternatives: @haze/expanding-search, @haze/mention-input. ## Example requests that should lead here - Add a dark AI prompt composer with slash commands, @ file mentions, attachments and reasoning effort selector ## Source ```astro --- import { ArrowUp, AtSign, FileText, Paperclip, Slash, Sparkles, Square, X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; heading?: string; placeholder?: string; starters?: string[]; models?: string[]; commands?: { name: string; description: string }[]; mentions?: string[]; class?: string; } const { id = "haze-ai-composer", heading = "Ask anything about your workspace", placeholder = "Type a prompt, / for commands, or @ to mention a file…", starters = [ "Summarize yesterday's incident review", "Draft a migration plan for Astro 5", "Find open accessibility issues", ], models = ["Sonnet 4.5", "Opus 4.5", "Flash 3.8"], commands = [ { name: "/summarize", description: "Condense a thread or document into key points" }, { name: "/review", description: "Audit code diff for regressions and edge cases" }, { name: "/tests", description: "Generate Playwright assertions for a route" }, ], mentions = ["@checkout.ts", "@pricing-copy.md", "@Q4-metrics.csv"], class: className, } = Astro.props; ---

{heading}

{ starters.map((starter) => ( )) }

``` --- # AI inline app connect > Inline OAuth connection card inside a chat turn that pauses a tool call, authorizes GitHub and resumes to output a pull request card. - Kind: block · Category: Agents · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-connect` - File: `src/components/haze/blocks/ai-connect.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-connect ## Use when - Unblocking an agent tool call that lacks an active third-party app connection without leaving the chat - Showing explicit repository permission scopes before a user authorizes GitHub or another integration - Automatically resuming a paused action and displaying the created pull request card once connected ## Avoid when - Managing a full settings directory of persistent MCP servers and API keys; use mcp-servers - Asking yes/no permission for an already connected local command; use ai-tool-approval ## Alternatives - [mcp-servers](https://hazeui.com/blocks/mcp-servers.md) - [ai-tool-approval](https://hazeui.com/blocks/ai-tool-approval.md) - [ai-tool-calls](https://hazeui.com/blocks/ai-tool-calls.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-connect" | no | Unique prefix for section heading IDs. | | heading | `string` | "Inline app connection" | no | Card header title. | | userPrompt | `string` | "Open a pull request with the dark mode contrast fix" | no | User request that triggered the paused tool call. | | repository | `string` | "linden-labs/web" | no | Target repository displayed in the tool call and scope note. | | provider | `string` | "GitHub" | no | Integration name shown on the embedded connection card. | | permissions | `string` | "Read & write pull requests · No force push" | no | Summary of requested access scopes. | | prNumber | `string` | "418" | no | Pull request number rendered after authorization succeeds. | | prTitle | `string` | "Fix contrast on dark status chips" | no | Title shown on the resulting pull request link card. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Authorization progress, resumed execution, cancellation and reset states announce clearly through a polite role="status" live region. - Under prefers-reduced-motion, clicking Connect GitHub completes immediately without intermediate spinner transitions. - Key Tab: Move across Reset, Cancel, Connect GitHub and the resulting View PR link - Key Enter / Space: Authorize the integration, cancel the paused call or reset the flow ## Agent prompts ### Install and use Install the Haze UI block "AI inline app connect" with `npx shadcn@latest add @haze/ai-connect`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiConnect from "@/components/haze/blocks/ai-connect.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-connect.md ### Customize with real content Adapt the Haze ai-connect block for our product. Replace the demo values of these props with our real content: id, heading, userPrompt, repository, provider, permissions, prNumber, prTitle, class. Keep the layout, the heading level rules and these accessibility details: Authorization progress, resumed execution, cancellation and reset states announce clearly through a polite role="status" live region. Under prefers-reduced-motion, clicking Connect GitHub completes immediately without intermediate spinner transitions. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-connect, check it fits: use it when unblocking an agent tool call that lacks an active third-party app connection without leaving the chat; showing explicit repository permission scopes before a user authorizes github or another integration; automatically resuming a paused action and displaying the created pull request card once connected. Avoid it when managing a full settings directory of persistent mcp servers and api keys; use mcp-servers; asking yes/no permission for an already connected local command; use ai-tool-approval. Alternatives: @haze/mcp-servers, @haze/ai-tool-approval, @haze/ai-tool-calls. ## Example requests that should lead here - Build an inline AI app connect card that pauses a GitHub PR tool call, authorizes OAuth, and prints the created PR card - Create an in-chat integration prompt with scope details, Connect and Cancel actions, and automatic tool resumption ## Source ```astro --- import { Ban, Check, ExternalLink, Eye, GitBranch, GitPullRequest, LoaderCircle, Lock, Pause, RotateCcw, X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; heading?: string; userPrompt?: string; repository?: string; provider?: string; permissions?: string; prNumber?: string; prTitle?: string; class?: string; } const { id = "haze-ai-connect", heading = "Inline app connection", userPrompt = "Open a PR with the dark mode fix", repository = "linden-labs/web", provider = "GitHub", permissions = "Open and update pull requests", prNumber = "418", prTitle = "Fix contrast on dark status chips", class: className, } = Astro.props; ---

{heading}

{/* User bubble */}

{userPrompt}

{/* Nested two-layer connection card */}
{/* Slim top tool strip */}
Opening a pull request {repository}
Needs {provider}
{/* Inner card */}
{/* Authorization view */}
{/* Connector bridge */}

Connect {provider} to continue

Haze needs access to open a pull request on {repository}.

{/* Left-aligned permissions list */}
  • Not asked
{/* Opened PR view */} {/* Canceled view */}

``` --- # AI context meter > Floating context breakdown popover above a model pill with stacked token bar, 80% compaction mark, SVG ring and Compact now action. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-context-meter` - File: `src/components/haze/blocks/ai-context-meter.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-context-meter ## Use when - Surfacing remaining LLM context window capacity inside a chat composer footer - Showing how system instructions, turns, attached files and tool outputs consume tokens - Offering one-click context compaction when a long conversation approaches model limits ## Avoid when - Displaying monthly billing quotas or account seat counts; use usage-meter instead ## Alternatives - [usage-meter](https://hazeui.com/ui/usage-meter.md) - [progress-ring](https://hazeui.com/ui/progress-ring.md) - [ai-prompt](https://hazeui.com/blocks/ai-prompt.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-context-meter" | no | Unique prefix for labels and popover aria-controls. | | heading | `string` | "AI context meter" | no | Screen-reader section heading for the context meter. | | modelLabel | `string` | "Opus 5.5" | no | Active model name shown on the left of the status pill. | | maxTokens | `number` | 200000 | no | Total context window token budget used for percentage calculations. | | sources | `{ id: string; label: string; tokens: number }[]` | 4 token buckets | no | Initial token allocations shown inside the breakdown panel. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - The circular SVG meter button exposes aria-expanded and aria-controls while pairing the ring color with numeric percentage and status text. - Simulated token spikes and context compaction announce exact reclaimed token counts through a polite role="status" message. - Key Tab: Move between breakdown actions, draft textarea, context ring toggle and send button - Key Enter / Space: Toggle the breakdown popover, simulate +28% usage or compact active context ## Agent prompts ### Install and use Install the Haze UI block "AI context meter" with `npx shadcn@latest add @haze/ai-context-meter`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiContextMeter from "@/components/haze/blocks/ai-context-meter.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-context-meter.md ### Customize with real content Adapt the Haze ai-context-meter block for our product. Replace the demo values of these props with our real content: id, heading, modelLabel, maxTokens, sources, class. Keep the layout, the heading level rules and these accessibility details: The circular SVG meter button exposes aria-expanded and aria-controls while pairing the ring color with numeric percentage and status text. Simulated token spikes and context compaction announce exact reclaimed token counts through a polite role="status" message. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-context-meter, check it fits: use it when surfacing remaining llm context window capacity inside a chat composer footer; showing how system instructions, turns, attached files and tool outputs consume tokens; offering one-click context compaction when a long conversation approaches model limits. Avoid it when displaying monthly billing quotas or account seat counts; use usage-meter instead. Alternatives: @haze/usage-meter, @haze/progress-ring, @haze/ai-prompt. ## Example requests that should lead here - Build an AI composer footer with a circular SVG context meter that expands into a token breakdown with a Compact context action - Add a context window indicator that shifts from brand to warning to destructive stroke as token usage rises ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface ContextSource { id: string; label: string; tokens: number; } interface Props { id?: string; heading?: string; modelLabel?: string; maxTokens?: number; sources?: ContextSource[]; class?: string; } const { id = "haze-ai-context-meter", heading = "AI context meter", modelLabel = "Opus 5.5", maxTokens = 200000, sources = [ { id: "system", label: "System prompt", tokens: 3100 }, { id: "tools", label: "Tools", tokens: 14200 }, { id: "files", label: "Files", tokens: 38600 }, { id: "messages", label: "Messages", tokens: 61000 }, ], class: className, } = Astro.props; const totalInitial = sources.reduce((sum, s) => sum + s.tokens, 0); const freeInitial = Math.max(0, maxTokens - totalInitial); const initialPct = Math.min(100, Math.round((totalInitial / maxTokens) * 100)); const radius = 7; const circumference = 2 * Math.PI * radius; const initialOffset = circumference * (1 - initialPct / 100); const formatK = (n: number) => (n >= 10000 ? `${Math.round(n / 1000)}k` : `${(n / 1000).toFixed(1)}k`); const formatPct = (n: number) => `${((n / maxTokens) * 100).toFixed(1)}%`; const segmentTone = (idx: number) => { if (idx === 0) return "bg-muted-foreground"; if (idx === 1) return "bg-foreground/70"; if (idx === 2) return "bg-border-strong"; return "bg-foreground/40"; }; const dotSlots = Array.from({ length: 36 }); ---

{heading}

Context

{formatK(totalInitial)} of {Math.round(maxTokens / 1000)}k
{ sources.map((src, idx) => { const widthPct = Math.max(1.2, (src.tokens / maxTokens) * 100); return (
); }) }

Compacts at 80%

    { sources.map((src, idx) => (
  • {formatK(src.tokens)} {formatPct(src.tokens)}
  • )) }
  • {formatK(freeInitial)} {formatPct(freeInitial)}
Summarize older turns
{modelLabel}

``` --- # AI diff review > Multi-file coding agent diff review with live line stats, Accept/Reject/Undo controls, collapsible decided rows and stream replay. - Kind: block · Category: Agents · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-diff-review` - File: `src/components/haze/blocks/ai-diff-review.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-diff-review ## Use when - Reviewing a multi-file patch produced by a coding agent with independent Accept and Reject actions per file - Collapsing reviewed files into compact status rows while updating aggregate line counts live - Allowing engineers to undo any per-file decision or replay the incoming file stream ## Avoid when - Displaying a read-only side-by-side comparison without agent review state; use diff-viewer - Showing a single inline prose rewrite suggestion inside a paragraph; use ai-inline-rewrite ## Alternatives - [diff-viewer](https://hazeui.com/ui/diff-viewer.md) - [agent-run](https://hazeui.com/blocks/agent-run.md) - [ai-inline-rewrite](https://hazeui.com/blocks/ai-inline-rewrite.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-diff-review" | no | Unique prefix for section heading IDs. | | heading | `string` | "Agent diff review" | no | Panel header title. | | summaryNote | `string` | "Rotate expiring session tokens and clear stale cookies" | no | One-line patch description under the heading. | | files | `DiffFile[]` | 3 edited TypeScript files (+14 −6) | no | File patches with paths, line counts and semantic diff hunks. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Diff lines pair semantic success and destructive coloring with explicit plus and minus symbols inside horizontally scrollable hunks. - Accepting, rejecting, undoing or replaying files updates live counters and announces the change through a polite role="status" element. - Key Tab: Move across Replay stream and each file's Reject, Accept or Undo controls - Key Enter / Space: Accept, reject or undo a file patch or replay the file stream ## Agent prompts ### Install and use Install the Haze UI block "AI diff review" with `npx shadcn@latest add @haze/ai-diff-review`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiDiffReview from "@/components/haze/blocks/ai-diff-review.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-diff-review.md ### Customize with real content Adapt the Haze ai-diff-review block for our product. Replace the demo values of these props with our real content: id, heading, summaryNote, files, class. Keep the layout, the heading level rules and these accessibility details: Diff lines pair semantic success and destructive coloring with explicit plus and minus symbols inside horizontally scrollable hunks. Accepting, rejecting, undoing or replaying files updates live counters and announces the change through a polite role="status" element. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-diff-review, check it fits: use it when reviewing a multi-file patch produced by a coding agent with independent accept and reject actions per file; collapsing reviewed files into compact status rows while updating aggregate line counts live; allowing engineers to undo any per-file decision or replay the incoming file stream. Avoid it when displaying a read-only side-by-side comparison without agent review state; use diff-viewer; showing a single inline prose rewrite suggestion inside a paragraph; use ai-inline-rewrite. Alternatives: @haze/diff-viewer, @haze/agent-run, @haze/ai-inline-rewrite. ## Example requests that should lead here - Build an AI diff review panel for three edited files with live +14 −6 stats, Accept/Reject/Undo buttons, and Replay stream - Create a coding agent patch reviewer that collapses decided files into compact status bars and announces updates accessibly ## Source ```astro --- import { Check, ChevronRight, RotateCcw, X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface DiffLine { kind: "ctx" | "add" | "del"; num: string; code: string; } interface DiffFile { id: string; path: string; isNew?: boolean; additions: number; deletions: number; lines: DiffLine[]; } interface Props { id?: string; heading?: string; summaryNote?: string; files?: DiffFile[]; class?: string; } const { id = "haze-ai-diff-review", heading = "Agent diff review", files = [ { id: "validate", path: "src/auth/validate.ts", isNew: true, additions: 5, deletions: 0, lines: [ { kind: "add", num: "1", code: "export function isExpired(expiresAt: number) {" }, { kind: "add", num: "2", code: " return expiresAt <= Date.now();" }, { kind: "add", num: "3", code: "}" }, { kind: "add", num: "4", code: "export function isNearExpiry(expiresAt: number, windowMs = 60_000) {" }, { kind: "add", num: "5", code: " return expiresAt - Date.now() <= windowMs;" }, { kind: "ctx", num: "6", code: "}" }, ], }, { id: "session", path: "src/auth/session.ts", additions: 5, deletions: 4, lines: [ { kind: "ctx", num: "12", code: "export async function rotateSession(jar: CookieJar, sid: string) {" }, { kind: "del", num: "13", code: " const record = await store.get(sid);" }, { kind: "del", num: "14", code: " if (!record) return null;" }, { kind: "del", num: "15", code: " return issueCookie(jar, record.userId);" }, { kind: "add", num: "13", code: " const record = await store.consume(sid);" }, { kind: "add", num: "14", code: " if (!record || isExpired(record.expiresAt)) {" }, { kind: "add", num: "15", code: ' jar.clear("sid");' }, { kind: "add", num: "16", code: " return null;" }, { kind: "add", num: "17", code: " }" }, { kind: "del", num: "16", code: " // reuse previous cookie flags" }, { kind: "ctx", num: "18", code: ' return issueCookie(jar, record.userId, { sameSite: "lax" });' }, { kind: "ctx", num: "19", code: "}" }, ], }, { id: "spec", path: "tests/session.spec.ts", additions: 4, deletions: 2, lines: [ { kind: "ctx", num: "41", code: 'test("invalidates expired tokens on rotation", async () => {' }, { kind: "del", num: "42", code: " const next = await rotateSession(jar, expiredId);" }, { kind: "del", num: "43", code: " expect(next).toBeDefined();" }, { kind: "add", num: "42", code: " const rotated = await rotateSession(jar, expiredId);" }, { kind: "add", num: "43", code: " expect(rotated).toBeNull();" }, { kind: "add", num: "44", code: ' expect(jar.get("sid")).toBeUndefined();' }, { kind: "add", num: "45", code: " expect(await store.get(expiredId)).toBeNull();" }, { kind: "ctx", num: "46", code: "});" }, ], }, ], class: className, } = Astro.props; const totalAdd = files.reduce((sum, f) => sum + f.additions, 0); const totalDel = files.reduce((sum, f) => sum + f.deletions, 0); const defaultOpenIndex = files.length > 1 ? 1 : 0; function splitPath(fullPath: string) { const slash = fullPath.lastIndexOf("/"); if (slash === -1) return { dir: "", name: fullPath }; return { dir: fullPath.slice(0, slash + 1), name: fullPath.slice(slash + 1) }; } function diffSquares(add: number, del: number): ("add" | "del" | "empty")[] { const total = add + del; if (total === 0) return ["empty", "empty", "empty", "empty", "empty"]; let green = Math.round((add / total) * 5); let red = 5 - green; if (add > 0 && green === 0) { green = 1; red = 4; } if (del > 0 && red === 0) { red = 1; green = 4; } return [...Array<"add">(green).fill("add"), ...Array<"del">(red).fill("del")]; } ---

{heading}

{/* Header strip */}
Editing files +{totalAdd} −{totalDel}
{/* Inner file list */}

``` --- # AI feature launch > In-product AI feature launch card with interactive 3-step tour preview, benefit checklist, admin enable switch and CTAs. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-feature-launch` - File: `src/components/haze/blocks/ai-feature-launch.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-feature-launch ## Use when - Introducing a new AI capability inside an existing SaaS workspace with clear admin opt-in - Showing a compact interactive three-step walkthrough alongside privacy guarantees ## Avoid when - Running a full multi-page setup wizard with source syncing; use ai-setup-wizard ## Alternatives - [banner-release-notice](https://hazeui.com/blocks/banner-release-notice.md) - [cta-split-benefits](https://hazeui.com/blocks/cta-split-benefits.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-feature-launch" | no | Unique prefix for section heading IDs. | | badge | `string` | "New in Haze" | no | Pill badge above the interactive tour. | | title | `string` | "Meet AI Triage for incoming issues" | no | Announcement headline. | | description | `string` | Feature summary | no | Short explanation under the title. | | steps | `{ label: string; caption: string; preview: string }[]` | 3 tour steps | no | Interactive tour steps displayed at the top. | | benefits | `string[]` | 3 privacy and control bullets | no | Checklist shown above the workspace toggle. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Tour steps use role="tab" buttons with aria-selected, and the workspace opt-in is a native checkbox with visible admin note. - Toggle and Try-it-now actions update a polite role="status" message. - Key Tab: Move across tour step tabs, enable checkbox, Learn more link and Try it now button - Key Enter / Space: Switch tour steps, toggle workspace enablement or launch the sandbox ## Agent prompts ### Install and use Install the Haze UI block "AI feature launch" with `npx shadcn@latest add @haze/ai-feature-launch`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiFeatureLaunch from "@/components/haze/blocks/ai-feature-launch.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-feature-launch.md ### Customize with real content Adapt the Haze ai-feature-launch block for our product. Replace the demo values of these props with our real content: id, badge, title, description, steps, benefits, class. Keep the layout, the heading level rules and these accessibility details: Tour steps use role="tab" buttons with aria-selected, and the workspace opt-in is a native checkbox with visible admin note. Toggle and Try-it-now actions update a polite role="status" message. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-feature-launch, check it fits: use it when introducing a new ai capability inside an existing saas workspace with clear admin opt-in; showing a compact interactive three-step walkthrough alongside privacy guarantees. Avoid it when running a full multi-page setup wizard with source syncing; use ai-setup-wizard. Alternatives: @haze/banner-release-notice, @haze/cta-split-benefits. ## Example requests that should lead here - Add an in-product AI feature launch card with a three-step interactive preview and admin enable toggle ## Source ```astro --- import { ArrowRight, Check, ShieldCheck, Sparkles } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface TourStep { label: string; caption: string; preview: string; } interface Props { id?: string; badge?: string; title?: string; description?: string; steps?: TourStep[]; benefits?: string[]; class?: string; } const { id = "haze-ai-feature-launch", badge = "New in Haze", title = "Meet AI Triage for incoming issues", description = "Automatically label, deduplicate and route bug reports with full audit logs and workspace-level controls.", steps = [ { label: "1. Detect duplicates", caption: "Matches new reports against open issues in 180 ms.", preview: "Matched issue 412 (94% similarity): Safari popover backdrop clip" }, { label: "2. Suggest owner", caption: "Routes to the team owning the affected route or package.", preview: "Assigned to @core-ui · Priority: High · Area: Overlays" }, { label: "3. Draft repro", caption: "Attaches a minimal reproduction checklist for the engineer.", preview: "Checklist ready: 3 steps verified from trace 9012" }, ], benefits = [ "Zero training on your private workspace data", "Instant per-project opt-out for workspace admins", "Every automated label can be reversed in one click", ], class: className, } = Astro.props; const firstStep = steps[0]; ---

{firstStep?.preview ?? "No tour steps are available."}

{title}

{description}

    { benefits.map((b) => (
  • )) }

Preview mode · Not yet enabled

Learn more
``` --- # AI human handoff > In-chat escalation card with live queue countdown, shared context summary, support avatar stack, cancel option, and specialist join state. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-handoff` - File: `src/components/haze/blocks/ai-handoff.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-handoff ## Use when - Transferring an AI support thread to a human billing or account specialist with visible queue progress - Showing users the exact account facts shared with the incoming agent for transparency - Allowing users to cancel escalation and stay with the AI assistant before a specialist connects ## Avoid when - Presenting a general multi-turn AI chat interface without live queue escalation; use ai-chat or chat-thread - Connecting an external API integration or OAuth workspace rather than a human agent; use ai-connect ## Alternatives - [ai-chat](https://hazeui.com/blocks/ai-chat.md) - [ai-connect](https://hazeui.com/blocks/ai-connect.md) - [chat-thread](https://hazeui.com/ui/chat-thread.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-handoff" | no | Unique prefix for the section heading and aria-labelledby reference. | | heading | `string` | "Human specialist handoff" | no | Screen-reader section heading for landmark navigation. | | userPrompt | `string` | "I got charged twice for October" | no | User message triggering escalation to a human specialist. | | assistantReply | `string` | "I can see both charges. Refunds need someone on the billing team..." | no | Assistant reply confirming escalation and context transfer. | | department | `string` | "Billing" | no | Target support queue name displayed in the card header. | | specialistName | `string` | "Tessa" | no | Name of the human specialist who joins when the queue reaches zero. | | specialistRole | `string` | "Billing specialist" | no | Role subtitle shown on the specialist arrival banner. | | specialistMessage | `string` | "Hi! I can see both $24.00 charges on INV-2291..." | no | Opening message from the human specialist after joining. | | waitEstimate | `string` | "Usually replies in about 2 min" | no | Typical response wait estimate displayed beside the team initials stack. | | contextItems | `string[]` | 3 factual account summary items | no | Bullet points explaining what context is passed to the human specialist. | | teamInitials | `string[]` | ["N", "T", "A"] | no | Support team initials rendered in the overlapping avatar stack. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Queue position updates (3rd, 2nd, 1st, Connected), cancellations, and specialist arrival are announced politely through a dedicated role="status" live region. - Cancelling handoff or rejoining the queue keeps keyboard focus on the next available action without trapping or losing focus. - Key Tab: Move to Keep chatting with AI during queuing, Rejoin queue when paused, or Replay handoff once connected - Key Enter / Space: Cancel escalation, rejoin the billing queue, or replay the live specialist handoff ## Agent prompts ### Install and use Install the Haze UI block "AI human handoff" with `npx shadcn@latest add @haze/ai-handoff`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiHandoff from "@/components/haze/blocks/ai-handoff.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-handoff.md ### Customize with real content Adapt the Haze ai-handoff block for our product. Replace the demo values of these props with our real content: id, heading, userPrompt, assistantReply, department, specialistName, specialistRole, specialistMessage, waitEstimate, contextItems, teamInitials, class. Keep the layout, the heading level rules and these accessibility details: Queue position updates (3rd, 2nd, 1st, Connected), cancellations, and specialist arrival are announced politely through a dedicated role="status" live region. Cancelling handoff or rejoining the queue keeps keyboard focus on the next available action without trapping or losing focus. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-handoff, check it fits: use it when transferring an ai support thread to a human billing or account specialist with visible queue progress; showing users the exact account facts shared with the incoming agent for transparency; allowing users to cancel escalation and stay with the ai assistant before a specialist connects. Avoid it when presenting a general multi-turn ai chat interface without live queue escalation; use ai-chat or chat-thread; connecting an external api integration or oauth workspace rather than a human agent; use ai-connect. Alternatives: @haze/ai-chat, @haze/ai-connect, @haze/chat-thread. ## Example requests that should lead here - Create an AI human handoff card with a live 3rd-to-Connected queue countdown, shared context summary bullets, team initials stack, and specialist join transition - Build a billing escalation bubble inside a support chat with a Keep chatting with AI cancel button and Replay handoff control ## Source ```astro --- import { Check, Headphones, RotateCcw } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; heading?: string; userPrompt?: string; assistantReply?: string; department?: string; specialistName?: string; specialistRole?: string; specialistMessage?: string; waitEstimate?: string; contextItems?: string[]; teamInitials?: string[]; class?: string; } const { id = "haze-ai-handoff", heading = "Human specialist handoff", userPrompt = "I got charged twice for October", assistantReply = "I can see both charges. Refunds need someone on the billing team, so I'm handing you over with the details.", department = "Billing", specialistName = "Tessa", specialistRole = "Billing specialist", specialistMessage = "Hi! I can see both $24.00 charges on INV-2291. I'm refunding the duplicate to your card ending 4242 now.", waitEstimate = "Usually replies in about 2 min", contextItems = [ "Two charges of $24.00 on Nov 3", "Invoice INV-2291, card ending 4242", "You'd like one of them refunded", ], teamInitials = ["N", "T", "A"], class: className, } = Astro.props; const specialistInitial = specialistName.slice(0, 1).toUpperCase(); const avatarTones = [ "bg-muted text-foreground", "bg-muted text-foreground", "bg-muted text-foreground", ]; ---

{heading}

{userPrompt}

{assistantReply}

3rd in line

They'll see this, so you won't repeat yourself

    { contextItems.map((item) => (
  • {item}
  • )) }
{waitEstimate}

``` --- # AI inline edit > Document editor with in-place selection rewrite diff (Accept/Reject) and Tab ghost-text completion. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-inline-edit` - File: `src/components/haze/blocks/ai-inline-edit.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/kbd, @haze/utils - Docs page: https://hazeui.com/blocks/ai-inline-edit ## Use when - Supporting in-place AI rewrites inside a document without opening a separate sidebar - Showing inline ghost-text completions that users can accept with one click or Tab ## Avoid when - You want a persistent chat/diff sidebar beside the document; use ai-side-panel ## Alternatives - [ai-side-panel](https://hazeui.com/blocks/ai-side-panel.md) - [rich-text-editor](https://hazeui.com/ui/rich-text-editor.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-inline-edit" | no | Unique prefix for section heading IDs. | | title | `string` | "Release checklist" | no | Document heading. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Inline diffs use semantic del and ins markup with clear Accept and Reject buttons. - Ghost-text acceptance has an explicit button alongside the Tab key hint so keyboard and pointer users can trigger it reliably. - Key Tab: Move across Edit selection, Accept, Reject and ghost-completion controls - Key Enter / Space: Open the inline rewrite, accept/reject the diff or accept ghost text ## Agent prompts ### Install and use Install the Haze UI block "AI inline edit" with `npx shadcn@latest add @haze/ai-inline-edit`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiInlineEdit from "@/components/haze/blocks/ai-inline-edit.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-inline-edit.md ### Customize with real content Adapt the Haze ai-inline-edit block for our product. Replace the demo values of these props with our real content: id, title, class. Keep the layout, the heading level rules and these accessibility details: Inline diffs use semantic del and ins markup with clear Accept and Reject buttons. Ghost-text acceptance has an explicit button alongside the Tab key hint so keyboard and pointer users can trigger it reliably. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-inline-edit, check it fits: use it when supporting in-place ai rewrites inside a document without opening a separate sidebar; showing inline ghost-text completions that users can accept with one click or tab. Avoid it when you want a persistent chat/diff sidebar beside the document; use ai-side-panel. Alternatives: @haze/ai-side-panel, @haze/rich-text-editor. ## Example requests that should lead here - Add an AI inline edit document block with selection rewrite diff and Tab ghost-text completion ## Source ```astro --- import { Check, Sparkles, Wand2, X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Kbd from "../ui/kbd.astro"; interface Props { id?: string; title?: string; class?: string; } const { id = "haze-ai-inline-edit", title = "Release checklist", class: className, } = Astro.props; ---

{title}

Before cutting a tagged release, verify every registry artifact builds cleanly and passes contrast checks across all semantic surfaces.

Run the end-to-end suite locally so that you can catch any regressions before pushing the tag to main.

Run the end-to-end suite locally so that you can catch any regressions before pushing the tag to main. Run the E2E suite locally to catch regressions before tagging main.

After publishing the release notes, notify the team in #releases with a link to the changelog and migration guide.

``` --- # AI inline rewrite > Editable draft card with selection and paragraph triggers, inline AI instruction input, streaming del/ins diffs and retry variations. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-inline-rewrite` - File: `src/components/haze/blocks/ai-inline-rewrite.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-inline-rewrite ## Use when - Reviewing and refining draft prose inside a document without leaving the paragraph context - Offering both text-selection and button-triggered AI rewrites with streaming del and ins previews ## Avoid when - Reviewing large side-by-side code patches across multiple files; use ai-diff-review instead - Offering single-line ghost text completion while typing; use ai-autocomplete ## Alternatives - [ai-inline-edit](https://hazeui.com/blocks/ai-inline-edit.md) - [ai-autocomplete](https://hazeui.com/blocks/ai-autocomplete.md) - [ai-diff-review](https://hazeui.com/blocks/ai-diff-review.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-inline-rewrite" | no | Unique prefix for headings and inline prompt inputs. | | title | `string` | "Billing launch update" | no | Document title shown in the card header. | | badge | `string` | "Draft" | no | Initial status badge shown next to the document title. | | paragraphs | `string[]` | 3 demo paragraphs | no | Editable prose passages shown inside the draft. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Every paragraph exposes an explicit Rewrite paragraph button so keyboard and touch users never rely solely on pointer selection. - Inline diffs use semantic del and ins elements and announce streaming, accept, discard and retry states in a polite role="status" region. - Key Tab: Move across Rewrite paragraph buttons, preset prompt chips, custom instruction input and diff actions - Key Enter / Space: Open the inline prompt bar, apply a preset rewrite, or accept, retry or discard the diff ## Agent prompts ### Install and use Install the Haze UI block "AI inline rewrite" with `npx shadcn@latest add @haze/ai-inline-rewrite`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiInlineRewrite from "@/components/haze/blocks/ai-inline-rewrite.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-inline-rewrite.md ### Customize with real content Adapt the Haze ai-inline-rewrite block for our product. Replace the demo values of these props with our real content: id, title, badge, paragraphs, class. Keep the layout, the heading level rules and these accessibility details: Every paragraph exposes an explicit Rewrite paragraph button so keyboard and touch users never rely solely on pointer selection. Inline diffs use semantic del and ins elements and announce streaming, accept, discard and retry states in a polite role="status" region. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-inline-rewrite, check it fits: use it when reviewing and refining draft prose inside a document without leaving the paragraph context; offering both text-selection and button-triggered ai rewrites with streaming del and ins previews. Avoid it when reviewing large side-by-side code patches across multiple files; use ai-diff-review instead; offering single-line ghost text completion while typing; use ai-autocomplete. Alternatives: @haze/ai-inline-edit, @haze/ai-autocomplete, @haze/ai-diff-review. ## Example requests that should lead here - Build an editable draft document card where selecting text or clicking a paragraph opens an inline AI rewriter with streaming del/ins diffs - Add an AI prose rewrite widget with Make it shorter and More direct presets plus Accept, Discard and Try again controls ## Source ```astro --- import { ArrowUp, Pencil } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; title?: string; badge?: string; paragraphs?: string[]; class?: string; } const { id = "haze-ai-inline-rewrite", title = "Billing launch update", badge = "Draft", paragraphs = [ "We are ready to roll out the updated billing view next Tuesday. To keep the launch calm and predictable, workspace owners will get access in small waves first.", "Due to the fact that metered compute charges are now tallied every hour, some finance teams might notice their mid-cycle totals look different then before.", "Legacy payment webhooks stay active through quarter end while teams move to signed v3 payloads. Ping #billing if anything looks off.", ], class: className, } = Astro.props; const presets = ["Shorter", "Clearer", "Friendlier", "Fix grammar"]; ---
{badge}
{ paragraphs.map((text, idx) => (

{idx === 1 ? ( {text} ) : ( text )}

)) }
Select any text to edit it with AI

``` --- # AI search composer > Grounded AI search bar with a tool switcher, run-limit indicators, active tool pill, live source reading trace and cited summary. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-input-search` - File: `src/components/haze/blocks/ai-input-search.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-input-search ## Use when - Offering an AI answer bar that shows which live sources are being read before summarizing - Letting users toggle specialized search tools with visible quota dot indicators - Pairing a prompt input with clickable citation cards and a stoppable search trace ## Avoid when - You need instant local keyword filtering across static workspace records; use ai-search-bar instead - You do not need source verification or tool selection; use ai-prompt instead ## Alternatives - [ai-search-bar](https://hazeui.com/blocks/ai-search-bar.md) - [ai-prompt](https://hazeui.com/blocks/ai-prompt.md) - [ai-citations](https://hazeui.com/blocks/ai-citations.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-input-search" | no | Unique prefix for form labels and tool menu controls. | | heading | `string` | "Answers with links you can check" | no | Header hint shown in the outer search tray. | | placeholder | `string` | "Look something up" | no | Placeholder text inside the search textarea. | | initialQuery | `string` | "" | no | Optional pre-filled query inside the search box. | | tools | `{ id: string; label: string; description: string; remaining: number; limit: number }[]` | 5 demo tools | no | Tools displayed in the Change / menu with quota dots. | | models | `string[]` | ["Sonnet 5.5", "Opus 5.5", "Flash 4.0"] | no | Model options available in the toolbar selector. | | sources | `{ initials: string; title: string; domain: string; href: string; snippet: string }[]` | 4 demo sources | no | Source entries stacked during the live trace and linked below. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - The tool switcher exposes aria-expanded and aria-controls, while run-limit dot rows carry readable aria-label quota counts. - Tool changes, file attachments, source reading progress and stop actions announce via a polite role="status" region. - Key Tab: Move across the Change / menu trigger, active tool pill, query field, controls and citation links - Key Enter / Space: Toggle the tool menu, choose a tool, remove pills, attach files or start and stop a search ## Agent prompts ### Install and use Install the Haze UI block "AI search composer" with `npx shadcn@latest add @haze/ai-input-search`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiInputSearch from "@/components/haze/blocks/ai-input-search.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-input-search.md ### Customize with real content Adapt the Haze ai-input-search block for our product. Replace the demo values of these props with our real content: id, heading, placeholder, initialQuery, tools, models, sources, class. Keep the layout, the heading level rules and these accessibility details: The tool switcher exposes aria-expanded and aria-controls, while run-limit dot rows carry readable aria-label quota counts. Tool changes, file attachments, source reading progress and stop actions announce via a polite role="status" region. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-input-search, check it fits: use it when offering an ai answer bar that shows which live sources are being read before summarizing; letting users toggle specialized search tools with visible quota dot indicators; pairing a prompt input with clickable citation cards and a stoppable search trace. Avoid it when you need instant local keyword filtering across static workspace records; use ai-search-bar instead; you do not need source verification or tool selection; use ai-prompt instead. Alternatives: @haze/ai-search-bar, @haze/ai-prompt, @haze/ai-citations. ## Example requests that should lead here - Create an AI search composer with a tool picker, active tool pill, model selector and live source reading trace - Add a grounded answer prompt box that stacks source avatars one by one before showing clickable citation links ## Source ```astro --- import { ArrowUpRight, Brain, Check, ChevronDown, Code, Compass, CornerDownLeft, Globe, PenLine, Plus, Square, X, } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface SearchTool { id: string; label: string; description: string; remaining: number; limit: number; } interface GroundedSource { initials: string; title: string; domain: string; href: string; snippet: string; } interface Props { id?: string; heading?: string; placeholder?: string; initialQuery?: string; tools?: SearchTool[]; models?: string[]; sources?: GroundedSource[]; class?: string; } const { id = "haze-ai-input-search", heading = "Answers with links you can check", placeholder = "Look something up", initialQuery = "", tools = [ { id: "browse", label: "Browse sources", description: "Fetch and cite live documentation", remaining: 4, limit: 5 }, { id: "investigate", label: "Investigate", description: "Multi-step deep link verification", remaining: 3, limit: 5 }, { id: "draft", label: "Draft", description: "Write structured memos with references", remaining: 5, limit: 5 }, { id: "code", label: "Run code", description: "Execute snippets to confirm metrics", remaining: 2, limit: 5 }, { id: "reason", label: "Reason", description: "Extended analytical decomposition", remaining: 3, limit: 5 }, ], models = ["Sonnet 5.5", "Opus 5.5", "Flash 4.0"], sources = [ { initials: "ED", title: "Edge Cache-Control and Stale-While-Revalidate Patterns", domain: "docs.edgegrid.example", href: "#source-edge-cache", snippet: "Pairing 60s s-maxage with a 300s stale-while-revalidate window cuts origin load by 74%.", }, { initials: "CL", title: "Multi-Region Read Replicas and Cache Invalidation", domain: "engineering.cloudloom.example", href: "#source-read-replicas", snippet: "Tag-based surrogate purges converge across global PoPs in under 250ms.", }, { initials: "RF", title: "HTTP Caching Semantics for Dynamic JSON Endpoints", domain: "specs.rfcnotes.example", href: "#source-http-caching", snippet: "Use Vary headers narrowly on authorization and locale to preserve cache hit ratio.", }, { initials: "AP", title: "P99 Tail Latency Benchmarks at Regional Gateways", domain: "bench.apipulse.example", href: "#source-tail-latency", snippet: "Tiered shielding absorbs regional cold starts without spiking database connections.", }, ], class: className, } = Astro.props; const activeDefaultTool = tools[0] ?? { id: "browse", label: "Browse sources", description: "Fetch and cite live documentation", remaining: 4, limit: 5, }; const defaultModel = models[0] ?? "Sonnet 5.5"; ---

{heading}

``` --- # AI insight card > Self-explaining KPI card with annotated sparkline, Explain toggle, three ranked contribution bars and follow-up question chips. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-insight-card` - File: `src/components/haze/blocks/ai-insight-card.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-insight-card ## Use when - Explaining why a key business or product metric moved without opening a full BI dashboard - Linking ranked contributing drivers directly to numbered points on a trend sparkline ## Avoid when - Displaying a plain metric with no AI breakdown; use stat or sparkline ## Alternatives - [stat](https://hazeui.com/ui/stat.md) - [sparkline](https://hazeui.com/ui/sparkline.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-insight-card" | no | Unique prefix for panel and aria-controls IDs. | | metric | `string` | "Net expansion MRR" | no | KPI label. | | value | `string` | "$148.4k" | no | Headline metric value. | | delta | `string` | "+18.4% vs last 30d" | no | Comparison badge text. | | drivers | `{ id: number; label: string; share: number; delta: string }[]` | 3 ranked drivers | no | Ranked contributing factors with contribution bar widths. | | followUps | `string[]` | 3 follow-up chips | no | Suggested drill-down questions. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - The sparkline SVG carries role="img" and a descriptive aria-label summarizing the trend. - The Explain button exposes aria-expanded and aria-controls for the collapsible explanation panel. - Key Tab: Move between the Explain toggle and follow-up question buttons - Key Enter / Space: Expand or collapse the explanation panel or trigger a follow-up query ## Agent prompts ### Install and use Install the Haze UI block "AI insight card" with `npx shadcn@latest add @haze/ai-insight-card`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiInsightCard from "@/components/haze/blocks/ai-insight-card.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-insight-card.md ### Customize with real content Adapt the Haze ai-insight-card block for our product. Replace the demo values of these props with our real content: id, metric, value, delta, drivers, followUps, class. Keep the layout, the heading level rules and these accessibility details: The sparkline SVG carries role="img" and a descriptive aria-label summarizing the trend. The Explain button exposes aria-expanded and aria-controls for the collapsible explanation panel. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-insight-card, check it fits: use it when explaining why a key business or product metric moved without opening a full bi dashboard; linking ranked contributing drivers directly to numbered points on a trend sparkline. Avoid it when displaying a plain metric with no ai breakdown; use stat or sparkline. Alternatives: @haze/stat, @haze/sparkline. ## Example requests that should lead here - Create an AI insight KPI card with sparkline markers, Explain toggle, ranked driver bars and follow-up chips ## Source ```astro --- import { ArrowUpRight, Sparkles, TrendingUp } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Driver { id: number; label: string; share: number; delta: string; } interface Props { id?: string; metric?: string; value?: string; delta?: string; drivers?: Driver[]; followUps?: string[]; class?: string; } const { id = "haze-ai-insight-card", metric = "Net expansion MRR", value = "$148.4k", delta = "+18.4% vs last 30d", drivers = [ { id: 1, label: "Annual Pro upgrades from team trials", share: 54, delta: "+$12.6k" }, { id: 2, label: "Seat additions in EMEA accounts", share: 31, delta: "+$7.2k" }, { id: 3, label: "Lower voluntary churn after v2.6", share: 15, delta: "+$3.4k" }, ], followUps = ["Break down by plan tier", "Compare with Q3 cohort", "List top 5 accounts"], class: className, } = Astro.props; ---

{metric}

{value}

Expansion accelerated after week 2 when annual Pro upgrades converted at 2.1x the trailing baseline, led by mid-market teams adding seats.

    { drivers.map((d) => (
  1. {d.id} {d.label} {d.delta}
  2. )) }
{ followUps.map((q) => ( )) }

``` --- # AI state loading > Borderless collapsible AI progress log tracking ordered steps with a vertical timeline stem, mono sub-logs, timer and auto-fold summary. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-loading` - File: `src/components/haze/blocks/ai-loading.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-loading ## Use when - Showing multi-stage reasoning or retrieval progress while an AI assistant prepares a response - Collapsing finished tool and search steps into a compact summary row users can inspect on demand ## Avoid when - A single lightweight thinking phrase without per-step timing is enough; use ai-text-loading instead - Displaying detailed JSON arguments and outputs for individual function calls; use ai-tool-calls ## Alternatives - [ai-text-loading](https://hazeui.com/blocks/ai-text-loading.md) - [ai-tool-calls](https://hazeui.com/blocks/ai-tool-calls.md) - [workflow-steps](https://hazeui.com/ui/workflow-steps.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-loading" | no | Prefix used for landmark heading and collapsible panel ARIA IDs. | | heading | `string` | "Agent progress" | no | Screen-reader landmark heading for the progress region. | | steps | `{ label: string; detail: string; durationMs: number }[]` | 4 demo agent steps | no | Ordered steps with mono sub-log detail and duration in milliseconds. | | autoStart | `boolean` | true | no | Automatically starts the step progression sequence on load. | | class | `string` | | no | Extra classes applied to the outer section. | ## Accessibility - Top summary row is a native disclosure button with aria-expanded and aria-controls linked to the ordered vertical step list. - Run start, completion, auto-fold and manual collapse changes are announced politely in a role="status" live region. - Key Tab: Move focus between the collapsible progress toggle and the Replay button once completed - Key Enter / Space: Toggle the step list open or closed, or replay the timed sequence ## Agent prompts ### Install and use Install the Haze UI block "AI state loading" with `npx shadcn@latest add @haze/ai-loading`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiLoading from "@/components/haze/blocks/ai-loading.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-loading.md ### Customize with real content Adapt the Haze ai-loading block for our product. Replace the demo values of these props with our real content: id, heading, steps, autoStart, class. Keep the layout, the heading level rules and these accessibility details: Top summary row is a native disclosure button with aria-expanded and aria-controls linked to the ordered vertical step list. Run start, completion, auto-fold and manual collapse changes are announced politely in a role="status" live region. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-loading, check it fits: use it when showing multi-stage reasoning or retrieval progress while an ai assistant prepares a response; collapsing finished tool and search steps into a compact summary row users can inspect on demand. Avoid it when a single lightweight thinking phrase without per-step timing is enough; use ai-text-loading instead; displaying detailed json arguments and outputs for individual function calls; use ai-tool-calls. Alternatives: @haze/ai-text-loading, @haze/ai-tool-calls, @haze/workflow-steps. ## Example requests that should lead here - Add a borderless AI state loading block with four timed steps, a vertical stem, mono sub-log lines and an auto-folding summary row ## Source ```astro --- import { Check, ChevronDown, RotateCcw } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface LoadingStep { label: string; detail: string; durationMs: number; } interface Props { id?: string; heading?: string; steps?: LoadingStep[]; autoStart?: boolean; class?: string; } const { id = "haze-ai-loading", heading = "Agent progress", steps = [ { label: "Searching the web", detail: "query: loading states in agent UIs", durationMs: 1100 }, { label: "Reading 4 sources", detail: "fetch: 4 docs · 18.4 KB extracted", durationMs: 1000 }, { label: "Comparing approaches", detail: "rank: clarity, latency, motion safety", durationMs: 1100 }, { label: "Writing the summary", detail: "draft: 3 key findings ready", durationMs: 1000 }, ], autoStart = true, class: className, } = Astro.props; ---

{heading}

    { steps.map((step, index) => { const isLast = index === steps.length - 1; return (
  1. { !isLast && ( ) }

    {step.label}

    {index + 1} {step.detail}

  2. ); }) }

``` --- # AI chat memory > Split chat and live memory workspace with one-click prompts, Use memory toggle, in-place contradiction updates and inline edit or forget. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-memory` - File: `src/components/haze/blocks/ai-memory.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-memory ## Use when - Demonstrating how conversational facts automatically overwrite older assistant memories in real time - Pairing a live assistant chat alongside grouped personal memories with Use memory, edit and forget controls ## Avoid when - Providing a standalone memory settings screen without a live chat pane; use agent-memory instead - Building a multi-thread chat with reasoning and citations rather than memory updates; use ai-chat ## Alternatives - [agent-memory](https://hazeui.com/blocks/agent-memory.md) - [ai-chat](https://hazeui.com/blocks/ai-chat.md) - [switch](https://hazeui.com/ui/switch.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-memory" | no | Unique prefix for headings, chat input and switch IDs. | | title | `string` | "Assistant" | no | Heading for the left chat panel. | | greeting | `string` | Demo assistant greeting | no | Initial assistant message shown in the chat log. | | suggestions | `string[]` | 3 contradiction prompts | no | One-click prompt chips that update matching memories. | | memories | `ChatMemoryItem[]` | 6 categorized memories | no | Dated memory records grouped under About you, Food and Work. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - The Use memory toggle uses a native checkbox with role="switch" and visible label, and every memory row exposes item-specific Edit and Forget buttons. - Contradiction updates, inline edits, forget actions and pause states announce cleanly via a polite role="status" region. - Key Tab: Move across quick prompt chips, chat input, Send button, Use memory switch and memory row actions - Key Enter / Space: Trigger a quick prompt, submit a message, toggle memory usage or edit and forget a record ## Agent prompts ### Install and use Install the Haze UI block "AI chat memory" with `npx shadcn@latest add @haze/ai-memory`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiMemory from "@/components/haze/blocks/ai-memory.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-memory.md ### Customize with real content Adapt the Haze ai-memory block for our product. Replace the demo values of these props with our real content: id, title, greeting, suggestions, memories, class. Keep the layout, the heading level rules and these accessibility details: The Use memory toggle uses a native checkbox with role="switch" and visible label, and every memory row exposes item-specific Edit and Forget buttons. Contradiction updates, inline edits, forget actions and pause states announce cleanly via a polite role="status" region. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-memory, check it fits: use it when demonstrating how conversational facts automatically overwrite older assistant memories in real time; pairing a live assistant chat alongside grouped personal memories with use memory, edit and forget controls. Avoid it when providing a standalone memory settings screen without a live chat pane; use agent-memory instead; building a multi-thread chat with reasoning and citations rather than memory updates; use ai-chat. Alternatives: @haze/agent-memory, @haze/ai-chat, @haze/switch. ## Example requests that should lead here - Create a two-column AI chat and live memory block where prompts like I just moved to Lisbon overwrite and highlight existing facts - Build a split assistant workspace with Use memory toggle, categorized memory groups and inline edit or forget controls ## Source ```astro --- import { ArrowUp, Check, Pencil, Trash2, X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; type MemoryGroup = "About you" | "Food" | "Work"; interface ChatMemoryItem { id: string; slot?: "name" | "city" | "diet" | "coffee" | "role" | "tools"; category: MemoryGroup; text: string; date: string; updated?: boolean; } interface Props { id?: string; title?: string; greeting?: string; suggestions?: string[]; memories?: ChatMemoryItem[]; class?: string; } const { id = "haze-ai-memory", title = "Assistant", greeting = "Hi Alex. What's new? Tell me anything and I'll keep what matters.", suggestions = [ "I just moved to Lisbon", "I'm vegetarian now", "Please call me Sam", ], memories = [ { id: "cm-1", slot: "name", category: "About you", text: "Goes by Alex", date: "Aug 3" }, { id: "cm-2", slot: "city", category: "About you", text: "Lives in Berlin", date: "Aug 3" }, { id: "cm-3", slot: "diet", category: "Food", text: "Is pescatarian", date: "Sep 12" }, { id: "cm-4", slot: "coffee", category: "Food", text: "Likes oat flat whites", date: "Sep 12" }, { id: "cm-5", slot: "role", category: "Work", text: "Design engineer at Northline", date: "Jul 28" }, { id: "cm-6", slot: "tools", category: "Work", text: "Wants short, direct answers", date: "Jul 28" }, ], class: className, } = Astro.props; const groups: MemoryGroup[] = ["About you", "Food", "Work"]; ---

{title}

  1. {greeting}
{ suggestions.map((prompt) => ( )) }

Memory

{memories.length}
{ groups.map((group) => (

{group}

    {memories .filter((m) => m.category === group) .map((item) => (
  • {item.text} {item.date}

  • ))}
)) }

``` --- # AI message queue > Live running agent panel paired with a reorderable follow-up queue, inline edit, immediate interrupt send and keyboard composer. - Kind: block · Category: Agents · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-message-queue` - File: `src/components/haze/blocks/ai-message-queue.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-message-queue ## Use when - Letting users stack follow-up prompts while a long-running coding or research agent is still working - Supporting queue reordering, inline prompt edits, pause/resume controls and immediate Ctrl+Enter interrupts ## Avoid when - Showing a static checklist of agent subtasks without a live composer; use agent-tasks instead - Providing a single standalone prompt box without a running queue; use ai-prompt ## Alternatives - [agent-tasks](https://hazeui.com/blocks/agent-tasks.md) - [ai-prompt](https://hazeui.com/blocks/ai-prompt.md) - [sortable-list](https://hazeui.com/ui/sortable-list.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-message-queue" | no | Unique prefix for headings and composer labels. | | title | `string` | "Auth refactor" | no | Active task title shown in the running agent header. | | activePrompt | `string` | Demo refactor prompt | no | Prompt currently being executed by the agent. | | steps | `string[]` | 4 demo steps | no | Progress steps cycled while the agent is working. | | queue | `QueueItem[]` | 2 demo follow-ups | no | Initial queued follow-up prompts waiting to run. | | placeholder | `string` | "Queue a follow-up…" | no | Composer textarea placeholder text. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Every queue row exposes explicit Move up, Move down, Edit, Send now and Remove controls with item-specific aria-labels. - Queue changes, reorder steps, agent pause/resume and immediate sends are announced via a polite role="status" live region. - Key Enter: Queue the follow-up message currently typed in the composer - Key Ctrl+Enter: Interrupt the active run and send the composer message immediately - Key Tab: Move across Stop/Resume, Clear, per-row reorder/edit/send/remove actions and composer ## Agent prompts ### Install and use Install the Haze UI block "AI message queue" with `npx shadcn@latest add @haze/ai-message-queue`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiMessageQueue from "@/components/haze/blocks/ai-message-queue.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-message-queue.md ### Customize with real content Adapt the Haze ai-message-queue block for our product. Replace the demo values of these props with our real content: id, title, activePrompt, steps, queue, placeholder, class. Keep the layout, the heading level rules and these accessibility details: Every queue row exposes explicit Move up, Move down, Edit, Send now and Remove controls with item-specific aria-labels. Queue changes, reorder steps, agent pause/resume and immediate sends are announced via a polite role="status" live region. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-message-queue, check it fits: use it when letting users stack follow-up prompts while a long-running coding or research agent is still working; supporting queue reordering, inline prompt edits, pause/resume controls and immediate ctrl+enter interrupts. Avoid it when showing a static checklist of agent subtasks without a live composer; use agent-tasks instead; providing a single standalone prompt box without a running queue; use ai-prompt. Alternatives: @haze/agent-tasks, @haze/ai-prompt, @haze/sortable-list. ## Example requests that should lead here - Create an AI message queue block with a live running agent panel, reorderable follow-ups, Send now interrupts and Enter/Ctrl+Enter composer - Build an agent prompt queue where users can edit, move up/down, remove or clear pending follow-up instructions ## Source ```astro --- import { ArrowDown, ArrowUp, Check, GripVertical, Pencil, Play, Square, Trash2, X, Zap } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface QueueItem { id: string; text: string; } interface Props { id?: string; title?: string; activePrompt?: string; steps?: string[]; queue?: QueueItem[]; placeholder?: string; class?: string; } const { id = "haze-ai-message-queue", title = "Auth refactor", activePrompt = "Move session handling onto the new token store", steps = [ "Reading src/auth/session.ts", "Checking token verification middleware", "Updating session rotation unit tests", "Verifying cookie expiry headers", ], queue = [ { id: "q-1", text: "Also add a test for expired tokens" }, { id: "q-2", text: "Keep the old cookie name for now" }, ], placeholder = "Queue a follow-up...", class: className, } = Astro.props; ---

{title}

Working
{activePrompt}
{steps[0]}
1/{steps.length} · 1s
Queued {queue.length}
    { queue.map((item, idx) => (
  • )) }

↵ to queue · Ctrl ↵ to send now

``` --- # AI model selector > Expandable model pill with four AI models and an adaptive detent effort track that reshapes stops while preserving effort preference. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-model-selector` - File: `src/components/haze/blocks/ai-model-selector.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-model-selector ## Use when - Pairing model selection with model-specific reasoning effort stops inside an AI toolbar - Showing context window and latency metadata alongside an adaptive segmented effort control - Preserving a user's preferred effort rank while smoothly clamping to the nearest valid stop ## Avoid when - Every model shares identical static options without dynamic stop reshaping; use model-picker or segmented-control instead ## Alternatives - [model-picker](https://hazeui.com/blocks/model-picker.md) - [ai-prompt](https://hazeui.com/blocks/ai-prompt.md) - [segmented-control](https://hazeui.com/ui/segmented-control.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-model-selector" | no | Unique prefix for heading and panel aria-controls. | | heading | `string` | "AI model selector" | no | Screen-reader section heading for the model selector. | | models | `{ id: string; name: string; summary: string; stops: string[]; badge?: string }[]` | 4 demo models | no | Model definitions including summary copy and adaptive effort stops. | | initialModel | `string` | "opus" | no | ID of the initially active model. | | initialEffort | `string` | "High" | no | Initial effort stop selected on load. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - The pill trigger uses aria-expanded and aria-controls, while both the model list and effort track expose radiogroup and radio semantics. - Model switches and effort stop clamping announce cleanly through a polite role="status" live region. - Key Enter / Space: Expand or collapse the selector panel and select a model or effort stop - Key ArrowLeft / ArrowRight: Step across the active model's effort stops on the detent track ## Agent prompts ### Install and use Install the Haze UI block "AI model selector" with `npx shadcn@latest add @haze/ai-model-selector`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiModelSelector from "@/components/haze/blocks/ai-model-selector.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-model-selector.md ### Customize with real content Adapt the Haze ai-model-selector block for our product. Replace the demo values of these props with our real content: id, heading, models, initialModel, initialEffort, class. Keep the layout, the heading level rules and these accessibility details: The pill trigger uses aria-expanded and aria-controls, while both the model list and effort track expose radiogroup and radio semantics. Model switches and effort stop clamping announce cleanly through a polite role="status" live region. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-model-selector, check it fits: use it when pairing model selection with model-specific reasoning effort stops inside an ai toolbar; showing context window and latency metadata alongside an adaptive segmented effort control; preserving a user's preferred effort rank while smoothly clamping to the nearest valid stop. Avoid it when every model shares identical static options without dynamic stop reshaping; use model-picker or segmented-control instead. Alternatives: @haze/model-picker, @haze/ai-prompt, @haze/segmented-control. ## Example requests that should lead here - Create a compact AI model selector pill with 4 models and an adaptive detent effort slider whose stops change per model - Add a reasoning model picker that remembers preferred effort and clamps smoothly when switching to a 2-stop fast model ## Source ```astro --- import { Check, ChevronUp } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface ModelSpec { id: string; name: string; context?: string; latency?: string; summary: string; stops: string[]; badge?: string; } interface Props { id?: string; heading?: string; models?: ModelSpec[]; initialModel?: string; initialEffort?: string; class?: string; } const { id = "haze-ai-model-selector", heading = "AI model selector", models = [ { id: "opus", name: "Opus 5.5", context: "200k", latency: "Deep", summary: "Most capable, for complex work", stops: ["Low", "Medium", "High", "Max"], }, { id: "sonnet", name: "Sonnet 5.5", context: "200k", latency: "Balanced", summary: "Fast and capable for everyday tasks", stops: ["Low", "Medium", "High"], }, { id: "haiku", name: "Haiku 5.5", context: "200k", latency: "Instant", summary: "Fastest, for quick answers", stops: ["Fast", "Balanced"], }, { id: "codex", name: "Codex 5.6", context: "128k", latency: "Agentic", summary: "Strong at agentic coding", stops: ["Medium", "High", "Max"], badge: "C", }, ], initialModel = "opus", initialEffort = "High", class: className, } = Astro.props; const activeModel = models.find((m) => m.id === initialModel) ?? models[0]; const activeStopIdx = Math.max( 0, activeModel.stops.findIndex((s) => s.toLowerCase() === initialEffort.toLowerCase()) ); const activeStop = activeModel.stops[activeStopIdx] ?? activeModel.stops[0]; const initialThumbWidth = 100 / activeModel.stops.length; const initialThumbTranslate = activeStopIdx * 100; const effortRank = (stop: string) => { const lower = stop.toLowerCase(); if (lower === "fast" || lower === "low") return 1; if (lower === "balanced" || lower === "medium") return 2; if (lower === "high") return 3; return 4; }; const effortCopy = (stop: string) => { const lower = stop.toLowerCase(); if (lower === "fast" || lower === "low") return "Quickest responses for straightforward questions. Lowest latency."; if (lower === "balanced" || lower === "medium") return "Balanced reasoning depth and speed for everyday tasks."; if (lower === "max") return "Maximum reasoning budget for deep audits and complex architecture."; return "Thinks longer on hard problems. Slower, uses more tokens."; }; const initialBars = effortRank(activeStop); ---

{heading}

{ models.map((m) => { const selected = m.id === activeModel.id; return ( ); }) }
Effort ← → to adjust
{ activeModel.stops.map((stop, idx) => ( )) }

{effortCopy(activeStop)}

``` --- # AI order status > In-chat live delivery tracker with pulsing status badge, three-stage route progress indicator, expandable courier message form, and replay. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-order-status` - File: `src/components/haze/blocks/ai-order-status.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-order-status ## Use when - Answering an order status question inside a support or shopping assistant thread with live ETA telemetry - Showing courier transit stages alongside a quick drop-off message form without leaving the conversation - Demonstrating real-time arrival progression with an interactive Simulate arrival and Replay toggle ## Avoid when - Completing the initial purchase or modifying item quantities before ordering; use ai-checkout - Displaying a static multi-day shipping history log with timestamps; use timeline instead ## Alternatives - [ai-checkout](https://hazeui.com/blocks/ai-checkout.md) - [timeline](https://hazeui.com/ui/timeline.md) - [progress](https://hazeui.com/ui/progress.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-order-status" | no | Unique prefix for section heading and courier message form IDs. | | heading | `string` | "Live order status" | no | Screen-reader section heading for landmark navigation. | | userPrompt | `string` | "Where are my flowers?" | no | User message asking for the delivery update. | | assistantReply | `string` | "They're on the way with Leo. I'll keep this updated." | no | Assistant reply introducing the live delivery card. | | merchant | `string` | "Fern & Petal" | no | Store or restaurant name in the card header. | | orderNumber | `string` | "4821" | no | Order reference shown next to the merchant name. | | etaText | `string` | "Arriving around 2:14 pm" | no | Arrival window text displayed above the ETA minutes. | | etaMinutes | `number` | 11 | no | Estimated minutes remaining before delivery. | | courierName | `string` | "Leo" | no | Assigned courier display name. | | courierInitial | `string` | "L" | no | Single-letter avatar initial for the courier badge. | | courierVehicle | `string` | "Electric bike" | no | Courier transport description. | | quickReplies | `string[]` | 2 quick drop-off chips | no | Suggested one-click instructions inside the courier message form. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - The delivery route bar exposes role="progressbar" with live aria-valuenow updates as the courier moves from 62% transit to 100% delivered. - Message courier uses aria-expanded and aria-controls to manage the expandable drop-off note form, and arrival transitions honor prefers-reduced-motion. - Key Tab: Move between Message courier, quick-reply chips, the message input, and Simulate arrival / Replay - Key Enter / Space: Expand the courier message form, send a drop-off note, or trigger arrival simulation ## Agent prompts ### Install and use Install the Haze UI block "AI order status" with `npx shadcn@latest add @haze/ai-order-status`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiOrderStatus from "@/components/haze/blocks/ai-order-status.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-order-status.md ### Customize with real content Adapt the Haze ai-order-status block for our product. Replace the demo values of these props with our real content: id, heading, userPrompt, assistantReply, merchant, orderNumber, etaText, etaMinutes, courierName, courierInitial, courierVehicle, quickReplies, class. Keep the layout, the heading level rules and these accessibility details: The delivery route bar exposes role="progressbar" with live aria-valuenow updates as the courier moves from 62% transit to 100% delivered. Message courier uses aria-expanded and aria-controls to manage the expandable drop-off note form, and arrival transitions honor prefers-reduced-motion. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-order-status, check it fits: use it when answering an order status question inside a support or shopping assistant thread with live eta telemetry; showing courier transit stages alongside a quick drop-off message form without leaving the conversation; demonstrating real-time arrival progression with an interactive simulate arrival and replay toggle. Avoid it when completing the initial purchase or modifying item quantities before ordering; use ai-checkout; displaying a static multi-day shipping history log with timestamps; use timeline instead. Alternatives: @haze/ai-checkout, @haze/timeline, @haze/progress. ## Example requests that should lead here - Build an AI in-chat order status card with a pulsing Live badge, 3-stage courier progress bar, expandable Message courier form, and Simulate arrival - Add a bouquet delivery tracking bubble in an assistant chat that switches from brand transit styling to success styling upon delivery ## Source ```astro --- import { MessageCircle, Send } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; heading?: string; userPrompt?: string; assistantReply?: string; merchant?: string; orderNumber?: string; etaText?: string; etaMinutes?: number; courierName?: string; courierInitial?: string; courierVehicle?: string; quickReplies?: string[]; class?: string; } const { id = "haze-ai-order-status", heading = "Live order status", userPrompt = "Where are my flowers?", assistantReply = "They're on the way with Leo. I'll keep this updated.", merchant = "Fern & Petal", orderNumber = "4821", etaText = "Arriving around 2:14 pm", etaMinutes = 11, courierName = "Leo", courierInitial = "L", courierVehicle = "Electric bike", quickReplies = ["Leave at front porch", "Ring buzzer 4B"], class: className, } = Astro.props; const parkDots: Array<{ cx: number; cy: number }> = []; for (let row = 0; row < 5; row++) { for (let col = 0; col < 10; col++) { parkDots.push({ cx: 120 + col * 8, cy: 76 + row * 7 }); } } ---

{heading}

{userPrompt}

{assistantReply}

{merchant} · Order {orderNumber}

{etaText}

{etaMinutes} min

{courierName}

{courierVehicle}

``` --- # AI prompt selector > Prompt input with dismissible model promo banner, inline slash commands, removable file chips, model and effort menus, and stream stop. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-prompt` - File: `src/components/haze/blocks/ai-prompt.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-prompt ## Use when - Launching a workspace prompt bar that highlights a featured model alongside command shortcuts - Giving users separate model and reasoning effort controls with file attachments in one composer - Prototyping an interactive AI prompt card with simulated streaming and stop controls ## Avoid when - You need a grounded web search trace with live source citations; use ai-input-search instead - You only need a compact model and effort pill without a full composer; use ai-model-selector instead ## Alternatives - [ai-composer](https://hazeui.com/blocks/ai-composer.md) - [ai-input-search](https://hazeui.com/blocks/ai-input-search.md) - [ai-model-selector](https://hazeui.com/blocks/ai-model-selector.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-prompt" | no | Unique prefix for labels, menus and aria-controls references. | | heading | `string` | "AI prompt selector" | no | Screen-reader section heading for the prompt composer. | | promoText | `string` | "Solstice 5.1 is free this weekend" | no | Announcement copy shown inside the top promo strip. | | promoModel | `string` | "Solstice 5.1" | no | Model selected automatically when activating the Try it button. | | placeholder | `string` | "Ask anything. Type / for commands" | no | Placeholder copy inside the auto-growing textarea. | | models | `{ name: string; note: string }[]` | 4 demo models | no | Models listed in the composer model menu. | | efforts | `string[]` | ["Low", "Medium", "High", "Max"] | no | Reasoning effort levels available in the effort picker. | | commands | `{ name: string; description: string }[]` | 4 slash commands | no | Commands shown when typing / or opening the slash menu. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Slash command, model and effort trays wire aria-expanded and aria-controls to their triggers and close cleanly on Escape. - Model switches, file attachments, promo dismissal and streaming completion announce through a polite role="status" element. - Key /: Open and filter the inline slash-command menu inside the prompt field - Key Escape: Dismiss any open command, model or effort tray - Key Tab / Enter: Navigate toolbar controls, pick options, remove chips or submit the prompt ## Agent prompts ### Install and use Install the Haze UI block "AI prompt selector" with `npx shadcn@latest add @haze/ai-prompt`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiPrompt from "@/components/haze/blocks/ai-prompt.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-prompt.md ### Customize with real content Adapt the Haze ai-prompt block for our product. Replace the demo values of these props with our real content: id, heading, promoText, promoModel, placeholder, models, efforts, commands, class. Keep the layout, the heading level rules and these accessibility details: Slash command, model and effort trays wire aria-expanded and aria-controls to their triggers and close cleanly on Escape. Model switches, file attachments, promo dismissal and streaming completion announce through a polite role="status" element. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-prompt, check it fits: use it when launching a workspace prompt bar that highlights a featured model alongside command shortcuts; giving users separate model and reasoning effort controls with file attachments in one composer; prototyping an interactive ai prompt card with simulated streaming and stop controls. Avoid it when you need a grounded web search trace with live source citations; use ai-input-search instead; you only need a compact model and effort pill without a full composer; use ai-model-selector instead. Alternatives: @haze/ai-composer, @haze/ai-input-search, @haze/ai-model-selector. ## Example requests that should lead here - Build an AI prompt input with a dismissible featured model banner, slash commands, file chips, model and effort pickers - Add a prompt selector card that streams a demo reply and switches the send button to stop while generating ## Source ```astro --- import { ArrowUp, Check, ChevronDown, Plus, Square } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface ModelOption { name: string; note: string; } interface SlashCommand { name: string; description: string; } interface Props { id?: string; heading?: string; promoText?: string; promoModel?: string; placeholder?: string; models?: ModelOption[]; efforts?: string[]; commands?: SlashCommand[]; class?: string; } const { id = "haze-ai-prompt", heading = "AI prompt selector", promoText = "Solstice 5.1 is free this weekend", promoModel = "Solstice 5.1", placeholder = "Ask anything. Type / for commands", models = [ { name: "Opus 5.5", note: "Most capable, for complex work" }, { name: "Sonnet 5.5", note: "Balanced coding and writing" }, { name: "Solstice 5.1", note: "Weekend preview model" }, { name: "Flash 4.0", note: "Fast lightweight replies" }, ], efforts = ["Low", "Medium", "High", "Max"], commands = [ { name: "/summarize", description: "Distill long notes into key decisions" }, { name: "/compare", description: "Contrast two options side by side" }, { name: "/audit", description: "Check code or copy for edge cases" }, { name: "/explain", description: "Break down a concept step by step" }, ], class: className, } = Astro.props; const defaultModel = models[0]?.name ?? "Opus 5.5"; const defaultEffort = efforts[2] ?? efforts[efforts.length - 1] ?? "High"; const defaultEffortBars = Math.max(1, efforts.indexOf(defaultEffort) + 1); ---

{heading}

{promoText}

``` --- # AI prompt redaction > Privacy-aware AI composer with You see and Model sees views, toggleable entity redaction chips, locked secrets and restored replies. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-redact` - File: `src/components/haze/blocks/ai-redact.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-redact ## Use when - Sending customer support or financial prompts to an LLM while keeping PII and API keys redacted - Showing users an interactive You see versus Model sees preview before submitting sensitive data ## Avoid when - Collecting a single password or token field without conversational prompt masking; use password-input - Building a general prompt input without entity detection or redaction controls; use ai-prompt ## Alternatives - [ai-prompt](https://hazeui.com/blocks/ai-prompt.md) - [ai-send](https://hazeui.com/blocks/ai-send.md) - [password-input](https://hazeui.com/ui/password-input.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-redact" | no | Unique prefix for headings and prompt labels. | | title | `string` | "Support assistant" | no | Header title for the privacy-aware composer. | | initialMessage | `string` | Demo support prompt | no | Prefilled message containing sample sensitive entities. | | entities | `RedactEntity[]` | 5 demo entities | no | Detected entities with token names, values and lock state. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - The You see and Model sees controls plus every entity chip expose aria-pressed states, while locked API secrets carry disabled and a clear lock icon. - Mode switches, chip redaction toggles and local reply restoration announce cleanly via a polite role="status" region. - Key Tab: Move across visibility toggle buttons, prompt textarea, redaction chips, Mask all and Send - Key Enter / Space: Switch between You see and Model sees, toggle an entity chip or submit the redacted prompt ## Agent prompts ### Install and use Install the Haze UI block "AI prompt redaction" with `npx shadcn@latest add @haze/ai-redact`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiRedact from "@/components/haze/blocks/ai-redact.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-redact.md ### Customize with real content Adapt the Haze ai-redact block for our product. Replace the demo values of these props with our real content: id, title, initialMessage, entities, class. Keep the layout, the heading level rules and these accessibility details: The You see and Model sees controls plus every entity chip expose aria-pressed states, while locked API secrets carry disabled and a clear lock icon. Mode switches, chip redaction toggles and local reply restoration announce cleanly via a polite role="status" region. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-redact, check it fits: use it when sending customer support or financial prompts to an llm while keeping pii and api keys redacted; showing users an interactive you see versus model sees preview before submitting sensitive data. Avoid it when collecting a single password or token field without conversational prompt masking; use password-input; building a general prompt input without entity detection or redaction controls; use ai-prompt. Alternatives: @haze/ai-prompt, @haze/ai-send, @haze/password-input. ## Example requests that should lead here - Build a privacy-aware AI prompt redaction card with You see and Model sees previews, toggleable PII chips and locked API key masking - Add an LLM composer that previews masked tokens before send and restores real values in the assistant response ## Source ```astro --- import { ArrowUp, CreditCard, KeyRound, Lock, Mail, Phone, ShieldCheck, User } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface RedactEntity { id: string; token: string; value: string; locked?: boolean; masked: boolean; } interface Props { id?: string; title?: string; initialMessage?: string; entities?: RedactEntity[]; class?: string; } const { id = "haze-ai-redact", title = "Support assistant", initialMessage = "Draft a reply to Elena Novak (elena@bracken.io, +41 44 555 0192) confirming the refund to card 4532 8910 2214 4242. The charge failed with key sk_live_94k2m8x1q7, what does that error mean?", entities = [ { id: "ent-person", token: "PERSON_1", value: "Elena Novak", masked: true }, { id: "ent-email", token: "EMAIL_1", value: "elena@bracken.io", masked: true }, { id: "ent-phone", token: "PHONE_1", value: "+41 44 555 0192", masked: true }, { id: "ent-card", token: "CARD_1", value: "4532 8910 2214 4242", masked: true }, { id: "ent-secret", token: "SECRET_1", value: "sk_live_94k2m8x1q7", locked: true, masked: true }, ], class: className, } = Astro.props; const maskedTotal = entities.filter((e) => e.masked || e.locked).length; ---

Names, emails, numbers and keys are swapped for placeholders before anything leaves the browser. Replies are filled back in here.

{initialMessage}
{ entities.map((ent) => ( )) }

{maskedTotal} {maskedTotal === 1 ? "item" : "items"} will be masked. Click one to send it as is.

``` --- # AI meeting scheduler > In-chat meeting slot picker comparing dual calendar availability strips across three openings, booking confirmation, and note entry. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-schedule` - File: `src/components/haze/blocks/ai-schedule.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-schedule ## Use when - Proposing a short list of mutual calendar openings directly inside an AI assistant thread - Showing visual busy blocks for both attendees alongside each highlighted mutual free slot - Confirming a booking inline while letting the user attach an agenda note or reschedule ## Avoid when - Picking from dozens of dates across an entire month; use date-picker or time-slot-picker - Drafting a free-form scheduling email without calendar availability data; use ai-send ## Alternatives - [time-slot-picker](https://hazeui.com/ui/time-slot-picker.md) - [date-picker](https://hazeui.com/ui/date-picker.md) - [ai-send](https://hazeui.com/blocks/ai-send.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-schedule" | no | Unique prefix for radiogroup labels, note form controls, and section IDs. | | heading | `string` | "In-chat meeting scheduler" | no | Screen-reader section heading for landmark navigation. | | userPrompt | `string` | "Find 30 minutes with Priya next week for the roadmap" | no | User prompt asking the assistant to find time. | | assistantReply | `string` | "You're both free at these times. Pick one and I'll send the invite." | no | Assistant reply introducing the candidate time slots. | | durationLabel | `string` | "30 min" | no | Meeting duration label in the card header. | | timezoneLabel | `string` | "Your time · CET" | no | Timezone summary shown on the right of the header. | | attendee | `string` | "Priya Nair" | no | Full attendee name shown in the header and on confirmation. | | attendeeShort | `string` | "Priya" | no | Short row label for the guest availability strip. | | slots | `ScheduleSlot[]` | 3 candidate weekday slots | no | Candidate time slots with calendar badges and busy intervals for You and the guest. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Candidate time slots form a semantic radiogroup with roving tabindex, aria-checked state, and full arrow-key navigation across options. - Decorative availability strips are marked aria-hidden while each radio exposes the exact day and time range, and booking announces confirmation via a polite status region. - Key ArrowUp / ArrowDown / ArrowLeft / ArrowRight: Move selection across the three candidate meeting slots - Key Home / End: Jump to the first or last available meeting slot - Key Tab / Enter: Book the selected day, toggle Add note, save an agenda note, or Reschedule ## Agent prompts ### Install and use Install the Haze UI block "AI meeting scheduler" with `npx shadcn@latest add @haze/ai-schedule`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiSchedule from "@/components/haze/blocks/ai-schedule.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-schedule.md ### Customize with real content Adapt the Haze ai-schedule block for our product. Replace the demo values of these props with our real content: id, heading, userPrompt, assistantReply, durationLabel, timezoneLabel, attendee, attendeeShort, slots, class. Keep the layout, the heading level rules and these accessibility details: Candidate time slots form a semantic radiogroup with roving tabindex, aria-checked state, and full arrow-key navigation across options. Decorative availability strips are marked aria-hidden while each radio exposes the exact day and time range, and booking announces confirmation via a polite status region. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-schedule, check it fits: use it when proposing a short list of mutual calendar openings directly inside an ai assistant thread; showing visual busy blocks for both attendees alongside each highlighted mutual free slot; confirming a booking inline while letting the user attach an agenda note or reschedule. Avoid it when picking from dozens of dates across an entire month; use date-picker or time-slot-picker; drafting a free-form scheduling email without calendar availability data; use ai-send. Alternatives: @haze/time-slot-picker, @haze/date-picker, @haze/ai-send. ## Example requests that should lead here - Create an AI meeting scheduler card with three radio time slots showing dual busy/free calendar strips and a dynamic Book Day button - Add an in-chat calendar availability picker that folds into a confirmed event card with Add note and Reschedule controls ## Source ```astro --- import { Check, FileText, Globe, RotateCcw } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface BusyBlock { start: number; end: number; } interface ScheduleSlot { id: string; dayShort: string; dayLabel: string; month?: string; dayNum?: string; context?: string; timeRange: string; startHour: number; durationHours: number; yourBusy: BusyBlock[]; guestBusy: BusyBlock[]; } interface Props { id?: string; heading?: string; userPrompt?: string; assistantReply?: string; meetingMeta?: string; durationLabel?: string; timezoneLabel?: string; attendee?: string; attendeeShort?: string; slots?: ScheduleSlot[]; class?: string; } const { id = "haze-ai-schedule", heading = "In-chat meeting scheduler", userPrompt = "Find 30 minutes with Priya next week for the roadmap", assistantReply = "You're both free at these times. Pick one and I'll send the invite.", durationLabel = "30 min", timezoneLabel = "Your time · CET", attendee = "Priya Nair", attendeeShort = "Priya", slots = [ { id: "tue", dayShort: "Tue", dayLabel: "Tue Nov 11", month: "NOV", dayNum: "11", context: "Before her 11:00", timeRange: "10:00 – 10:30", startHour: 10, durationHours: 0.5, yourBusy: [ { start: 8.5, end: 9.5 }, { start: 13, end: 14.5 }, ], guestBusy: [ { start: 9, end: 10 }, { start: 11, end: 12 }, { start: 15, end: 16 }, ], }, { id: "wed", dayShort: "Wed", dayLabel: "Wed Nov 12", month: "NOV", dayNum: "12", context: "Open for both", timeRange: "14:30 – 15:00", startHour: 14.5, durationHours: 0.5, yourBusy: [ { start: 9.5, end: 11 }, { start: 12, end: 13.5 }, { start: 15.5, end: 16.5 }, ], guestBusy: [ { start: 9, end: 10.5 }, { start: 11.5, end: 13 }, { start: 15.5, end: 17 }, ], }, { id: "thu", dayShort: "Thu", dayLabel: "Thu Nov 13", month: "NOV", dayNum: "13", context: "End of day for both", timeRange: "16:00 – 16:30", startHour: 16, durationHours: 0.5, yourBusy: [ { start: 9, end: 11 }, { start: 12.5, end: 15 }, ], guestBusy: [ { start: 10, end: 12 }, { start: 13, end: 15.5 }, ], }, ], class: className, } = Astro.props; const dayStart = 8; const daySpan = 9.5; const toPct = (hour: number) => `${Math.max(0, Math.min(100, ((hour - dayStart) / daySpan) * 100)).toFixed(2)}%`; const toWidth = (hours: number) => `${Math.max(1.5, (hours / daySpan) * 100).toFixed(2)}%`; const firstSlot = slots[0]; const parseMonth = (slot: ScheduleSlot) => slot.month ?? (slot.dayLabel.split(" ")[1]?.toUpperCase() || "NOV"); const parseDayNum = (slot: ScheduleSlot) => slot.dayNum ?? (slot.dayLabel.split(" ")[2] || "11"); const parseContext = (slot: ScheduleSlot) => slot.context ?? "Open for both"; ---

{heading}

{userPrompt}

{assistantReply}

{durationLabel} with {attendee}

{ slots.map((slot, index) => { const selected = index === 0; return ( ); }) }

``` --- # AI search bar > Search card with instant filtering and a sample AI answer whose citations jump to the matching results. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-search-bar` - File: `src/components/haze/blocks/ai-search-bar.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-search-bar ## Use when - Prototyping a search experience with an example of how an AI summary can cite matching results - Replacing a plain search modal with a unified Docs, Customers and Issues search card ## Avoid when - You only need a simple navigation command palette without AI synthesis; use command-menu ## Alternatives - [command-menu](https://hazeui.com/ui/command-menu.md) - [ai-answer](https://hazeui.com/blocks/ai-answer.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-search-bar" | no | Unique prefix for search input and result anchors. | | placeholder | `string` | "Search" | no | Search input placeholder. | | hits | `SearchHit[]` | 4 grouped hits | no | Search results with an optional href. Supplying custom hits hides the sample answer. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Numbered citations inside the AI answer move focus directly to the matching search hit below. - Citations can reveal a result excluded by the current filter without clearing the search. - Live match counts and revealed citations are announced in a polite role="status" line. - Key Tab: Move from the search field to the sample answer button, citations, and available result links - Key Enter: Follow a citation or result link - Key Enter / Space: Toggle the sample answer ## Agent prompts ### Install and use Install the Haze UI block "AI search bar" with `npx shadcn@latest add @haze/ai-search-bar`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiSearchBar from "@/components/haze/blocks/ai-search-bar.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-search-bar.md ### Customize with real content Adapt the Haze ai-search-bar block for our product. Replace the demo values of these props with our real content: id, placeholder, hits, class. Keep the layout, the heading level rules and these accessibility details: Numbered citations inside the AI answer move focus directly to the matching search hit below. Citations can reveal a result excluded by the current filter without clearing the search. Live match counts and revealed citations are announced in a polite role="status" line. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-search-bar, check it fits: use it when prototyping a search experience with an example of how an ai summary can cite matching results; replacing a plain search modal with a unified docs, customers and issues search card. Avoid it when you only need a simple navigation command palette without ai synthesis; use command-menu. Alternatives: @haze/command-menu, @haze/ai-answer. ## Example requests that should lead here - Build a workspace search bar with instant filtering and a sample answer that links to cited results ## Source ```astro --- import { FileText, Search, Sparkles, Tag, Users } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface SearchHit { id: number; group: "Docs" | "Customers" | "Issues"; title: string; meta: string; href?: string; } interface Props { id?: string; placeholder?: string; hits?: SearchHit[]; class?: string; } const demoHits: SearchHit[] = [ { id: 1, group: "Docs", title: "Webhook signature verification", meta: "Security · Updated 2d ago" }, { id: 2, group: "Docs", title: "Retrying failed delivery attempts", meta: "API reference · 4 min read" }, { id: 3, group: "Customers", title: "Tidewell Logistics", meta: "Enterprise · 120 seats · EU-West" }, { id: 4, group: "Issues", title: "ENG-482: Webhook timeout on burst imports", meta: "In progress · Assigned to Marco" }, ]; const { id = "haze-ai-search-bar", placeholder = "Search", hits = demoHits, class: className, } = Astro.props; const showExample = hits === demoHits; ---

Hybrid workspace search

{showExample && }
{showExample &&

Webhooks verify HMAC-SHA256 signatures before retrying up to 5 times with exponential backoff 1 2. Active burst-import timeouts are tracked under ENG-482 4.

}
    { hits.map((hit) => { const Result = hit.href ? "a" : "div"; return (
  • {hit.title} {hit.meta} [{hit.id}] {hit.group}
  • ); }) }

{hits.length ? `Showing ${hits.length} workspace ${hits.length === 1 ? "match" : "matches"}` : "No workspace matches"}

``` --- # AI send with undo > In-chat editable email draft with 5-second countdown progress bar, Undo cancellation, and collapsible sent confirmation row. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-send` - File: `src/components/haze/blocks/ai-send.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-send ## Use when - Letting users review and edit an AI-drafted email inside a conversation before it goes out - Providing a visible grace period with an Undo button to prevent accidental outbound messages - Collapsing a completed email draft into a clean single-row delivery confirmation ## Avoid when - Offering an undo action for a generic page-level mutation outside chat; use undo-toast - Composing rich multi-attachment threads or inbox replies; build a dedicated mail composer ## Alternatives - [undo-toast](https://hazeui.com/ui/undo-toast.md) - [ai-checkout](https://hazeui.com/blocks/ai-checkout.md) - [ai-schedule](https://hazeui.com/blocks/ai-schedule.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-send" | no | Unique prefix for field label associations and heading IDs. | | heading | `string` | "Email draft with undo" | no | Screen-reader section heading for landmark navigation. | | userPrompt | `string` | "Let Devon know the launch review moved to Thursday at 2" | no | User message requesting the email draft. | | assistantReply | `string` | "Here's a draft. Change anything you like before it goes." | no | Assistant reply introducing the editable email card. | | recipient | `string` | "Devon Park " | no | Initial value for the editable To input. | | subject | `string` | "Launch review moved to Thursday" | no | Initial value for the editable Subject input. | | body | `string` | "Hi Devon, ..." | no | Initial message content for the editable textarea. | | sender | `string` | "nora@kiteworks.io" | no | Sender email address displayed in the draft footer. | | undoSeconds | `number` | 5 | no | Duration in seconds for the undo countdown window. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - The To, Subject, and Message inputs carry explicit label elements, and pressing Send moves keyboard focus directly to the Undo button during the countdown. - Countdown progress exposes role="progressbar" with live aria-valuenow updates and switches to discrete one-second steps when prefers-reduced-motion is active. - Key Tab: Move through To, Subject, Message fields, Send, Undo during countdown, and Draft again after delivery - Key Enter / Space: Start the send countdown, cancel delivery with Undo, or reopen the draft ## Agent prompts ### Install and use Install the Haze UI block "AI send with undo" with `npx shadcn@latest add @haze/ai-send`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiSend from "@/components/haze/blocks/ai-send.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-send.md ### Customize with real content Adapt the Haze ai-send block for our product. Replace the demo values of these props with our real content: id, heading, userPrompt, assistantReply, recipient, subject, body, sender, undoSeconds, class. Keep the layout, the heading level rules and these accessibility details: The To, Subject, and Message inputs carry explicit label elements, and pressing Send moves keyboard focus directly to the Undo button during the countdown. Countdown progress exposes role="progressbar" with live aria-valuenow updates and switches to discrete one-second steps when prefers-reduced-motion is active. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-send, check it fits: use it when letting users review and edit an ai-drafted email inside a conversation before it goes out; providing a visible grace period with an undo button to prevent accidental outbound messages; collapsing a completed email draft into a clean single-row delivery confirmation. Avoid it when offering an undo action for a generic page-level mutation outside chat; use undo-toast; composing rich multi-attachment threads or inbox replies; build a dedicated mail composer. Alternatives: @haze/undo-toast, @haze/ai-checkout, @haze/ai-schedule. ## Example requests that should lead here - Create an AI in-chat email draft card with editable To, Subject, and body fields plus a 5-second Undo countdown before sending - Build an assistant outbound message approval block that folds into a Sent confirmation row with a Draft again button ## Source ```astro --- import { Check, Mail, RotateCcw, Send, Undo2 } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; heading?: string; userPrompt?: string; assistantReply?: string; recipient?: string; subject?: string; body?: string; sender?: string; undoSeconds?: number; class?: string; } const { id = "haze-ai-send", heading = "Email draft with undo", userPrompt = "Let Devon know the launch review moved to Thursday at 2", assistantReply = "Here's a draft. Change anything you like before it goes.", recipient = "Devon Park ", subject = "Launch review moved to Thursday", body = "Hi Devon,\n\nQuick heads up: the launch review is now Thursday at 2pm, same room. QA needs the extra day to finish the final sweep.\n\nThanks,\nNora", sender = "nora@kiteworks.io", undoSeconds = 5, class: className, } = Astro.props; const safeSeconds = Math.max(2, Math.min(15, Math.round(undoSeconds))); ---

{heading}

{userPrompt}

{assistantReply}

``` --- # AI setup wizard > Three-step onboarding card for launching workspace AI Q&A: connect sources, configure guardrails and verify a cited test answer. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-setup-wizard` - File: `src/components/haze/blocks/ai-setup-wizard.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-setup-wizard ## Use when - Guiding workspace admins through connecting knowledge sources and setting confidence guardrails - Letting teams test a live cited answer before publishing an AI feature ## Avoid when - You only need a single-step feature announcement banner; use ai-feature-launch ## Alternatives - [stepper](https://hazeui.com/ui/stepper.md) - [ai-feature-launch](https://hazeui.com/blocks/ai-feature-launch.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-setup-wizard" | no | Unique prefix for form labels and heading IDs. | | title | `string` | "Launch workspace AI Q&A" | no | Wizard heading. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Step buttons mark the active stage with aria-current="step" and announce transitions in a polite role="status" footer. - Every connector toggle, model selector and guardrail checkbox uses a native form control with an explicit label. - Key Tab: Move across step tabs, step form controls, Back and Continue buttons - Key Enter / Space: Jump to a step, toggle connectors or publish the Q&A assistant ## Agent prompts ### Install and use Install the Haze UI block "AI setup wizard" with `npx shadcn@latest add @haze/ai-setup-wizard`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiSetupWizard from "@/components/haze/blocks/ai-setup-wizard.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-setup-wizard.md ### Customize with real content Adapt the Haze ai-setup-wizard block for our product. Replace the demo values of these props with our real content: id, title, class. Keep the layout, the heading level rules and these accessibility details: Step buttons mark the active stage with aria-current="step" and announce transitions in a polite role="status" footer. Every connector toggle, model selector and guardrail checkbox uses a native form control with an explicit label. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-setup-wizard, check it fits: use it when guiding workspace admins through connecting knowledge sources and setting confidence guardrails; letting teams test a live cited answer before publishing an ai feature. Avoid it when you only need a single-step feature announcement banner; use ai-feature-launch. Alternatives: @haze/stepper, @haze/ai-feature-launch. ## Example requests that should lead here - Add a 3-step AI setup wizard to connect Notion/Drive sources, set model guardrails and test a cited answer ## Source ```astro --- import { ArrowLeft, ArrowRight, Check, Database, Rocket, Sliders, Sparkles } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; title?: string; class?: string; } const { id = "haze-ai-setup-wizard", title = "Launch workspace AI Q&A", class: className, } = Astro.props; const connectors = [ { id: "notion", name: "Notion", detail: "1,240 pages synced", connected: true }, { id: "drive", name: "Google Drive", detail: "380 docs synced", connected: true }, { id: "confluence", name: "Confluence", detail: "Ready to connect", connected: false }, { id: "zendesk", name: "Zendesk", detail: "Ready to connect", connected: false }, ]; ---

{title}

Connect knowledge, set guardrails, and test a live cited answer.

    { [ [0, "1. Sources"], [1, "2. Guardrails"], [2, "3. Test"], ].map(([idx, label]) => (
  1. )) }

{ connectors.map((c) => ( )) }

Step 1 of 3 · Select sources

``` --- # AI side panel > Docked page-assistant sidebar alongside a document that surfaces quick prompts, word-level diffs, one-click apply and undo. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-side-panel` - File: `src/components/haze/blocks/ai-side-panel.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-side-panel ## Use when - Pairing a document or canvas with an AI sidebar that proposes targeted edits - Showing word-level insertions and deletions before applying changes to page text ## Avoid when - Editing strictly inline inside a selection popover with ghost text; use ai-inline-edit ## Alternatives - [drawer](https://hazeui.com/ui/drawer.md) - [ai-chat](https://hazeui.com/blocks/ai-chat.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-side-panel" | no | Unique prefix for section heading IDs. | | docTitle | `string` | "Q4 launch announcement" | no | Heading of the document pane. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Proposed word-level changes use semantic del and ins elements in addition to status colors. - Applying or undoing an edit updates the document paragraph in place and announces the change via role="status". - Key Tab: Move across quick-action presets, Apply to page and Undo buttons - Key Enter / Space: Preview a rewrite preset, apply the diff to the document or undo it ## Agent prompts ### Install and use Install the Haze UI block "AI side panel" with `npx shadcn@latest add @haze/ai-side-panel`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiSidePanel from "@/components/haze/blocks/ai-side-panel.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-side-panel.md ### Customize with real content Adapt the Haze ai-side-panel block for our product. Replace the demo values of these props with our real content: id, docTitle, class. Keep the layout, the heading level rules and these accessibility details: Proposed word-level changes use semantic del and ins elements in addition to status colors. Applying or undoing an edit updates the document paragraph in place and announces the change via role="status". Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-side-panel, check it fits: use it when pairing a document or canvas with an ai sidebar that proposes targeted edits; showing word-level insertions and deletions before applying changes to page text. Avoid it when editing strictly inline inside a selection popover with ghost text; use ai-inline-edit. Alternatives: @haze/drawer, @haze/ai-chat. ## Example requests that should lead here - Build a split document and docked AI side panel with word-level diff preview, Apply and Undo buttons ## Source ```astro --- import { Check, RotateCcw, Sparkles, Wand2 } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; docTitle?: string; class?: string; } const { id = "haze-ai-side-panel", docTitle = "Q4 launch announcement", class: className, } = Astro.props; ---

Document · Draft

{docTitle}

This release introduces native Astro islands for every marketing and dashboard section, eliminating redundant client frameworks.

Teams can now install components directly into their codebase without having to worry about runtime overhead or vendor lock-in issues at all.

Every entry ships with token-based dark styles, accessible keyboard patterns, and machine-readable Markdown docs for coding agents.

``` --- # AI text loading > Minimal centered AI thinking status text that cycles phrases with a per-character luminance wave and optional elapsed seconds readout. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-text-loading` - File: `src/components/haze/blocks/ai-text-loading.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-text-loading ## Use when - Displaying a lightweight live thinking phrase while an AI reply is being prepared - Replacing raw spinner rings with human-readable status cues that cycle through synthesis stages ## Avoid when - Users need an expandable list of timed tool calls and execution logs; use ai-loading instead - A compact inline loading indicator inside a button is needed; use spinner ## Alternatives - [text-shimmer](https://hazeui.com/ui/text-shimmer.md) - [ai-loading](https://hazeui.com/blocks/ai-loading.md) - [spinner](https://hazeui.com/ui/spinner.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-text-loading" | no | Unique prefix for the section landmark heading ID. | | heading | `string` | "Assistant thinking status" | no | Screen-reader landmark heading for the loading status region. | | phrases | `string[]` | 4 demo thinking phrases | no | Ordered status phrases cycled with a per-character token luminance wave. | | showElapsed | `boolean` | false | no | Shows a subtle live elapsed seconds readout beside the cycling phrase. | | intervalMs | `number` | 2400 | no | Duration in milliseconds before advancing to the next phrase. | | class | `string` | | no | Extra classes applied to the outer section. | ## Accessibility - Per-character visual spans carry aria-hidden="true" so assistive technology reads clean whole phrases from the polite role="status" region. - Honors prefers-reduced-motion by disabling the character luminance wave and switching cleanly between whole phrases. - Key Tab: Passes cleanly past the non-interactive status indicator without trapping focus ## Agent prompts ### Install and use Install the Haze UI block "AI text loading" with `npx shadcn@latest add @haze/ai-text-loading`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiTextLoading from "@/components/haze/blocks/ai-text-loading.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-text-loading.md ### Customize with real content Adapt the Haze ai-text-loading block for our product. Replace the demo values of these props with our real content: id, heading, phrases, showElapsed, intervalMs, class. Keep the layout, the heading level rules and these accessibility details: Per-character visual spans carry aria-hidden="true" so assistive technology reads clean whole phrases from the polite role="status" region. Honors prefers-reduced-motion by disabling the character luminance wave and switching cleanly between whole phrases. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-text-loading, check it fits: use it when displaying a lightweight live thinking phrase while an ai reply is being prepared; replacing raw spinner rings with human-readable status cues that cycle through synthesis stages. Avoid it when users need an expandable list of timed tool calls and execution logs; use ai-loading instead; a compact inline loading indicator inside a button is needed; use spinner. Alternatives: @haze/text-shimmer, @haze/ai-loading, @haze/spinner. ## Example requests that should lead here - Add a minimal borderless AI text loading block that sweeps foreground luminance across cycling thinking phrases ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; heading?: string; phrases?: string[]; showElapsed?: boolean; intervalMs?: number; class?: string; } const { id = "haze-ai-text-loading", heading = "Assistant thinking status", phrases = [ "Thinking…", "Processing…", "Analyzing…", "Drafting…", ], showElapsed = false, intervalMs = 2400, class: className, } = Astro.props; const initialPhrase = phrases[0] ?? "Thinking…"; ---

{heading}

{ showElapsed && ( 0.0s ) }

{initialPhrase}

``` --- # AI token alternatives > Compact chat card marking uncertain tokens with dotted underlines, a probability popover for downstream rewrites and a confidence switch. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-token-alternatives` - File: `src/components/haze/blocks/ai-token-alternatives.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-token-alternatives ## Use when - Exposing token-level model uncertainty so editors can inspect alternative phrasing without regenerating an entire reply - Building interactive writing or scheduling assistants where one word choice branches the remainder of the response ## Avoid when - Users need full sentence-to-source attribution links rather than token probabilities; use ai-citations instead - Comparing completely separate parallel assistant drafts side by side; use ai-branches ## Alternatives - [ai-citations](https://hazeui.com/blocks/ai-citations.md) - [ai-branches](https://hazeui.com/blocks/ai-branches.md) - [ai-inline-rewrite](https://hazeui.com/blocks/ai-inline-rewrite.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-token-alternatives" | no | Unique prefix for landmark heading, popover and switch ARIA IDs. | | heading | `string` | "Assistant reply with alternative tokens" | no | Screen-reader landmark heading for the chat card. | | prompt | `string` | Launch review scheduling prompt | no | User prompt displayed in the right-aligned bubble above the assistant reply. | | class | `string` | | no | Extra classes applied to the outer section. | ## Accessibility - Uncertain tokens are native buttons with aria-expanded and aria-controls linked to the candidate popover, which dismisses on Escape. - The Confidence toggle uses role="switch" with aria-checked, and token swaps are announced politely in a role="status" live region. - Key Tab: Move across dotted token buttons, candidate alternatives and the Confidence switch - Key Enter / Space: Open candidate alternatives, swap a token to rewrite downstream or toggle confidence percentages - Key Escape: Close the open token alternatives popover and return focus to the active word button ## Agent prompts ### Install and use Install the Haze UI block "AI token alternatives" with `npx shadcn@latest add @haze/ai-token-alternatives`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiTokenAlternatives from "@/components/haze/blocks/ai-token-alternatives.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-token-alternatives.md ### Customize with real content Adapt the Haze ai-token-alternatives block for our product. Replace the demo values of these props with our real content: id, heading, prompt, class. Keep the layout, the heading level rules and these accessibility details: Uncertain tokens are native buttons with aria-expanded and aria-controls linked to the candidate popover, which dismisses on Escape. The Confidence toggle uses role="switch" with aria-checked, and token swaps are announced politely in a role="status" live region. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-token-alternatives, check it fits: use it when exposing token-level model uncertainty so editors can inspect alternative phrasing without regenerating an entire reply; building interactive writing or scheduling assistants where one word choice branches the remainder of the response. Avoid it when users need full sentence-to-source attribution links rather than token probabilities; use ai-citations instead; comparing completely separate parallel assistant drafts side by side; use ai-branches. Alternatives: @haze/ai-citations, @haze/ai-branches, @haze/ai-inline-rewrite. ## Example requests that should lead here - Add an AI token alternatives chat card with subtle dotted uncertain words, a candidate probability popover and a Confidence switch footer ## Source ```astro --- import { X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; heading?: string; prompt?: string; class?: string; } const { id = "haze-ai-token-alternatives", heading = "Assistant reply with alternative tokens", prompt = "Alex wants to push the launch review. Can you draft a quick reply?", class: className, } = Astro.props; ---

{heading}

{prompt}

, works better for me, and it leaves time to share a partner checklist before sign-off.

Click a dotted word to swap it

``` --- # AI tool approval > Inline chat tool approval card with standard Allow/Deny controls, session trust toggle, press-and-hold destructive guard and trace fold. - Kind: block · Category: Agents · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-tool-approval` - File: `src/components/haze/blocks/ai-tool-approval.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-tool-approval ## Use when - Gating a single agent command inside an active chat turn before execution - Adding a press-and-hold safeguard on destructive SQL or shell operations while keeping routine calls quick - Folding resolved approvals into a compact expandable output trace ## Avoid when - Reviewing a multi-item backlog of approvals across several background agents; use agent-approvals - Confirming a standalone non-chat action outside an assistant conversation; use hold-to-confirm ## Alternatives - [agent-approvals](https://hazeui.com/blocks/agent-approvals.md) - [hold-to-confirm](https://hazeui.com/ui/hold-to-confirm.md) - [ai-tool-calls](https://hazeui.com/blocks/ai-tool-calls.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-tool-approval" | no | Unique prefix for heading, checkbox and hint IDs. | | heading | `string` | "Inline tool approval" | no | Card header title. | | standardScenario | `ApprovalScenario` | bash test suite command | no | Default non-destructive tool call scenario. | | destructiveScenario | `ApprovalScenario` | SQL DROP TABLE command | no | Destructive tool call scenario guarded by press-and-hold. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - The destructive hold button supports pointer press, holding Space or Enter, Escape to cancel, instant completion under reduced motion and an explicit secondary confirm disclosure. - Mode switches, approval decisions and resets announce concise updates through a polite role="status" live region. - Key Tab: Move across mode buttons, trust checkbox, Deny, Allow or hold confirmation and Reset - Key Space / Enter (hold): Fill and confirm the destructive tool approval button - Key Escape: Cancel an active keyboard hold before completion ## Agent prompts ### Install and use Install the Haze UI block "AI tool approval" with `npx shadcn@latest add @haze/ai-tool-approval`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiToolApproval from "@/components/haze/blocks/ai-tool-approval.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-tool-approval.md ### Customize with real content Adapt the Haze ai-tool-approval block for our product. Replace the demo values of these props with our real content: id, heading, standardScenario, destructiveScenario, class. Keep the layout, the heading level rules and these accessibility details: The destructive hold button supports pointer press, holding Space or Enter, Escape to cancel, instant completion under reduced motion and an explicit secondary confirm disclosure. Mode switches, approval decisions and resets announce concise updates through a polite role="status" live region. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-tool-approval, check it fits: use it when gating a single agent command inside an active chat turn before execution; adding a press-and-hold safeguard on destructive sql or shell operations while keeping routine calls quick; folding resolved approvals into a compact expandable output trace. Avoid it when reviewing a multi-item backlog of approvals across several background agents; use agent-approvals; confirming a standalone non-chat action outside an assistant conversation; use hold-to-confirm. Alternatives: @haze/agent-approvals, @haze/hold-to-confirm, @haze/ai-tool-calls. ## Example requests that should lead here - Build an inline AI tool approval card inside a chat turn with standard Allow/Deny and a press-and-hold destructive SQL guard - Create an agent permission prompt that folds into an expandable command output trace once approved or denied ## Source ```astro --- import { Check, ChevronDown, Database, Lock, RotateCcw, Terminal, X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface ApprovalScenario { id: string; label: string; prompt: string; title: string; tool: string; command: string; rationale: string; destructive: boolean; output: string; } interface Props { id?: string; heading?: string; standardScenario?: ApprovalScenario; destructiveScenario?: ApprovalScenario; class?: string; } const { id = "haze-ai-tool-approval", heading = "Tool approval", standardScenario = { id: "standard", label: "Standard example", prompt: "Run the billing test suite before we tag the release.", title: "Run a command", tool: "bash", command: "pnpm test --filter billing", rationale: "Check the billing tests before changing the invoice form.", destructive: false, output: "PASS packages/billing/invoice.spec.ts (48 passed, 0 failed) · 1.24s", }, destructiveScenario = { id: "destructive", label: "Destructive example", prompt: "Clear out the old staging invoices table before seeding.", title: "Drop staging table", tool: "sql", command: "DROP TABLE staging_invoices;", rationale: "Permanently deletes 14,280 rows with no automatic rollback snapshot.", destructive: true, output: "DROP TABLE — staging_invoices removed (14,280 rows deleted) · 0.18s", }, class: className, } = Astro.props; ---

{heading}

{/* Standard approval view */}

{standardScenario.title}

{standardScenario.tool}
$ {standardScenario.command}

{standardScenario.rationale}

{/* Destructive approval view */} {/* Folded 1-line trace after a decision */}

``` --- # AI tool calls > Sequential chat tool-call trace with live per-step timers that collapses into a summary row above the final recommendation. - Kind: block · Category: Agents · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-tool-calls` - File: `src/components/haze/blocks/ai-tool-calls.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-tool-calls ## Use when - Streaming multi-step search, availability or filter tool calls inside an assistant reply - Collapsing finished tool logs into a single expandable summary line once the final answer arrives - Letting users inspect individual tool timings or replay the full execution sequence ## Avoid when - Pausing execution to request human permission before a tool runs; use ai-tool-approval - Showing an indeterminate loading shimmer without discrete tool steps; use ai-loading ## Alternatives - [ai-loading](https://hazeui.com/blocks/ai-loading.md) - [ai-tool-approval](https://hazeui.com/blocks/ai-tool-approval.md) - [agent-run](https://hazeui.com/blocks/agent-run.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-tool-calls" | no | Unique prefix for section heading IDs. | | heading | `string` | "Streaming tool calls" | no | Card header title. | | userPrompt | `string` | "Find a quiet boutique hotel in Porto for Nov 14–16 under €200" | no | User question displayed above the tool trace. | | steps | `ToolCallStep[]` | 3 sequential hotel search steps | no | Ordered tool calls with labels, queries, durations and summary results. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Tool traces live inside a native details disclosure so keyboard and screen-reader users can expand or collapse finished steps at any time. - Reduced-motion preferences skip intermediate timer frames and settle immediately into the completed summary while announcing completion via role="status". - Key Tab: Move between the Replay button and the expandable tool summary header - Key Enter / Space: Toggle the tool-call trace list or replay the streaming sequence ## Agent prompts ### Install and use Install the Haze UI block "AI tool calls" with `npx shadcn@latest add @haze/ai-tool-calls`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiToolCalls from "@/components/haze/blocks/ai-tool-calls.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-tool-calls.md ### Customize with real content Adapt the Haze ai-tool-calls block for our product. Replace the demo values of these props with our real content: id, heading, userPrompt, steps, class. Keep the layout, the heading level rules and these accessibility details: Tool traces live inside a native details disclosure so keyboard and screen-reader users can expand or collapse finished steps at any time. Reduced-motion preferences skip intermediate timer frames and settle immediately into the completed summary while announcing completion via role="status". Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-tool-calls, check it fits: use it when streaming multi-step search, availability or filter tool calls inside an assistant reply; collapsing finished tool logs into a single expandable summary line once the final answer arrives; letting users inspect individual tool timings or replay the full execution sequence. Avoid it when pausing execution to request human permission before a tool runs; use ai-tool-approval; showing an indeterminate loading shimmer without discrete tool steps; use ai-loading. Alternatives: @haze/ai-loading, @haze/ai-tool-approval, @haze/agent-run. ## Example requests that should lead here - Create an AI tool calls trace inside a chat reply that streams three hotel search tools with live timers and folds into a summary - Build a collapsible assistant tool execution panel with a Replay button and a final recommendation card ## Source ```astro --- import { Calendar, Check, ChevronDown, LoaderCircle, RotateCcw, Search, SlidersHorizontal } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface ToolCallStep { id: string; label: string; detail: string; durationMs: number; result: string; icon: "search" | "calendar" | "filter"; } interface Props { id?: string; heading?: string; userPrompt?: string; steps?: ToolCallStep[]; class?: string; } const { id = "haze-ai-tool-calls", heading = "Streaming tool calls", userPrompt = "Find a quiet boutique hotel in Porto for Nov 14–16, under €200", steps = [ { id: "listings", label: "Searching listings", detail: "quiet hotels Ribeira Porto", durationMs: 800, result: "18 properties matched", icon: "search", }, { id: "availability", label: "Checking availability", detail: "Nov 14–16 · 2 nights", durationMs: 900, result: "6 rooms under €200", icon: "calendar", }, { id: "reviews", label: "Filtering reviews", detail: "noise score & transit", durationMs: 700, result: "3 quiet stays ranked", icon: "filter", }, ], class: className, } = Astro.props; const totalSec = (steps.reduce((acc, s) => acc + s.durationMs, 0) / 1000).toFixed(1); ---

{heading}

{/* User bubble */}

{userPrompt}

{/* Borderless vertical stem tool trace */}
Used {steps.length} tools · {totalSec}s
    { steps.map((step) => (
  1. {step.label} {step.detail}
    {(step.durationMs / 1000).toFixed(1)}s
  2. )) }
{/* Clean borderless assistant reply */}

Casa do Miradouro in Cedofeita is the quietest match for Nov 14–16 at €178/night (€356 total). Guests rate it 9.4 for quietness thanks to its double-glazed courtyard rooms, and it is a seven-minute walk from the Ribeira tram with free cancellation.

``` --- # AI voice input > Minimal floating voice capture control with circular record toggle, tabular timer, 48-tick waveform rail and playback review controls. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/ai-voice` - File: `src/components/haze/blocks/ai-voice.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/ai-voice ## Use when - Capturing short spoken prompts or voice memos inside an AI assistant card - Letting users review, play back, discard or send a recorded clip before transcription - Demonstrating a calm voice input workflow that degrades cleanly under reduced motion ## Avoid when - Users primarily type long structured prompts with files and slash commands; use ai-prompt instead ## Alternatives - [ai-prompt](https://hazeui.com/blocks/ai-prompt.md) - [ai-composer](https://hazeui.com/blocks/ai-composer.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-ai-voice" | no | Unique prefix for the section heading reference. | | heading | `string` | "AI voice input" | no | Heading displayed at the top of the voice capture card. | | sampleTranscript | `string` | "Remind the platform team to rotate staging webhook keys before Friday's deploy window." | no | Demo transcript rendered in the sent voice note chip. | | maxDurationSeconds | `number` | 60 | no | Maximum recording duration in seconds before auto-stopping to review. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - The microphone button updates aria-label and aria-pressed as capture moves from idle to recording to review. - Waveform animation stops under prefers-reduced-motion while preserving static bar levels, timer updates and polite role="status" announcements. - Key Space / Enter: Start or stop recording, toggle playback review, discard or send the voice note - Key Tab: Move between the record button, review toolbar actions and sent transcript dismiss button ## Agent prompts ### Install and use Install the Haze UI block "AI voice input" with `npx shadcn@latest add @haze/ai-voice`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiVoice from "@/components/haze/blocks/ai-voice.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/ai-voice.md ### Customize with real content Adapt the Haze ai-voice block for our product. Replace the demo values of these props with our real content: id, heading, sampleTranscript, maxDurationSeconds, class. Keep the layout, the heading level rules and these accessibility details: The microphone button updates aria-label and aria-pressed as capture moves from idle to recording to review. Waveform animation stops under prefers-reduced-motion while preserving static bar levels, timer updates and polite role="status" announcements. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using ai-voice, check it fits: use it when capturing short spoken prompts or voice memos inside an ai assistant card; letting users review, play back, discard or send a recorded clip before transcription; demonstrating a calm voice input workflow that degrades cleanly under reduced motion. Avoid it when users primarily type long structured prompts with files and slash commands; use ai-prompt instead. Alternatives: @haze/ai-prompt, @haze/ai-composer. ## Example requests that should lead here - Add an AI voice input card with a record button, tabular timer, 24-bar waveform and play, discard, send review controls - Create a centered voice memo recorder that displays a simulated transcript chip when sent ## Source ```astro --- import { Mic, Pause, Play, Send, Square, Trash, Volume2, X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; heading?: string; sampleTranscript?: string; maxDurationSeconds?: number; class?: string; } const { id = "haze-ai-voice", heading = "AI voice input", sampleTranscript = "Remind the platform team to rotate staging webhook keys before Friday's deploy window.", maxDurationSeconds = 60, class: className, } = Astro.props; const barCount = 48; ---

{heading}

00:00

Click to speak

``` --- # App sidebar > Application shell with collapsible desktop icon rail and switchable workspace, mail inbox, and documentation navigation modes. - Kind: block · Category: App shell · Interactivity: script - Install: `npx shadcn@latest add @haze/app-sidebar` - File: `src/components/haze/blocks/app-sidebar.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/app-sidebar ## Use when - Scaffolding a SaaS app layout whose sidebar collapses cleanly into a compact icon rail - Switching between workspace, mail inbox, and documentation tree navigation structures ## Avoid when - You only need a standalone vertical nav list without an app canvas; use sidebar ## Alternatives - [sidebar](https://hazeui.com/ui/sidebar.md) - [navigation-menu](https://hazeui.com/ui/navigation-menu.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-app-sidebar" | no | Unique prefix for navigation anchors and heading IDs. | | workspace | `string` | "Tidewell Studio" | no | Workspace title shown at the top of the rail. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - The collapse toggle exposes aria-pressed and announces rail state changes through a polite role="status" region. - Mode tabs use role="tab" with aria-selected while each mode renders its own labelled nav landmark. - Key Tab: Move across mode tabs, rail collapse toggle and navigation links - Key Enter / Space: Switch shell navigation mode or collapse/expand the sidebar rail ## Agent prompts ### Install and use Install the Haze UI block "App sidebar" with `npx shadcn@latest add @haze/app-sidebar`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AppSidebar from "@/components/haze/blocks/app-sidebar.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/app-sidebar.md ### Customize with real content Adapt the Haze app-sidebar block for our product. Replace the demo values of these props with our real content: id, workspace, class. Keep the layout, the heading level rules and these accessibility details: The collapse toggle exposes aria-pressed and announces rail state changes through a polite role="status" region. Mode tabs use role="tab" with aria-selected while each mode renders its own labelled nav landmark. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using app-sidebar, check it fits: use it when scaffolding a saas app layout whose sidebar collapses cleanly into a compact icon rail; switching between workspace, mail inbox, and documentation tree navigation structures. Avoid it when you only need a standalone vertical nav list without an app canvas; use sidebar. Alternatives: @haze/sidebar, @haze/navigation-menu. ## Example requests that should lead here - Add an app shell sidebar block that collapses into an icon rail and switches between Workspace, Mail and Docs nav ## Source ```astro --- import { BookOpen, ChevronsLeft, ChevronsRight, FolderKanban, Home, Inbox, Mail, Settings, Users } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; workspace?: string; class?: string; } const { id = "haze-app-sidebar", workspace = "Tidewell Studio", class: className, } = Astro.props; const modes = [ { id: "workspace", label: "Workspace", items: ["Overview", "Projects", "Members", "Settings"] }, { id: "mail", label: "Mail", items: ["Inbox (12)", "Starred", "Sent", "Archive"] }, { id: "docs", label: "Docs", items: ["Getting started", "Tokens", "Components", "API"] }, ] as const; ---

Application sidebar shell

{ modes.map((m, i) => ( )) }

Workspace overview

Collapse the sidebar into an icon rail on desktop or switch between workspace, mail, and documentation navigation modes.

``` --- # Login and sign up > Sign-in and sign-up demo with sample provider buttons, an email field, and a six-digit code step. - Kind: block · Category: Auth · Interactivity: script - Install: `npx shadcn@latest add @haze/auth-login` - File: `src/components/haze/blocks/auth-login.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/logo-mark, @haze/utils - Docs page: https://hazeui.com/blocks/auth-login ## Use when - Prototyping sign-in and sign-up modes in one compact card - Demonstrating the transition from email entry to a six-digit code field ## Avoid when - Authenticating or enrolling users in a live service - You only need a simple static password sign-in form; use auth-sign-in-card ## Alternatives - [auth-sign-in-card](https://hazeui.com/blocks/auth-sign-in-card.md) - [otp-input](https://hazeui.com/ui/otp-input.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-auth-login" | no | Unique prefix for form labels and heading IDs. | | brand | `string` | "Haze UI" | no | Wordmark text shown beside the Haze logo. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Sign in and Sign up buttons expose aria-pressed and reveal the Full name field in sign-up mode. - Submitting the email step moves focus to the demo code field. Invalid codes are announced and keep focus on the field. - Key Tab: Move across mode buttons, sample provider buttons, and form fields - Key Enter / Space: Activate the focused button. Enter in a form field submits the current step. ## Agent prompts ### Install and use Install the Haze UI block "Login and sign up" with `npx shadcn@latest add @haze/auth-login`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AuthLogin from "@/components/haze/blocks/auth-login.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/auth-login.md ### Customize with real content Adapt the Haze auth-login block for our product. Replace the demo values of these props with our real content: id, brand, class. Keep the layout, the heading level rules and these accessibility details: Sign in and Sign up buttons expose aria-pressed and reveal the Full name field in sign-up mode. Submitting the email step moves focus to the demo code field. Invalid codes are announced and keep focus on the field. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using auth-login, check it fits: use it when prototyping sign-in and sign-up modes in one compact card; demonstrating the transition from email entry to a six-digit code field. Avoid it when authenticating or enrolling users in a live service; you only need a simple static password sign-in form; use auth-sign-in-card. Alternatives: @haze/auth-sign-in-card, @haze/otp-input. ## Example requests that should lead here - Add a sign-in and sign-up demo with sample Google and GitHub buttons and a six-digit code step ## Source ```astro --- import { ArrowRight, KeyRound, Mail } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import LogoMark from "../ui/logo-mark.astro"; interface Props { id?: string; brand?: string; class?: string; } const { id = "haze-auth-login", brand = "Haze UI", class: className } = Astro.props; ---

Sign in with email code

Demo only. Use a sample work email to try the flow.

or continue with email

``` --- # Auth: sign-in card > A compact email and password sign-in form with optional account links. - Kind: block · Category: Auth · Interactivity: script - Install: `npx shadcn@latest add @haze/auth-sign-in-card` - File: `src/components/haze/blocks/auth-sign-in-card.astro` - npm dependencies: none - Registry dependencies: @haze/button, @haze/input, @haze/logo-mark, @haze/password-input, @haze/utils - Docs page: https://hazeui.com/blocks/auth-sign-in-card ## Use when - An application accepts email and password through a server endpoint - A focused sign-in form is needed without social login controls ## Avoid when - The page collects a general inquiry; use contact-split-form - Authentication is handled entirely by an external identity provider ## Alternatives - [contact-split-form](https://hazeui.com/blocks/contact-split-form.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "auth-sign-in-card" | no | Unique prefix for the form labels and section heading. | | brand | `string` | "Driftwork" | no | Brand name shown above the form. | | title | `string` | "Welcome back" | no | Sign-in heading. | | description | `string` | demo copy | no | Short introduction to the form. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Heading level for the page context. | | formAction | `string` | "" | no | Server authentication endpoint; the demo submit button stays disabled without it. | | resetHref | `string` | | no | Optional password-reset destination. | | signUpHref | `string` | | no | Optional account-creation destination. | | class | `string` | | no | Additional section classes. | ## Accessibility - Visible labels and autocomplete hints identify the email and current-password fields; the optional password reveal remains keyboard accessible. - The demo is disabled until an endpoint is supplied; the application must provide authentication, error handling and any server-side form protection. - Key Tab, Enter or Space: Move through the fields, toggle password visibility, and submit when an endpoint is configured. ## Agent prompts ### Install and use Install the Haze UI block "Auth: sign-in card" with `npx shadcn@latest add @haze/auth-sign-in-card`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AuthSignInCard from "@/components/haze/blocks/auth-sign-in-card.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/auth-sign-in-card.md ### Customize with real content Adapt the Haze auth-sign-in-card block for our product. Replace the demo values of these props with our real content: id, brand, title, description, headingLevel, formAction, resetHref, signUpHref, class. Keep the layout, the heading level rules and these accessibility details: Visible labels and autocomplete hints identify the email and current-password fields; the optional password reveal remains keyboard accessible. The demo is disabled until an endpoint is supplied; the application must provide authentication, error handling and any server-side form protection. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using auth-sign-in-card, check it fits: use it when an application accepts email and password through a server endpoint; a focused sign-in form is needed without social login controls. Avoid it when the page collects a general inquiry; use contact-split-form; authentication is handled entirely by an external identity provider. Alternatives: @haze/contact-split-form. ## Example requests that should lead here - Create a centered email and password sign-in card with optional reset and signup links ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; import Button from "../ui/button.astro"; import Input from "../ui/input.astro"; import LogoMark from "../ui/logo-mark.astro"; import PasswordInput from "../ui/password-input.astro"; interface Props { id?: string; brand?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; formAction?: string; resetHref?: string; signUpHref?: string; class?: string; } const { id = "auth-sign-in-card", brand = "Driftwork", title = "Welcome back", description = "Sign in to continue to your workspace.", headingLevel = 2, formAction = "", resetHref, signUpHref, class: className, } = Astro.props; const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel]; ---
{title}

{description}

{resetHref && Forgot password?}
{!formAction &&

Demo form: connect an authentication endpoint to enable sign in.

}
{signUpHref &&

New here? Create an account

}
``` --- # Banner: release notice > A compact release announcement with an optional link to the details. - Kind: block · Category: Banner · Interactivity: native - Install: `npx shadcn@latest add @haze/banner-release-notice` - File: `src/components/haze/blocks/banner-release-notice.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/banner-release-notice ## Use when - Calling attention to a product update within a page - The notice needs a title, brief explanation and optional destination ## Avoid when - The content is a complete call to action with several choices; use cta-banner ## Alternatives - [cta-banner](https://hazeui.com/blocks/cta-banner.md) - [changelog-release-list](https://hazeui.com/blocks/changelog-release-list.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "banner-release-notice" | no | Unique notice ID prefix. | | label | `string` | "What's new" | no | Short label above the notice title. | | title | `string` | demo heading | no | Notice heading. | | description | `string` | demo copy | no | Short supporting explanation. | | href | `string` | | no | Optional destination for details; no link is rendered without it. | | linkLabel | `string` | "See what's changed" | no | Text for the details link. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Heading level for the page context. | | class | `string` | | no | Additional section classes. | ## Accessibility - The notice is labelled by its heading and makes no claim to be a live alert. - The link is omitted entirely when no destination is supplied. - Key Tab, Enter: Follow the release link when a destination is provided. ## Agent prompts ### Install and use Install the Haze UI block "Banner: release notice" with `npx shadcn@latest add @haze/banner-release-notice`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BannerReleaseNotice from "@/components/haze/blocks/banner-release-notice.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/banner-release-notice.md ### Customize with real content Adapt the Haze banner-release-notice block for our product. Replace the demo values of these props with our real content: id, label, title, description, href, linkLabel, headingLevel, class. Keep the layout, the heading level rules and these accessibility details: The notice is labelled by its heading and makes no claim to be a live alert. The link is omitted entirely when no destination is supplied. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using banner-release-notice, check it fits: use it when calling attention to a product update within a page; the notice needs a title, brief explanation and optional destination. Avoid it when the content is a complete call to action with several choices; use cta-banner. Alternatives: @haze/cta-banner, @haze/changelog-release-list. ## Example requests that should lead here - Add a compact product release announcement with a link to the changelog ## Source ```astro --- import { ArrowRight, Sparkles } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; label?: string; title?: string; description?: string; href?: string; linkLabel?: string; headingLevel?: 1 | 2 | 3; class?: string; } const { id = "banner-release-notice", label = "What's new", title = "A more focused workspace is here", description = "Explore the latest improvements to your shared projects.", href, linkLabel = "See what's changed", headingLevel = 2, class: className, } = Astro.props; const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel]; ---

{label}

{title}

{description}

{href && {linkLabel}}
``` --- # AI assistant bento > Three tiles with color image placeholders for prompts, workspace sources and built-in skills. - Kind: block · Category: Bento · Interactivity: none - Install: `npx shadcn@latest add @haze/bento-assistant` - File: `src/components/haze/blocks/bento-assistant.astro` - npm dependencies: none - Registry dependencies: @haze/bento-tile, @haze/section-heading, @haze/utils - Docs page: https://hazeui.com/blocks/bento-assistant ## Use when - An AI assistant page introduces its main abilities before real screenshots exist. - A section needs three short feature tiles with room for product imagery. ## Avoid when - A live chat or user-submitted prompt needs a model connection. ## Alternatives - [chat-thread](https://hazeui.com/ui/chat-thread.md) - [tabs](https://hazeui.com/ui/tabs.md) - [bento-code-intelligence](https://hazeui.com/blocks/bento-code-intelligence.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | bento-assistant | no | Unique prefix for the section and its tab panels. | | title | `string` | | no | Visible section heading. | | description | `string` | | no | Introductory text about the examples. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Heading level for the section. | | class | `string` | | no | Classes on the section. | ## Accessibility - The color fields above the tiles are decorative and hidden from assistive technology. - Tile titles are real headings under the section heading. ## Agent prompts ### Install and use Install the Haze UI block "AI assistant bento" with `npx shadcn@latest add @haze/bento-assistant`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BentoAssistant from "@/components/haze/blocks/bento-assistant.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/bento-assistant.md ### Customize with real content Adapt the Haze bento-assistant block for our product. Replace the demo values of these props with our real content: id, title, description, headingLevel, class. Keep the layout, the heading level rules and these accessibility details: The color fields above the tiles are decorative and hidden from assistive technology. Tile titles are real headings under the section heading. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using bento-assistant, check it fits: use it when an ai assistant page introduces its main abilities before real screenshots exist.; a section needs three short feature tiles with room for product imagery.. Avoid it when a live chat or user-submitted prompt needs a model connection.. Alternatives: @haze/chat-thread, @haze/tabs, @haze/bento-code-intelligence. ## Example requests that should lead here - Introduce a workspace assistant with three image tiles: prompts, sources and skills. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; import BentoTile from "../ui/bento-tile.astro"; import SectionHeading from "../ui/section-heading.astro"; interface Props { id?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; class?: string; } const { id = "bento-assistant", title = "Start from the work you already have", headingLevel = 2, description = "Ask about your docs, projects and wiki, and get answers that link back to their sources.", class: className, } = Astro.props; const tileHeading = ({ 1: 2, 2: 3, 3: 4 } as const)[headingLevel]; ---
``` --- # Code intelligence bento > A code excerpt with its matching line marked, beside two color image placeholders for the reference trace and match index. - Kind: block · Category: Bento · Interactivity: native - Install: `npx shadcn@latest add @haze/bento-code-intelligence` - File: `src/components/haze/blocks/bento-code-intelligence.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/bento-tile, @haze/collapsible, @haze/section-heading, @haze/utils - Docs page: https://hazeui.com/blocks/bento-code-intelligence ## Use when - A developer feature shows a real code excerpt next to room for product imagery. - Readers should see which line of a short excerpt a feature acts on. ## Avoid when - Users need to search or edit a repository within the preview. ## Alternatives - [bento-developer-tools](https://hazeui.com/blocks/bento-developer-tools.md) - [code-block](https://hazeui.com/ui/code-block.md) - [file-tree](https://hazeui.com/ui/file-tree.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | bento-code-intelligence | no | Unique prefix for the heading and line anchors. | | title | `string` | | no | Title of the code story. | | description | `string` | | no | Lead text about the trace. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Heading level for the section. | | file | `string` | | no | Visible path to the file in the excerpt. | | firstLine | `number` | 18 | no | Starting line number of the excerpt. | | lines | `{ code: string; match?: boolean }[]` | | no | Source lines and the ones to highlight as matches. | | explanation | `string` | | no | Optional explanation of how the match was resolved. | | class | `string` | | no | Classes on the section. | ## Accessibility - Image placeholders are flat, decorative fields that screen readers skip. - Matching lines are announced as matches in text, and code wraps on narrow screens. - Key Enter / Space: Expand or collapse the explanation of the match. ## Agent prompts ### Install and use Install the Haze UI block "Code intelligence bento" with `npx shadcn@latest add @haze/bento-code-intelligence`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BentoCodeIntelligence from "@/components/haze/blocks/bento-code-intelligence.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/bento-code-intelligence.md ### Customize with real content Adapt the Haze bento-code-intelligence block for our product. Replace the demo values of these props with our real content: id, title, description, headingLevel, file, firstLine, lines, explanation, class. Keep the layout, the heading level rules and these accessibility details: Image placeholders are flat, decorative fields that screen readers skip. Matching lines are announced as matches in text, and code wraps on narrow screens. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using bento-code-intelligence, check it fits: use it when a developer feature shows a real code excerpt next to room for product imagery.; readers should see which line of a short excerpt a feature acts on.. Avoid it when users need to search or edit a repository within the preview.. Alternatives: @haze/bento-developer-tools, @haze/code-block, @haze/file-tree. ## Example requests that should lead here - Show a billing code excerpt with the matching line marked, next to two image placeholders. ## Source ```astro --- import { FileCode, Search } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import BentoTile from "../ui/bento-tile.astro"; import Collapsible from "../ui/collapsible.astro"; import SectionHeading from "../ui/section-heading.astro"; interface Props { id?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; file?: string; firstLine?: number; lines?: { code: string; match?: boolean }[]; explanation?: string; class?: string; } const { id = "bento-code-intelligence", title = "Follow a change across the codebase", headingLevel = 2, description = "Find the line a change touches, then see every file that depends on it.", file = "src/billing/renewal.ts", firstLine = 18, lines = [ { code: "export function nextRenewal(plan: Plan) {" }, { code: " const cycle = getBillingCycle(plan);", match: true }, { code: " return cycle.nextDate;" }, { code: "}" }, ], explanation = "The trace resolves getBillingCycle to the exported function in billing/cycle.ts. Calls through an aliased import resolve to the same definition.", class: className, } = Astro.props; const tileHeading = ({ 1: 2, 2: 3, 3: 4 } as const)[headingLevel]; ---
{lines.length ? (
    {lines.map(({ code, match }, index) => (
  1. Line {firstLine + index}{match ? ", match" : ""}. {code} {match &&
  2. ))}
) :

No source lines.

}
{explanation &&

{explanation}

}
``` --- # Team collaboration bento > A wide and a narrow tile with color image placeholders, a team availability disclosure and a handoff strip. - Kind: block · Category: Bento · Interactivity: native - Install: `npx shadcn@latest add @haze/bento-collaboration` - File: `src/components/haze/blocks/bento-collaboration.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/bento-mosaic, @haze/bento-presence, @haze/bento-tile, @haze/button, @haze/section-heading, @haze/utils - Docs page: https://hazeui.com/blocks/bento-collaboration ## Use when - A team product shows who is available and who takes the next handoff. - A collaboration page needs room for two product images. ## Avoid when - People need to move calendar events or change their availability from the section. ## Alternatives - [bento-presence](https://hazeui.com/ui/bento-presence.md) - [kanban-board](https://hazeui.com/ui/kanban-board.md) - [team-profile-grid](https://hazeui.com/blocks/team-profile-grid.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | bento-collaboration | no | Unique section heading ID prefix. | | title | `string` | | no | Visible section heading. | | description | `string` | | no | Context for the schedule and handoff. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Heading level for the section. | | members | `Member[]` | | no | Roster names, optional roles and availability. | | handoff | `Handoff \| null` | | no | Handoff detail with optional link. Pass null to omit the tile. | | class | `string` | | no | Classes on the outer section. | ## Accessibility - Image placeholders are flat, decorative fields that screen readers skip. - Open the roster to read every name, role and availability in words. - Key Enter / Space: Expand or collapse team availability. ## Agent prompts ### Install and use Install the Haze UI block "Team collaboration bento" with `npx shadcn@latest add @haze/bento-collaboration`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BentoCollaboration from "@/components/haze/blocks/bento-collaboration.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/bento-collaboration.md ### Customize with real content Adapt the Haze bento-collaboration block for our product. Replace the demo values of these props with our real content: id, title, description, headingLevel, members, handoff, class. Keep the layout, the heading level rules and these accessibility details: Image placeholders are flat, decorative fields that screen readers skip. Open the roster to read every name, role and availability in words. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using bento-collaboration, check it fits: use it when a team product shows who is available and who takes the next handoff.; a collaboration page needs room for two product images.. Avoid it when people need to move calendar events or change their availability from the section.. Alternatives: @haze/bento-presence, @haze/kanban-board, @haze/team-profile-grid. ## Example requests that should lead here - Build a team section with two image tiles, an availability roster and the next handoff. ## Source ```astro --- import { ChevronDown, CornerDownRight } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import BentoMosaic from "../ui/bento-mosaic.astro"; import BentoPresence from "../ui/bento-presence.astro"; import BentoTile from "../ui/bento-tile.astro"; import Button from "../ui/button.astro"; import SectionHeading from "../ui/section-heading.astro"; interface Props { id?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; members?: { name: string; detail?: string; status: "online" | "away" | "offline" }[]; handoff?: { title: string; detail: string; href?: string; linkLabel?: string } | null; class?: string; } const { id = "bento-collaboration", title = "Know who has the next step", headingLevel = 2, description = "See who is working on what today, and who picks up the work next.", members = [ { name: "Iris Chen", detail: "Design", status: "online" }, { name: "Rafi Okafor", detail: "Engineering", status: "online" }, { name: "Mina Vale", detail: "Support", status: "away" }, ], handoff = { title: "Next handoff", detail: "Iris sends the approved checkout screens to Rafi at 12:30 UTC." }, class: className, } = Astro.props; const tileHeading = ({ 1: 2, 2: 3, 3: 4 } as const)[headingLevel]; const HandoffHeading = ({ 2: "h2", 3: "h3", 4: "h4" } as const)[tileHeading]; ---
Team availability
{handoff && (
{handoff.title}

{handoff.detail}

{handoff.href && }
)}
``` --- # Developer tools bento > Four tiles with color image placeholders: build time with its change, a copyable command, release checks and build phases. - Kind: block · Category: Bento · Interactivity: script - Install: `npx shadcn@latest add @haze/bento-developer-tools` - File: `src/components/haze/blocks/bento-developer-tools.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/bento-checklist, @haze/bento-tile, @haze/collapsible, @haze/section-heading, @haze/snippet, @haze/utils - Docs page: https://hazeui.com/blocks/bento-developer-tools ## Use when - A developer tool shows its command and build time next to room for product imagery. - A release overview pairs a build metric with a short list of checks. ## Avoid when - Visitors need to execute commands in a live shell. ## Alternatives - [bento-code-intelligence](https://hazeui.com/blocks/bento-code-intelligence.md) - [terminal-window](https://hazeui.com/ui/terminal-window.md) - [check-runs](https://hazeui.com/ui/check-runs.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | bento-developer-tools | no | ID prefix for the section heading. | | title | `string` | | no | Visible section heading. | | description | `string` | | no | Context for the example workflow. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Heading level for the section. | | command | `string` | pnpm build | no | Displayed command available to copy. | | timing | `Timing` | | no | Formatted duration with optional change, trend, context and build phases. | | checks | `CheckItem[]` | | no | Ordered list of release requirements and their current states. | | class | `string` | | no | Classes on the section wrapper. | ## Accessibility - Image placeholders are flat, decorative fields that screen readers skip. - The command stays selectable if clipboard scripting is unavailable. - Check states are announced as part of the list item text. - Key Enter / Space: Copy the displayed build command. - Key Enter / Space: Expand or collapse the release checks. ## Agent prompts ### Install and use Install the Haze UI block "Developer tools bento" with `npx shadcn@latest add @haze/bento-developer-tools`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BentoDeveloperTools from "@/components/haze/blocks/bento-developer-tools.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/bento-developer-tools.md ### Customize with real content Adapt the Haze bento-developer-tools block for our product. Replace the demo values of these props with our real content: id, title, description, headingLevel, command, timing, checks, class. Keep the layout, the heading level rules and these accessibility details: Image placeholders are flat, decorative fields that screen readers skip. The command stays selectable if clipboard scripting is unavailable. Check states are announced as part of the list item text. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using bento-developer-tools, check it fits: use it when a developer tool shows its command and build time next to room for product imagery.; a release overview pairs a build metric with a short list of checks.. Avoid it when visitors need to execute commands in a live shell.. Alternatives: @haze/bento-code-intelligence, @haze/terminal-window, @haze/check-runs. ## Example requests that should lead here - Show a pnpm build command, its build time and a four-step release gate, each with an image placeholder. ## Source ```astro --- import { ArrowDownRight, ArrowUpRight, Minus } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import BentoChecklist from "../ui/bento-checklist.astro"; import BentoTile from "../ui/bento-tile.astro"; import Collapsible from "../ui/collapsible.astro"; import SectionHeading from "../ui/section-heading.astro"; import Snippet from "../ui/snippet.astro"; interface Props { id?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; command?: string; timing?: { value: string; change?: string; trend?: "up" | "down" | "neutral"; detail?: string; phases?: { label: string; seconds: number }[]; }; checks?: { label: string; detail?: string; state?: "done" | "current" | "pending" }[]; class?: string; } const { id = "bento-developer-tools", title = "Inside a release build", headingLevel = 2, description = "Run the build, watch the time come down and follow every check through to sign-off.", command = "pnpm build", timing = { value: "24 s", change: "−8 s", trend: "down", detail: "vs. the previous build", phases: [{ label: "Resolve", seconds: 4 }, { label: "Compile", seconds: 13 }, { label: "Write", seconds: 7 }], }, checks = [ { label: "Types checked", state: "done" }, { label: "Unit tests passed", state: "done" }, { label: "Preview has been reviewed", state: "done" }, { label: "Release sign-off", state: "current" }, ], class: className, } = Astro.props; const tileHeading = ({ 1: 2, 2: 3, 3: 4 } as const)[headingLevel]; const validSeconds = (value?: number): value is number => typeof value === "number" && Number.isFinite(value) && value >= 0; const phases = (timing.phases ?? []).filter(phase => validSeconds(phase.seconds)); const Trend = { down: ArrowDownRight, up: ArrowUpRight, neutral: Minus }[timing.trend ?? "neutral"]; ---
{(timing.change || timing.detail) &&

{timing.change && } {timing.detail}

}
{checks.length > 0 && } {phases.length > 0 && `${label} ${seconds} s`).join(" · ")} headingLevel={tileHeading} class="md:col-span-3" visualClass="flex-1 bg-foreground/6"> }
``` --- # Customer feedback bento > Two color image placeholder tiles for requests and interviews, with expandable source notes underneath. - Kind: block · Category: Bento · Interactivity: native - Install: `npx shadcn@latest add @haze/bento-feedback` - File: `src/components/haze/blocks/bento-feedback.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/bento-mosaic, @haze/bento-tile, @haze/section-heading, @haze/utils - Docs page: https://hazeui.com/blocks/bento-feedback ## Use when - A research page shows where customer requests come from. - Readers can open a source note to see the context of a request. ## Avoid when - The user needs a searchable inbox or controls for triaging incoming requests. ## Alternatives - [inbox-list](https://hazeui.com/ui/inbox-list.md) - [bar-list](https://hazeui.com/ui/bar-list.md) - [testimonial-featured](https://hazeui.com/blocks/testimonial-featured.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | bento-feedback | no | Unique heading ID prefix for this section. | | title | `string` | | no | Visible section heading. | | description | `string` | | no | Context for the feedback review. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Heading level for the section. | | channels | `Channel[]` | | no | Channel label, supporting line and optional longer note. | | class | `string` | | no | Classes on the outer section. | ## Accessibility - The color fields above the tiles are decorative and hidden from assistive technology. - Each disclosure names its feedback channel. - Key Enter / Space: Expand or collapse a channel note. ## Agent prompts ### Install and use Install the Haze UI block "Customer feedback bento" with `npx shadcn@latest add @haze/bento-feedback`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BentoFeedback from "@/components/haze/blocks/bento-feedback.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/bento-feedback.md ### Customize with real content Adapt the Haze bento-feedback block for our product. Replace the demo values of these props with our real content: id, title, description, headingLevel, channels, class. Keep the layout, the heading level rules and these accessibility details: The color fields above the tiles are decorative and hidden from assistive technology. Each disclosure names its feedback channel. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using bento-feedback, check it fits: use it when a research page shows where customer requests come from.; readers can open a source note to see the context of a request.. Avoid it when the user needs a searchable inbox or controls for triaging incoming requests.. Alternatives: @haze/inbox-list, @haze/bar-list, @haze/testimonial-featured. ## Example requests that should lead here - Summarize customer feedback with two image tiles and expandable notes per channel. ## Source ```astro --- import { ChevronDown } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import BentoMosaic from "../ui/bento-mosaic.astro"; import BentoTile from "../ui/bento-tile.astro"; import SectionHeading from "../ui/section-heading.astro"; interface Props { id?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; channels?: { label: string; detail: string; note?: string }[]; class?: string; } const { id = "bento-feedback", title = "Hear what keeps coming up", headingLevel = 2, description = "Explore the requests behind a sample research brief, from the most common themes to the words people used.", channels = [ { label: "Support", detail: "Where customers get stuck", note: "Most export questions came from teammates who needed specific columns for their weekly report." }, { label: "Interviews", detail: "Why the request matters", note: "Several teams share a filtered snapshot with people who have no workspace account." }, { label: "In-product", detail: "What people ask for in context", note: "Requests clustered around the export menu after people applied saved filters." }, ], class: className, } = Astro.props; const tileHeading = ({ 1: 2, 2: 3, 3: 4 } as const)[headingLevel]; ---
{channels.length > 0 && ( {channels.map(({ label, detail, note }) => note ? (
{label} · Read channel notes {detail}

{note}

) : (

{label}

{detail}

))}
)}
``` --- # Payments and payouts bento > A payout tile with its fee breakdown and a payment methods tile, both with color image placeholders, above a ledger of recent settlements. - Kind: block · Category: Bento · Interactivity: native - Install: `npx shadcn@latest add @haze/bento-fintech` - File: `src/components/haze/blocks/bento-fintech.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/bento-tile, @haze/collapsible, @haze/section-heading, @haze/utils - Docs page: https://hazeui.com/blocks/bento-fintech ## Use when - A product page shows what clears into a scheduled payout. - Readers compare a payout with its funding methods and settlement dates. ## Avoid when - The page needs to initiate transactions or collect payment information. ## Alternatives - [usage-meter](https://hazeui.com/ui/usage-meter.md) - [table](https://hazeui.com/ui/table.md) - [pricing-single-plan](https://hazeui.com/blocks/pricing-single-plan.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | bento-fintech | no | Unique prefix for the section heading. | | title | `string` | | no | Visible section heading. | | description | `string` | | no | Context for the payout and settlements. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Heading level for the section. | | payout | `Payout` | | no | Amount, date and status, shown under the tile title. Supplying line items adds the fee breakdown. | | methods | `Method[]` | | no | Names and masked details of the funding accounts. | | settlements | `Settlement[]` | | no | Ordered ledger entries with amounts, dates, status text and an optional settled state. | | class | `string` | | no | Classes on the section wrapper. | ## Accessibility - Each color field stands in for a product image and is aria-hidden. - Payout line items pair their labels and amounts. Every ledger entry states its settlement status. - Key Enter / Space: Expand or collapse the payout breakdown. ## Agent prompts ### Install and use Install the Haze UI block "Payments and payouts bento" with `npx shadcn@latest add @haze/bento-fintech`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BentoFintech from "@/components/haze/blocks/bento-fintech.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/bento-fintech.md ### Customize with real content Adapt the Haze bento-fintech block for our product. Replace the demo values of these props with our real content: id, title, description, headingLevel, payout, methods, settlements, class. Keep the layout, the heading level rules and these accessibility details: Each color field stands in for a product image and is aria-hidden. Payout line items pair their labels and amounts. Every ledger entry states its settlement status. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using bento-fintech, check it fits: use it when a product page shows what clears into a scheduled payout.; readers compare a payout with its funding methods and settlement dates.. Avoid it when the page needs to initiate transactions or collect payment information.. Alternatives: @haze/usage-meter, @haze/table, @haze/pricing-single-plan. ## Example requests that should lead here - Show the next marketplace payout with its fee breakdown, funding methods and recent settlement dates. ## Source ```astro --- import { Check, Clock3, CreditCard, Landmark } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import BentoTile from "../ui/bento-tile.astro"; import Collapsible from "../ui/collapsible.astro"; import SectionHeading from "../ui/section-heading.astro"; interface Props { id?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; payout?: { amount: string; date: string; status: string; lines: { label: string; amount: string }[] }; methods?: { name: string; detail: string; kind: "bank" | "card" }[]; settlements?: { label: string; amount: string; date: string; status: string; settled?: boolean }[]; class?: string; } const { id = "bento-fintech", title = "See when money moves", headingLevel = 2, description = "Trace a sample payout from the collected payments to the fees, accounts and settlement dates.", payout = { amount: "$12,480.00", date: "Expected Friday, Nov 20", status: "Scheduled", lines: [{ label: "Payments collected", amount: "$12,768.30" }, { label: "Processing fees", amount: "−$288.30" }], }, methods = [ { name: "Operating account", detail: "Bank account ending in 3842", kind: "bank" }, { name: "Business card", detail: "Card ending in 1705", kind: "card" }, ], settlements = [ { label: "Card sales", amount: "$4,280.00", date: "Nov 18", status: "Processing" }, { label: "October adjustment", amount: "$320.50", date: "Nov 16", status: "Settled", settled: true }, { label: "Bank transfers", amount: "$6,745.00", date: "Nov 13", status: "Settled", settled: true }, ], class: className, } = Astro.props; const tileHeading = ({ 1: 2, 2: 3, 3: 4 } as const)[headingLevel]; ---
{payout.lines.length > 0 && (
{payout.lines.map(({ label, amount }) => (
{label}
{amount}
))}
)}
{methods.length > 0 && ( {methods.length > 0 && (
    {methods.map(({ name, detail, kind }) => { const Icon = kind === "bank" ? Landmark : CreditCard; return (
  • {name}{detail}

  • ); })}
)}
)} {settlements.length > 0 && (
    {settlements.map(({ label, amount, date, status, settled }) => { const Icon = settled ? Check : Clock3; return (
  • {date}

    {amount}

    {label} · {status}

  • ); })}
)}
``` --- # Bento: four tiles with one hero tile > Asymmetric four-tile grid; the first tile spans two columns and rows, and each tile is a flat panel with a visual on top and copy below. - Kind: block · Category: Bento · Interactivity: none - Install: `npx shadcn@latest add @haze/bento-grid` - File: `src/components/haze/blocks/bento-grid.astro` - npm dependencies: none - Registry dependencies: @haze/placeholder, @haze/utils - Docs page: https://hazeui.com/blocks/bento-grid ## Use when - Showcasing three to five features where one is clearly the headline - Feature visuals matter more than the copy ## Avoid when - You have more than five features of equal weight; use features-icon-grid ## Alternatives - [features-icon-grid](https://hazeui.com/blocks/features-icon-grid.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | title | `string` | demo heading | no | Section heading (h2). | | description | `string` | demo copy | no | Intro paragraph. | | items | `{ title: string; description: string; visual: "app" \| "chart" \| "photo" }[]` | 4 demo tiles | no | Tiles in order; the span pattern repeats every four. Tiles do not move on hover because they are not links. | ## Accessibility - Tiles are list items with h3 headings, so reading order matches the visual order on every breakpoint. - Visuals are decorative placeholders; give real images alt text when you replace them. ## Agent prompts ### Install and use Install the Haze UI block "Bento: four tiles with one hero tile" with `npx shadcn@latest add @haze/bento-grid`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BentoGrid from "@/components/haze/blocks/bento-grid.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/bento-grid.md ### Customize with real content Adapt the Haze bento-grid block for our product. Replace the demo values of these props with our real content: title, description, items. Keep the layout, the heading level rules and these accessibility details: Tiles are list items with h3 headings, so reading order matches the visual order on every breakpoint. Visuals are decorative placeholders; give real images alt text when you replace them. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using bento-grid, check it fits: use it when showcasing three to five features where one is clearly the headline; feature visuals matter more than the copy. Avoid it when you have more than five features of equal weight; use features-icon-grid. Alternatives: @haze/features-icon-grid. ## Example requests that should lead here - Add a bento grid of four feature cards with one big card - Feature showcase with asymmetric cards and screenshots ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; import Placeholder from "../ui/placeholder.astro"; interface Props { title?: string; description?: string; items?: { title: string; description: string; visual: "app" | "chart" | "photo" }[]; } const { title = "One workspace for the whole product cycle", description = "From the first idea to the release note, every step lives in the same place.", items = [ { title: "Roadmaps that stay current", description: "Projects roll up into initiatives, and progress updates itself from the work underneath.", visual: "app" }, { title: "Cycle analytics", description: "Spot scope creep before it ships late.", visual: "chart" }, { title: "Triage inbox", description: "Route incoming bugs and requests in seconds.", visual: "photo" }, { title: "Release notes in one click", description: "Turn merged work into a changelog your customers will actually read.", visual: "chart" }, ], } = Astro.props; // Four columns from lg: the first tile is 2x2, the last is wide. At md (two columns) the first and last tiles span both columns, so every row is full. const spans = ["md:col-span-2 lg:row-span-2", "", "", "md:col-span-2"]; ---

{title}

{description}

    { items.map((item, i) => (
  • {item.title}

    {item.description}

  • )) }
``` --- # Operations bento > Four color image placeholder tiles for queues, on-call, the current incident and availability, with an incident log and history. - Kind: block · Category: Bento · Interactivity: native - Install: `npx shadcn@latest add @haze/bento-operations` - File: `src/components/haze/blocks/bento-operations.astro` - npm dependencies: none - Registry dependencies: @haze/bento-tile, @haze/collapsible, @haze/section-heading, @haze/timeline, @haze/utils - Docs page: https://hazeui.com/blocks/bento-operations ## Use when - An operations page shows the current incident and who is on call. - The next operator needs the incident status and availability in one view. ## Avoid when - People need to page an engineer or resolve incidents from the panel. ## Alternatives - [bento-trust-analytics](https://hazeui.com/blocks/bento-trust-analytics.md) - [timeline](https://hazeui.com/ui/timeline.md) - [uptime-tracker](https://hazeui.com/ui/uptime-tracker.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | bento-operations | no | Unique section ID prefix. Set it for each instance. | | title | `string` | | no | Visible section heading. | | description | `string` | | no | Short description of the handoff context. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Heading level for the section. | | incident | `Incident` | | no | Incident title and status text. | | updates | `TimelineItem[]` | | no | Chronological updates with titles, optional date text and descriptions. | | onCall | `OnCall \| null` | | no | Engineer name and shift detail. Pass null to hide. | | uptime | `UptimePeriod[]` | | no | Labeled service periods with availability state. | | class | `string` | | no | Classes on the section. | ## Accessibility - Each color field stands in for a product image and is aria-hidden. - The incident log and availability history can be read as text in their disclosures. - Key Enter / Space: Expand or collapse the incident log or availability history. ## Agent prompts ### Install and use Install the Haze UI block "Operations bento" with `npx shadcn@latest add @haze/bento-operations`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BentoOperations from "@/components/haze/blocks/bento-operations.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/bento-operations.md ### Customize with real content Adapt the Haze bento-operations block for our product. Replace the demo values of these props with our real content: id, title, description, headingLevel, incident, updates, onCall, uptime, class. Keep the layout, the heading level rules and these accessibility details: Each color field stands in for a product image and is aria-hidden. The incident log and availability history can be read as text in their disclosures. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using bento-operations, check it fits: use it when an operations page shows the current incident and who is on call.; the next operator needs the incident status and availability in one view.. Avoid it when people need to page an engineer or resolve incidents from the panel.. Alternatives: @haze/bento-trust-analytics, @haze/timeline, @haze/uptime-tracker. ## Example requests that should lead here - Build an on-call handoff section with an incident log, weekly availability and image tiles. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; import BentoTile from "../ui/bento-tile.astro"; import Collapsible from "../ui/collapsible.astro"; import SectionHeading from "../ui/section-heading.astro"; import Timeline from "../ui/timeline.astro"; interface Props { id?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; incident?: { title: string; status: string }; updates?: { title: string; date?: string; datetime?: string; description?: string; current?: boolean }[]; onCall?: { name: string; detail: string } | null; uptime?: { label: string; status: "operational" | "degraded" | "outage" | "no-data" }[]; class?: string; } const { id = "bento-operations", title = "Keep deliveries moving", headingLevel = 2, description = "Watch queues, incidents and uptime in one place, and know who is carrying the pager.", incident = { title: "Webhook delivery delays", status: "Monitoring" }, updates = [ { title: "Delay detected", date: "09:02 UTC", description: "Retry jobs began waiting longer than 30 seconds." }, { title: "Workers scaled up", date: "09:14 UTC", description: "Extra workers are processing the backlog." }, { title: "Delivery recovered", date: "09:27 UTC", description: "The team is watching delivery times before closing the incident." }, ], onCall = { name: "Amina Park", detail: "On call until 16:00 UTC" }, uptime = [ { label: "Mon", status: "operational" }, { label: "Tue", status: "operational" }, { label: "Wed", status: "degraded" }, { label: "Thu", status: "operational" }, { label: "Fri", status: "operational" }, { label: "Sat", status: "operational" }, { label: "Sun", status: "operational" }, ], class: className, } = Astro.props; const tileHeading = ({ 1: 2, 2: 3, 3: 4 } as const)[headingLevel]; const statusLabel = { operational: "Operational", degraded: "Degraded", outage: "Outage", "no-data": "No data" }; const operational = uptime.filter(period => period.status === "operational").length; ---
{description &&

{description}

}
{onCall && ( )} {updates.length > 0 && } {uptime.length > 0 &&
{uptime.map(period => (
{period.label}
{statusLabel[period.status]}
))}
}
``` --- # Trust and analytics bento > An adoption metric and a security review checklist, each with a color image placeholder, beside a service availability strip. - Kind: block · Category: Bento · Interactivity: native - Install: `npx shadcn@latest add @haze/bento-trust-analytics` - File: `src/components/haze/blocks/bento-trust-analytics.astro` - npm dependencies: none - Registry dependencies: @haze/bento-checklist, @haze/bento-tile, @haze/collapsible, @haze/section-heading, @haze/uptime-tracker, @haze/utils - Docs page: https://hazeui.com/blocks/bento-trust-analytics ## Use when - A product section puts adoption figures next to a security review. - Readers need the underlying period values, availability history and named controls. ## Avoid when - The page must carry authoritative audit evidence or a live incident feed. ## Alternatives - [bento-operations](https://hazeui.com/blocks/bento-operations.md) - [bento-growth](https://hazeui.com/ui/bento-growth.md) - [uptime-tracker](https://hazeui.com/ui/uptime-tracker.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | bento-trust-analytics | no | Unique ID prefix for the section heading. | | title | `string` | | no | Visible section title. | | description | `string` | | no | Context for the metrics and review. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Heading level for the section. | | adoption | `Adoption` | | no | Metric name, formatted value and comparison. | | samples | `Sample[]` | | no | Nonnegative historical values in period order, with an optional displayValue for each figure in the disclosure. | | uptime | `UptimePeriod[]` | | no | Service periods with labels and availability states. | | controls | `CheckItem[]` | | no | Review items and their states. | | class | `string` | | no | Classes on the section. | ## Accessibility - Each color field stands in for a product image and is aria-hidden. - Adoption values and availability periods each have a text equivalent. - Every review item has an accessible state. - Key Enter / Space: Expand or collapse the adoption values. ## Agent prompts ### Install and use Install the Haze UI block "Trust and analytics bento" with `npx shadcn@latest add @haze/bento-trust-analytics`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BentoTrustAnalytics from "@/components/haze/blocks/bento-trust-analytics.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/bento-trust-analytics.md ### Customize with real content Adapt the Haze bento-trust-analytics block for our product. Replace the demo values of these props with our real content: id, title, description, headingLevel, adoption, samples, uptime, controls, class. Keep the layout, the heading level rules and these accessibility details: Each color field stands in for a product image and is aria-hidden. Adoption values and availability periods each have a text equivalent. Every review item has an accessible state. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using bento-trust-analytics, check it fits: use it when a product section puts adoption figures next to a security review.; readers need the underlying period values, availability history and named controls.. Avoid it when the page must carry authoritative audit evidence or a live incident feed.. Alternatives: @haze/bento-operations, @haze/bento-growth, @haze/uptime-tracker. ## Example requests that should lead here - Display active workspaces, recent API availability and the security review checklist, with image tiles. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; import BentoChecklist from "../ui/bento-checklist.astro"; import BentoTile from "../ui/bento-tile.astro"; import Collapsible from "../ui/collapsible.astro"; import SectionHeading from "../ui/section-heading.astro"; import UptimeTracker from "../ui/uptime-tracker.astro"; interface Props { id?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; adoption?: { label: string; value: string; comparison: string }; samples?: { label: string; value: number; displayValue?: string }[]; uptime?: { label: string; status: "operational" | "degraded" | "outage" | "no-data" }[]; controls?: { label: string; detail?: string; state?: "done" | "current" | "pending" }[]; class?: string; } const { id = "bento-trust-analytics", title = "Adoption and reliability, together", headingLevel = 2, description = "Workspace growth alongside service availability and the current security review.", adoption = { label: "Active workspaces", value: "2,480", comparison: "+16% vs last month" }, samples = [ { label: "Jun", value: 1620 }, { label: "Jul", value: 1800 }, { label: "Aug", value: 1730 }, { label: "Sep", value: 1960 }, { label: "Oct", value: 2138 }, { label: "Nov", value: 2480 }, ], uptime = [ { label: "Mon", status: "operational" }, { label: "Tue", status: "operational" }, { label: "Wed", status: "operational" }, { label: "Thu", status: "degraded" }, { label: "Fri", status: "operational" }, { label: "Sat", status: "operational" }, { label: "Sun", status: "operational" }, ], controls = [ { label: "Recovery drill", detail: "Completed Nov 14", state: "done" }, { label: "Access review", detail: "Review underway", state: "current" }, { label: "Key rotation", detail: "Due Nov 27", state: "pending" }, ], class: className, } = Astro.props; const tileHeading = ({ 1: 2, 2: 3, 3: 4 } as const)[headingLevel]; const values = samples.filter(({ value }) => Number.isFinite(value) && value >= 0); const operational = uptime.filter(({ status }) => status === "operational").length; ---
0 && "md:grid-cols-[minmax(0,1.45fr)_minmax(0,1fr)]")}> {values.length > 0 && (
{values.map(({ label, value, displayValue }) => (
{label}
{displayValue ?? value}
))}
)}
{uptime.length > 0 && (

{operational} / {uptime.length} Periods operational

)} {controls.length > 0 && ( )}
``` --- # Billing overview > Workspace billing card with inline plan switcher, seat usage bar, saved card summary and downloadable recent invoices. - Kind: block · Category: Settings · Interactivity: script - Install: `npx shadcn@latest add @haze/billing-overview` - File: `src/components/haze/blocks/billing-overview.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/billing-overview ## Use when - Showing current subscription plan, seat utilization, payment card and invoice history in one view - Letting admins swap plans inline without navigating away from billing ## Avoid when - Tracking metered usage spend against a soft/hard budget cap; use usage-billing ## Alternatives - [pricing-three-tier](https://hazeui.com/blocks/pricing-three-tier.md) - [usage-meter](https://hazeui.com/ui/usage-meter.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-billing-overview" | no | Unique prefix for section heading IDs. | | invoices | `{ id: string; date: string; amount: string; status: string }[]` | 3 paid invoices | no | Recent invoice rows with PDF download actions. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - The Change plan button exposes aria-expanded to toggle the inline plan picker. - Plan switches, card updates and invoice downloads announce results via role="status". - Key Tab: Move across Change plan, plan cards, payment Update and invoice PDF buttons - Key Enter / Space: Open/close the plan picker, select a new plan or download an invoice ## Agent prompts ### Install and use Install the Haze UI block "Billing overview" with `npx shadcn@latest add @haze/billing-overview`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BillingOverview from "@/components/haze/blocks/billing-overview.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/billing-overview.md ### Customize with real content Adapt the Haze billing-overview block for our product. Replace the demo values of these props with our real content: id, invoices, class. Keep the layout, the heading level rules and these accessibility details: The Change plan button exposes aria-expanded to toggle the inline plan picker. Plan switches, card updates and invoice downloads announce results via role="status". Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using billing-overview, check it fits: use it when showing current subscription plan, seat utilization, payment card and invoice history in one view; letting admins swap plans inline without navigating away from billing. Avoid it when tracking metered usage spend against a soft/hard budget cap; use usage-billing. Alternatives: @haze/pricing-three-tier, @haze/usage-meter. ## Example requests that should lead here - Add a workspace billing overview block with inline plan picker, seat usage bar, payment card and recent invoices ## Source ```astro --- import { ArrowUpRight, Check, CreditCard, Download, Sparkles } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Invoice { id: string; date: string; amount: string; status: "Paid" | "Open"; } interface Props { id?: string; invoices?: Invoice[]; class?: string; } const { id = "haze-billing-overview", invoices = [ { id: "INV-2026-11", date: "Nov 1, 2026", amount: "$89.00", status: "Paid" }, { id: "INV-2026-10", date: "Oct 1, 2026", amount: "$89.00", status: "Paid" }, { id: "INV-2026-09", date: "Sep 1, 2026", amount: "$89.00", status: "Paid" }, ], class: className, } = Astro.props; const plans = [ { name: "Starter", price: "$29/mo", note: "5 seats · 50k requests" }, { name: "Team", price: "$89/mo", note: "20 seats · 250k requests" }, { name: "Scale", price: "$249/mo", note: "Unlimited seats · SAML SSO" }, ]; ---

Team · $89 / month

Renews Dec 1, 2026 · 14 of 20 seats used

Seats 14 / 20

Recent invoices

    { invoices.map((inv) => (
  • {inv.id} {inv.date} {inv.amount}
  • )) }

``` --- # Blog: editorial list with dates > A compact editorial list aligns article titles and summaries with their categories and dates. - Kind: block · Category: Blog · Interactivity: native - Install: `npx shadcn@latest add @haze/blog-editorial-list` - File: `src/components/haze/blocks/blog-editorial-list.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/blog-editorial-list ## Use when - Displaying recent writing with equal weight for each article - An editorial section needs to work without thumbnail images ## Avoid when - One article should lead with a larger visual; use blog-featured-stories ## Alternatives - [blog-featured-stories](https://hazeui.com/blocks/blog-featured-stories.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "blog-editorial-list" | no | Unique section ID prefix. | | eyebrow | `string` | "The journal" | no | Label above the section heading. | | title | `string` | demo heading | no | Editorial section heading. | | description | `string` | demo copy | no | Introduction to the collection. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Section heading level; article titles use the next level. | | articles | `{ title: string; excerpt: string; category: string; date: string; dateLabel: string; href?: string }[]` | 3 demo articles | no | Articles in display order with ISO dates and optional destinations. | | class | `string` | | no | Additional section classes. | ## Accessibility - Each entry is an article with a heading and a machine-readable publication date. - Article titles are descriptive links only when an href is provided. - Key Tab, Enter: Move to and open linked articles. ## Agent prompts ### Install and use Install the Haze UI block "Blog: editorial list with dates" with `npx shadcn@latest add @haze/blog-editorial-list`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BlogEditorialList from "@/components/haze/blocks/blog-editorial-list.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/blog-editorial-list.md ### Customize with real content Adapt the Haze blog-editorial-list block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, description, headingLevel, articles, class. Keep the layout, the heading level rules and these accessibility details: Each entry is an article with a heading and a machine-readable publication date. Article titles are descriptive links only when an href is provided. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using blog-editorial-list, check it fits: use it when displaying recent writing with equal weight for each article; an editorial section needs to work without thumbnail images. Avoid it when one article should lead with a larger visual; use blog-featured-stories. Alternatives: @haze/blog-featured-stories. ## Example requests that should lead here - List recent articles with dates and categories beside their summaries ## Source ```astro --- import { ArrowUpRight } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Article { title: string; excerpt: string; category: string; date: string; dateLabel: string; href?: string } interface Props { id?: string; eyebrow?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; articles?: Article[]; class?: string; } const { id = "blog-editorial-list", eyebrow = "The journal", title = "Notes from the studio", description = "Ideas and practical lessons from the work of making things together.", headingLevel = 2, articles = [ { title: "The small decisions that keep a project moving", excerpt: "A practical way to make ownership and next steps clear.", category: "Ways of working", date: "2026-11-12", dateLabel: "November 12, 2026" }, { title: "A more useful kind of project update", excerpt: "Give your team the context they need without another meeting.", category: "Practice", date: "2026-10-29", dateLabel: "October 29, 2026" }, { title: "Make room for the first imperfect draft", excerpt: "Why sharing early can lead to more thoughtful work.", category: "Culture", date: "2026-10-15", dateLabel: "October 15, 2026" }, ], class: className, } = Astro.props; const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel]; const ArticleHeading = ({ 1: "h2", 2: "h3", 3: "h4" } as const)[headingLevel]; ---

{eyebrow}

{title}

{description}

{articles.map((article) => (

{article.category}

{article.href ? {article.title} : article.title}

{article.excerpt}

))}
``` --- # Blog: featured story and recent posts > A featured article with an image placeholder, alongside a compact list of recent stories. - Kind: block · Category: Blog · Interactivity: native - Install: `npx shadcn@latest add @haze/blog-featured-stories` - File: `src/components/haze/blocks/blog-featured-stories.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/placeholder, @haze/utils - Docs page: https://hazeui.com/blocks/blog-featured-stories ## Use when - Highlighting one article while keeping recent writing visible - A journal landing page needs dates, categories and summaries ## Avoid when - Every item should have the same visual weight in a feature overview; use features-icon-grid ## Alternatives - [features-icon-grid](https://hazeui.com/blocks/features-icon-grid.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "blog-featured-stories" | no | Section ID prefix; use a unique prefix for each instance. | | eyebrow | `string` | "From the journal" | no | Label above the heading. | | title | `string` | demo heading | no | Title of the editorial section. | | description | `string` | demo copy | no | Introductory text for the collection. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Level of the section heading; article headings follow it. | | featured | `{ title: string; excerpt: string; category: string; date: string; dateLabel: string; href?: string }` | demo featured article | no | Featured story. Add href to make its title a link. | | stories | `{ title: string; excerpt: string; category: string; date: string; dateLabel: string; href?: string }[]` | 3 demo stories | no | Recent stories; dates should use ISO format. | | class | `string` | | no | Additional classes on the section. | ## Accessibility - Stories use article elements with machine-readable dates and descriptive optional links. - The featured artwork is a decorative color placeholder; replace it with an appropriate visual when needed. - Key Tab: Reach each story title that has a URL. ## Agent prompts ### Install and use Install the Haze UI block "Blog: featured story and recent posts" with `npx shadcn@latest add @haze/blog-featured-stories`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BlogFeaturedStories from "@/components/haze/blocks/blog-featured-stories.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/blog-featured-stories.md ### Customize with real content Adapt the Haze blog-featured-stories block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, description, headingLevel, featured, stories, class. Keep the layout, the heading level rules and these accessibility details: Stories use article elements with machine-readable dates and descriptive optional links. The featured artwork is a decorative color placeholder; replace it with an appropriate visual when needed. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using blog-featured-stories, check it fits: use it when highlighting one article while keeping recent writing visible; a journal landing page needs dates, categories and summaries. Avoid it when every item should have the same visual weight in a feature overview; use features-icon-grid. Alternatives: @haze/features-icon-grid. ## Example requests that should lead here - Create a journal section with one featured article and a list of recent posts ## Source ```astro --- import { ArrowUpRight } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Placeholder from "../ui/placeholder.astro"; interface Story { title: string; excerpt: string; category: string; date: string; dateLabel: string; href?: string } interface Props { id?: string; eyebrow?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; featured?: Story; stories?: Story[]; class?: string; } const { id = "blog-featured-stories", eyebrow = "From the journal", title = "Ideas for better work", description = "Practical notes on building thoughtful products and the teams behind them.", headingLevel = 2, featured = { title: "A calmer way to plan the week", excerpt: "A few small changes can give your team more time to focus and fewer reasons to check in.", category: "Teamwork", date: "2026-11-05", dateLabel: "November 5, 2026" }, stories = [ { title: "Make project updates worth reading", excerpt: "Share the context that helps people make decisions.", category: "Practice", date: "2026-10-22", dateLabel: "October 22, 2026" }, { title: "The case for smaller handoffs", excerpt: "Keep momentum without losing the details.", category: "Product", date: "2026-10-09", dateLabel: "October 9, 2026" }, { title: "A useful first draft of a roadmap", excerpt: "Start with outcomes, then make room for what you learn.", category: "Planning", date: "2026-09-24", dateLabel: "September 24, 2026" }, ], class: className, } = Astro.props; const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel]; const StoryHeading = ({ 1: "h2", 2: "h3", 3: "h4" } as const)[headingLevel]; ---

{eyebrow}

{title}

{description}

{featured.category}

{featured.href ? {featured.title} : featured.title}

{featured.excerpt}

{stories.map((story) => (

{story.category}

{story.href ? {story.title} : story.title}

{story.excerpt}

))}
``` --- # Call insights > Sales call analysis card with speaker talk-time bar, flagged moment quote clips, AI summary and next steps that update deal risk. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/call-insights` - File: `src/components/haze/blocks/call-insights.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/call-insights ## Use when - Reviewing recorded sales or customer calls with highlighted pricing, competitor and objection clips - Tracking owned follow-up tasks that dynamically update a deal risk badge ## Avoid when - Displaying a generic media player or full raw transcript without AI highlights ## Alternatives - [ai-insight-card](https://hazeui.com/blocks/ai-insight-card.md) - [bento-checklist](https://hazeui.com/ui/bento-checklist.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-call-insights" | no | Unique prefix for section heading IDs. | | callTitle | `string` | "Tidewell Enterprise · Discovery Call" | no | Recorded call title. | | moments | `Moment[]` | 3 flagged clips | no | Timestamped pricing, competitor and objection clips. | | nextSteps | `{ id: string; task: string; owner: string }[]` | 3 owned steps | no | Checkable action items linked to the deal risk badge. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Flagged moment buttons expose aria-pressed and update the visible blockquote preview in place. - Checking off next steps uses native checkboxes and announces completion counts via role="status". - Key Tab: Move across flagged moment buttons and next-step checkboxes - Key Enter / Space: Preview a flagged quote clip or check off a next step ## Agent prompts ### Install and use Install the Haze UI block "Call insights" with `npx shadcn@latest add @haze/call-insights`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CallInsights from "@/components/haze/blocks/call-insights.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/call-insights.md ### Customize with real content Adapt the Haze call-insights block for our product. Replace the demo values of these props with our real content: id, callTitle, moments, nextSteps, class. Keep the layout, the heading level rules and these accessibility details: Flagged moment buttons expose aria-pressed and update the visible blockquote preview in place. Checking off next steps uses native checkboxes and announces completion counts via role="status". Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using call-insights, check it fits: use it when reviewing recorded sales or customer calls with highlighted pricing, competitor and objection clips; tracking owned follow-up tasks that dynamically update a deal risk badge. Avoid it when displaying a generic media player or full raw transcript without ai highlights. Alternatives: @haze/ai-insight-card, @haze/bento-checklist. ## Example requests that should lead here - Add a sales call insights card with talk-time breakdown, flagged moment clips, AI summary and risk-lowering next steps ## Source ```astro --- import { AlertTriangle, Check, CheckCircle2, PhoneCall, Play, Sparkles } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Moment { id: string; tag: "Pricing" | "Competitor" | "Objection"; time: string; quote: string; } interface NextStep { id: string; task: string; owner: string; } interface Props { id?: string; callTitle?: string; moments?: Moment[]; nextSteps?: NextStep[]; class?: string; } const { id = "haze-call-insights", callTitle = "Tidewell Enterprise · Discovery Call", moments = [ { id: "m1", tag: "Pricing", time: "14:22", quote: "\"Annual billing works if we can lock per-seat pricing for 24 months.\"" }, { id: "m2", tag: "Competitor", time: "21:08", quote: "\"We evaluated two React-only kits, but our marketing site is moving to Astro.\"" }, { id: "m3", tag: "Objection", time: "32:45", quote: "\"Security needs a SOC 2 bridge letter before procurement approves.\"" }, ], nextSteps = [ { id: "ns1", task: "Send SOC 2 bridge letter and DPA to InfoSec", owner: "Elena" }, { id: "ns2", task: "Share 24-month annual seat quote (120 seats)", owner: "Marco" }, { id: "ns3", task: "Schedule technical review with frontend lead", owner: "Elena" }, ], class: className, } = Astro.props; const firstMoment = moments[0]; ---

{callTitle}

42 min · 3 speakers · Recorded today

Talk-time ratio Rep 38% · Customer 62%

Flagged moments

{ moments.map((m, idx) => ( )) }
{firstMoment ? (

{firstMoment.quote}

Clip at {firstMoment.time}
) :

No moments have been flagged.

}

Strong technical fit on Astro migration and dark UI tokens. Main blocker to close before Q4 is security review sign-off and 24-month seat lock confirmation.

Owned next steps

    { nextSteps.map((step) => (
  • )) }

Complete next steps to lower deal risk.

``` --- # Cancel flow > Three-step subscription cancellation flow (Reason, tailored retention Offer, Confirm) with explicit acknowledgment before cancelling. - Kind: block · Category: Settings · Interactivity: script - Install: `npx shadcn@latest add @haze/cancel-flow` - File: `src/components/haze/blocks/cancel-flow.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/cancel-flow ## Use when - Collecting cancellation reasons and surfacing a relevant pause or discount offer before offboarding - Requiring an explicit confirmation acknowledgment on the final destructive step ## Avoid when - Confirming a simple single-item deletion; use alert-dialog or hold-to-confirm ## Alternatives - [alert-dialog](https://hazeui.com/ui/alert-dialog.md) - [hold-to-confirm](https://hazeui.com/ui/hold-to-confirm.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-cancel-flow" | no | Unique prefix for radio group and heading IDs. | | planName | `string` | "Team ($89/mo)" | no | Plan name shown in the cancellation header. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Reasons are grouped in a semantic fieldset with native radio inputs and adapt step 2's retention offer automatically. - Validation errors, accepted offers and cancellation confirmation announce via role="status". - Key Tab / Arrow keys: Choose a cancellation reason, review the offer and confirm cancellation - Key Enter / Space: Accept the retention offer, check acknowledgment or confirm cancellation ## Agent prompts ### Install and use Install the Haze UI block "Cancel flow" with `npx shadcn@latest add @haze/cancel-flow`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CancelFlow from "@/components/haze/blocks/cancel-flow.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/cancel-flow.md ### Customize with real content Adapt the Haze cancel-flow block for our product. Replace the demo values of these props with our real content: id, planName, class. Keep the layout, the heading level rules and these accessibility details: Reasons are grouped in a semantic fieldset with native radio inputs and adapt step 2's retention offer automatically. Validation errors, accepted offers and cancellation confirmation announce via role="status". Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using cancel-flow, check it fits: use it when collecting cancellation reasons and surfacing a relevant pause or discount offer before offboarding; requiring an explicit confirmation acknowledgment on the final destructive step. Avoid it when confirming a simple single-item deletion; use alert-dialog or hold-to-confirm. Alternatives: @haze/alert-dialog, @haze/hold-to-confirm. ## Example requests that should lead here - Build a 3-step subscription cancel flow with Reason radios, tailored retention Offer and final Confirm step ## Source ```astro --- import { AlertTriangle, ArrowLeft, ArrowRight, Check, Gift, ShieldAlert } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; planName?: string; class?: string; } const { id = "haze-cancel-flow", planName = "Team ($89/mo)", class: className } = Astro.props; const reasons = [ { id: "price", label: "Too expensive for our current stage", offer: "Take 40% off for the next 3 months ($53.40/mo) while keeping all 20 seats." }, { id: "pause", label: "Project is temporarily paused", offer: "Pause your subscription for up to 60 days at $0 with all workspace data preserved." }, { id: "missing", label: "Missing a feature we need", offer: "Book a 15-minute roadmap session with our team and get 1 month free while we review." }, ] as const; ---
1 / 3 · Reason

Tell us why you are leaving so we can suggest the best option.

Cancellation reason { reasons.map((r, i) => ( )) }

``` --- # Careers: open role list > A list of roles with team, location, employment type and optional detail links. - Kind: block · Category: Careers · Interactivity: native - Install: `npx shadcn@latest add @haze/careers-role-list` - File: `src/components/haze/blocks/careers-role-list.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/careers-role-list ## Use when - Presenting a small set of current job openings - Applicants need to scan location and role type before opening a listing ## Avoid when - Introducing existing teammates rather than open roles; use team-profile-grid ## Alternatives - [team-profile-grid](https://hazeui.com/blocks/team-profile-grid.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "careers-role-list" | no | Unique ID prefix for the section heading. | | eyebrow | `string` | "Careers" | no | Label above the title. | | title | `string` | demo heading | no | Careers section heading. | | description | `string` | demo copy | no | Introduction; the default identifies the sample roles as examples. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Heading level; role titles use the next level. | | roles | `{ title: string; team: string; location: string; type: string; href?: string }[]` | 3 example roles | no | Roles to display; provide href for a working listing link. | | class | `string` | | no | Additional section classes. | ## Accessibility - Role titles are headings in a list; location and employment type are visible text. - The arrow and location icons are decorative and hidden from assistive technology. - Key Tab: Move between role links when URLs are provided. ## Agent prompts ### Install and use Install the Haze UI block "Careers: open role list" with `npx shadcn@latest add @haze/careers-role-list`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CareersRoleList from "@/components/haze/blocks/careers-role-list.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/careers-role-list.md ### Customize with real content Adapt the Haze careers-role-list block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, description, headingLevel, roles, class. Keep the layout, the heading level rules and these accessibility details: Role titles are headings in a list; location and employment type are visible text. The arrow and location icons are decorative and hidden from assistive technology. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using careers-role-list, check it fits: use it when presenting a small set of current job openings; applicants need to scan location and role type before opening a listing. Avoid it when introducing existing teammates rather than open roles; use team-profile-grid. Alternatives: @haze/team-profile-grid. ## Example requests that should lead here - List current job openings with the team, location and role type ## Source ```astro --- import { ArrowUpRight, MapPin } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; eyebrow?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; roles?: { title: string; team: string; location: string; type: string; href?: string }[]; class?: string; } const { id = "careers-role-list", eyebrow = "Careers", title = "Do thoughtful work with us", description = "These example roles show how to share openings with the people who might be a great fit.", headingLevel = 2, roles = [ { title: "Senior product designer", team: "Design", location: "Remote", type: "Full time" }, { title: "Frontend engineer", team: "Engineering", location: "Remote", type: "Full time" }, { title: "Customer experience lead", team: "Customer experience", location: "London or remote", type: "Full time" }, ], class: className, } = Astro.props; const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel]; const RoleHeading = ({ 1: "h2", 2: "h3", 3: "h4" } as const)[headingLevel]; ---

{eyebrow}

{title}

{description}

    {roles.map((role) => (
  • {role.team}

    {role.href ? {role.title} : role.title}
    {role.type}
  • ))}
``` --- # Case study: customer quote and outcomes > A customer story with an attributed quote, outcome metrics and an optional link. - Kind: block · Category: Case study · Interactivity: native - Install: `npx shadcn@latest add @haze/case-study-outcomes` - File: `src/components/haze/blocks/case-study-outcomes.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/case-study-outcomes ## Use when - Summarizing one customer story with measurable outcomes - A quote and a few metrics can support the introduction ## Avoid when - Several customers should have equal prominence; use testimonials-grid ## Alternatives - [testimonials-grid](https://hazeui.com/blocks/testimonials-grid.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "case-study-outcomes" | no | Unique section ID prefix. | | eyebrow | `string` | "Example case study" | no | Label above the case-study heading. | | title | `string` | demo heading | no | Story headline. | | description | `string` | demo copy | no | Story introduction; the default identifies the fictional example. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Heading level for the headline. | | customer | `string` | "Tidewell Studio" | no | Customer name; the default is fictional. | | quote | `string` | demo quote | no | Attributed customer quote. | | attribution | `string` | demo attribution | no | Name and role of the speaker. | | outcomes | `{ value: string; label: string }[]` | 3 example outcomes | no | Outcome values and explanations; replace all example metrics. | | href / linkLabel | `string` | "" / "Read the story" | no | Optional URL and text for the full story. | | class | `string` | | no | Additional section classes. | ## Accessibility - The quote and attribution are grouped with figure and figcaption. - Outcome labels and values form a description list; the link is omitted when no destination is supplied. - Key Tab: Focus the story link when present. ## Agent prompts ### Install and use Install the Haze UI block "Case study: customer quote and outcomes" with `npx shadcn@latest add @haze/case-study-outcomes`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CaseStudyOutcomes from "@/components/haze/blocks/case-study-outcomes.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/case-study-outcomes.md ### Customize with real content Adapt the Haze case-study-outcomes block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, description, headingLevel, customer, quote, attribution, outcomes, href / linkLabel, class. Keep the layout, the heading level rules and these accessibility details: The quote and attribution are grouped with figure and figcaption. Outcome labels and values form a description list; the link is omitted when no destination is supplied. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using case-study-outcomes, check it fits: use it when summarizing one customer story with measurable outcomes; a quote and a few metrics can support the introduction. Avoid it when several customers should have equal prominence; use testimonials-grid. Alternatives: @haze/testimonials-grid. ## Example requests that should lead here - Summarize a customer story with a quote and three measured outcomes ## Source ```astro --- import { ArrowUpRight } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; eyebrow?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; customer?: string; quote?: string; attribution?: string; outcomes?: { value: string; label: string }[]; href?: string; linkLabel?: string; class?: string; } const { id = "case-study-outcomes", eyebrow = "Example case study", title = "A better rhythm for a growing team", description = "See how one fictional team brought its planning and updates together in a shared workspace.", headingLevel = 2, customer = "Tidewell Studio", quote = "We spend less time collecting updates and more time moving the work forward together.", attribution = "Mara Wells, Operations lead", outcomes = [ { value: "2 hours", label: "saved per week, per person" }, { value: "1 place", label: "for project context" }, { value: "12 teams", label: "sharing a weekly rhythm" }, ], href = "", linkLabel = "Read the story", class: className, } = Astro.props; const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel]; ---

{eyebrow}

{title}

{description}

{href && {linkLabel}}

{customer}

“{quote}”
{attribution}
{outcomes.map((outcome) => (
{outcome.label}
{outcome.value}
))}
``` --- # Catch up > Return-to-work AI digest scanning connected apps across 1d/3d/1w ranges, grouped by priority with mark-as-read toggles. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/catch-up` - File: `src/components/haze/blocks/catch-up.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/catch-up ## Use when - Summarizing cross-app activity (GitHub, Linear, Slack, email) when a user returns to a workspace - Letting users triage Needs-you items, decisions and shipped updates in one list ## Avoid when - Displaying a raw chronological feed of every event; use timeline or inbox-list ## Alternatives - [inbox-list](https://hazeui.com/ui/inbox-list.md) - [notification-stack](https://hazeui.com/ui/notification-stack.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-catch-up" | no | Unique prefix for section heading IDs. | | heading | `string` | "Catch up while you were away" | no | Digest card heading. | | items | `DigestItem[]` | 4 prioritized items | no | Summarized items with priority group, app source and people. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Time-range buttons and Mark read controls expose aria-pressed and announce state updates in a polite status region. - Priority groups pair distinct badges with text labels rather than relying on color alone. - Key Tab: Move across time-range buttons and per-item Mark read toggles - Key Enter / Space: Switch the digest time window or mark an item read/unread ## Agent prompts ### Install and use Install the Haze UI block "Catch up" with `npx shadcn@latest add @haze/catch-up`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CatchUp from "@/components/haze/blocks/catch-up.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/catch-up.md ### Customize with real content Adapt the Haze catch-up block for our product. Replace the demo values of these props with our real content: id, heading, items, class. Keep the layout, the heading level rules and these accessibility details: Time-range buttons and Mark read controls expose aria-pressed and announce state updates in a polite status region. Priority groups pair distinct badges with text labels rather than relying on color alone. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using catch-up, check it fits: use it when summarizing cross-app activity (github, linear, slack, email) when a user returns to a workspace; letting users triage needs-you items, decisions and shipped updates in one list. Avoid it when displaying a raw chronological feed of every event; use timeline or inbox-list. Alternatives: @haze/inbox-list, @haze/notification-stack. ## Example requests that should lead here - Add an AI catch-up digest card with 1 day, 3 days and 1 week filters and mark-as-read buttons ## Source ```astro --- import { Check, Clock, Inbox, Sparkles } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface DigestItem { id: string; group: "Needs you" | "Decisions" | "Shipped" | "FYI"; app: string; title: string; summary: string; people: string; } interface Props { id?: string; heading?: string; items?: DigestItem[]; class?: string; } const { id = "haze-catch-up", heading = "Catch up while you were away", items = [ { id: "cu-1", group: "Needs you", app: "GitHub", title: "Review PR 492: Token contrast audit", summary: "Nina requested your sign-off on the updated muted-foreground token before Thursday's release.", people: "Nina, Leo" }, { id: "cu-2", group: "Decisions", app: "Linear", title: "Adopted Astro 5 static islands for docs", summary: "Team agreed to remove client-side router hydration from all guide pages.", people: "Marco, Sam" }, { id: "cu-3", group: "Shipped", app: "Slack", title: "Command palette OS modifier detection", summary: "macOS users now see the Command glyph while Windows/Linux keeps Ctrl across shortcuts.", people: "Elena" }, { id: "cu-4", group: "FYI", app: "Gmail", title: "Enterprise security questionnaire received", summary: "Tidewell asked for SOC 2 bridge letter by next Friday; Ops owns the draft.", people: "Ops team" }, ], class: className, } = Astro.props; const ranges = ["1 day", "3 days", "1 week"] as const; ---

{heading}

Scanned Slack, Linear, GitHub and Gmail

{ ranges.map((r, idx) => ( )) }
    { items.map((item) => (
  • {item.group} {item.app} · {item.people}

    {item.title}

    {item.summary}

  • )) }
``` --- # Changelog: dated release list > A dated release list with a category label, description and optional link for each update. - Kind: block · Category: Changelog · Interactivity: native - Install: `npx shadcn@latest add @haze/changelog-release-list` - File: `src/components/haze/blocks/changelog-release-list.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/changelog-release-list ## Use when - Publishing a concise history of product changes - Each release needs a date and a short explanation ## Avoid when - The content describes a planned sequence rather than releases; use process-numbered-steps ## Alternatives - [process-numbered-steps](https://hazeui.com/blocks/process-numbered-steps.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "changelog-release-list" | no | Section ID prefix; supply a distinct value for repeated instances. | | eyebrow | `string` | "Changelog" | no | Label above the title. | | title | `string` | demo heading | no | Heading for the release history. | | description | `string` | demo copy | no | Introduction to the release list. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Heading level; release headings follow one level below. | | releases | `{ date: string; dateLabel: string; label: string; title: string; description: string; href?: string }[]` | 3 demo releases | no | Dated entries in display order; date is a machine-readable ISO date. | | class | `string` | | no | Additional classes on the section. | ## Accessibility - Release dates use time elements and the entries remain an ordered list. - Optional links use descriptive release titles, with decorative arrow icons hidden from assistive technology. - Key Tab: Move between release links when URLs are supplied. ## Agent prompts ### Install and use Install the Haze UI block "Changelog: dated release list" with `npx shadcn@latest add @haze/changelog-release-list`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ChangelogReleaseList from "@/components/haze/blocks/changelog-release-list.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/changelog-release-list.md ### Customize with real content Adapt the Haze changelog-release-list block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, description, headingLevel, releases, class. Keep the layout, the heading level rules and these accessibility details: Release dates use time elements and the entries remain an ordered list. Optional links use descriptive release titles, with decorative arrow icons hidden from assistive technology. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using changelog-release-list, check it fits: use it when publishing a concise history of product changes; each release needs a date and a short explanation. Avoid it when the content describes a planned sequence rather than releases; use process-numbered-steps. Alternatives: @haze/process-numbered-steps. ## Example requests that should lead here - Show a product changelog with dates, release labels and short descriptions ## Source ```astro --- import { ArrowUpRight } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; eyebrow?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; releases?: { date: string; dateLabel: string; label: string; title: string; description: string; href?: string }[]; class?: string; } const { id = "changelog-release-list", eyebrow = "Changelog", title = "Small improvements, shipped often", description = "A running record of the updates that make everyday work a little easier.", headingLevel = 2, releases = [ { date: "2026-11-12", dateLabel: "November 12, 2026", label: "New", title: "A clearer view of upcoming work", description: "Group projects by milestone and see what needs attention before the week begins." }, { date: "2026-10-28", dateLabel: "October 28, 2026", label: "Improved", title: "A quieter notification inbox", description: "Related updates now arrive together, with a summary you can scan at a glance." }, { date: "2026-10-08", dateLabel: "October 8, 2026", label: "New", title: "Share a project update", description: "Turn the latest activity into a short update for everyone following a project." }, ], class: className, } = Astro.props; const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel]; const ReleaseHeading = ({ 1: "h2", 2: "h3", 3: "h4" } as const)[headingLevel]; ---

{eyebrow}

{title}

{description}

    {releases.map((release) => (
  1. {release.label} {release.href ? {release.title} : release.title}

    {release.description}

  2. ))}
``` --- # Command palette > Command palette with keyboard navigation, live filtering, native links and an event for selected actions. - Kind: block · Category: App shell · Interactivity: script - Install: `npx shadcn@latest add @haze/command-palette` - File: `src/components/haze/blocks/command-palette.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/kbd, @haze/utils - Docs page: https://hazeui.com/blocks/command-palette ## Use when - Giving power users instant keyboard access to routes and actions in a single searchable palette - Grouping navigation links and host-handled actions with an empty state for unmatched queries ## Avoid when - You need an AI answer synthesized above grouped workspace search hits; use ai-search-bar ## Alternatives - [command-menu](https://hazeui.com/ui/command-menu.md) - [ai-search-bar](https://hazeui.com/blocks/ai-search-bar.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-command-palette" | no | Unique prefix for input label and heading IDs. | | placeholder | `string` | "Search commands…" | no | Search input placeholder. | | items | `CommandItem[]` | 5 grouped commands | no | Set href for links. Actions emit haze:command with id and label. Optional shortcut labels are display-only. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Live filtering hides empty group headings automatically and reveals a clean empty-state message when no command matches. - Action buttons announce selection in a polite status footer. Listen for haze:command to run an action. - Key Tab: Move between the search input and visible commands - Key Arrow Up / Down: Move focus between the search input and visible commands - Key Enter: Open or select the focused command, or the first match from the input - Key Space: Select a focused action button - Key Escape: Return focus to the search input from a command ## Agent prompts ### Install and use Install the Haze UI block "Command palette" with `npx shadcn@latest add @haze/command-palette`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CommandPalette from "@/components/haze/blocks/command-palette.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/command-palette.md ### Customize with real content Adapt the Haze command-palette block for our product. Replace the demo values of these props with our real content: id, placeholder, items, class. Keep the layout, the heading level rules and these accessibility details: Live filtering hides empty group headings automatically and reveals a clean empty-state message when no command matches. Action buttons announce selection in a polite status footer. Listen for haze:command to run an action. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using command-palette, check it fits: use it when giving power users instant keyboard access to routes and actions in a single searchable palette; grouping navigation links and host-handled actions with an empty state for unmatched queries. Avoid it when you need an ai answer synthesized above grouped workspace search hits; use ai-search-bar. Alternatives: @haze/command-menu, @haze/ai-search-bar. ## Example requests that should lead here - Add a command palette with grouped links and actions, keyboard navigation and live filtering ## Source ```astro --- import { FileText, FolderKanban, Plus, Search, Settings, Sparkles } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Kbd from "../ui/kbd.astro"; interface CommandItem { id: string; group: "Navigation" | "Actions"; label: string; href?: string; shortcut?: string[]; } interface Props { id?: string; placeholder?: string; items?: CommandItem[]; class?: string; } const { id = "haze-command-palette", placeholder = "Search commands…", items = [ { id: "cp1", group: "Navigation", label: "Go to Projects" }, { id: "cp2", group: "Navigation", label: "Open Documentation", href: "/docs" }, { id: "cp3", group: "Navigation", label: "Workspace Settings" }, { id: "cp4", group: "Actions", label: "Create new issue" }, { id: "cp5", group: "Actions", label: "Ask workspace AI" }, ], class: className, } = Astro.props; const groups = (["Navigation", "Actions"] as const) .map((name) => ({ name, commands: items.filter((item) => item.group === name) })) .filter(({ commands }) => commands.length); ---

Command palette

{ groups.map(({ name: group, commands }) => (

{group}

    { commands.map((it) => { const Command = it.href ? "a" : "button"; return (
  • {it.label} {it.shortcut && }
  • ); }) }
)) }
``` --- # Comparison: two-plan matrix > A compact, responsive table comparing the features of two plans. - Kind: block · Category: Comparison · Interactivity: none - Install: `npx shadcn@latest add @haze/comparison-plan-matrix` - File: `src/components/haze/blocks/comparison-plan-matrix.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/comparison-plan-matrix ## Use when - A buyer needs to compare two plans feature by feature - Plan values need clear text labels rather than icons alone ## Avoid when - You need to present plan prices and calls to action; use pricing-three-tier ## Alternatives - [pricing-three-tier](https://hazeui.com/blocks/pricing-three-tier.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "comparison-plan-matrix" | no | ID prefix for this labelled section. | | eyebrow | `string` | "Compare plans" | no | Small label above the heading. | | title | `string` | demo heading | no | Section heading and table caption. | | description | `string` | demo copy | no | Introduction; replace the example-plan notice with your own copy. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Level of the section heading. | | plans | `[string, string]` | ["Starter", "Team"] | no | Names for the first and second comparison columns. | | features | `{ name: string; first: string; second: string }[]` | 5 demo features | no | Feature names and their corresponding text values. | | class | `string` | | no | Additional classes on the section. | ## Accessibility - The native table identifies column and row headers and has a caption. - Plan availability is written in text, so it is not conveyed by color or icons alone. ## Agent prompts ### Install and use Install the Haze UI block "Comparison: two-plan matrix" with `npx shadcn@latest add @haze/comparison-plan-matrix`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ComparisonPlanMatrix from "@/components/haze/blocks/comparison-plan-matrix.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/comparison-plan-matrix.md ### Customize with real content Adapt the Haze comparison-plan-matrix block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, description, headingLevel, plans, features, class. Keep the layout, the heading level rules and these accessibility details: The native table identifies column and row headers and has a caption. Plan availability is written in text, so it is not conveyed by color or icons alone. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using comparison-plan-matrix, check it fits: use it when a buyer needs to compare two plans feature by feature; plan values need clear text labels rather than icons alone. Avoid it when you need to present plan prices and calls to action; use pricing-three-tier. Alternatives: @haze/pricing-three-tier. ## Example requests that should lead here - Compare two subscription plans in a compact accessible feature table ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; eyebrow?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; plans?: [string, string]; features?: { name: string; first: string; second: string }[]; class?: string; } const { id = "comparison-plan-matrix", eyebrow = "Compare plans", title = "The details, side by side", description = "Find the right starting point for your team. The values below are examples.", headingLevel = 2, plans = ["Starter", "Team"], features = [ { name: "Members", first: "Up to 3", second: "Unlimited" }, { name: "Projects", first: "Up to 5", second: "Unlimited" }, { name: "Activity history", first: "30 days", second: "1 year" }, { name: "Guest access", first: "Not included", second: "Included" }, { name: "Priority support", first: "Not included", second: "Included" }, ], class: className, } = Astro.props; const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel]; ---

{eyebrow}

{title}

{description}

{plans.map((plan) => )} {features.map((feature) => ( ))}
{title}
Feature{plan}
{feature.name} {feature.first} {feature.second}
``` --- # Contact: methods and hours > A set of contact methods with optional links, supporting details and icons. - Kind: block · Category: Contact · Interactivity: native - Install: `npx shadcn@latest add @haze/contact-methods` - File: `src/components/haze/blocks/contact-methods.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/contact-methods ## Use when - Visitors need several ways to reach an organization - Contact details and availability matter more than an on-page form ## Avoid when - Visitors should submit a message directly; use contact-split-form ## Alternatives - [contact-split-form](https://hazeui.com/blocks/contact-split-form.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "contact-methods" | no | Unique section ID prefix. | | eyebrow | `string` | "Contact" | no | Label above the heading. | | title | `string` | demo heading | no | Contact section heading. | | description | `string` | demo copy | no | Introductory copy; the default marks the contact details as examples. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Section heading level; method titles use the next level. | | methods | `{ icon: "email" \| "location" \| "hours"; label: string; value: string; detail: string; href?: string }[]` | 3 example methods | no | Contact details and optional destinations; replace the fictional examples. | | class | `string` | | no | Additional section classes. | ## Accessibility - Each contact method has a text heading and value; icons are decorative. - A value is linked only when its destination is supplied. - Key Tab, Enter: Open any contact links provided by the caller. ## Agent prompts ### Install and use Install the Haze UI block "Contact: methods and hours" with `npx shadcn@latest add @haze/contact-methods`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ContactMethods from "@/components/haze/blocks/contact-methods.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/contact-methods.md ### Customize with real content Adapt the Haze contact-methods block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, description, headingLevel, methods, class. Keep the layout, the heading level rules and these accessibility details: Each contact method has a text heading and value; icons are decorative. A value is linked only when its destination is supplied. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using contact-methods, check it fits: use it when visitors need several ways to reach an organization; contact details and availability matter more than an on-page form. Avoid it when visitors should submit a message directly; use contact-split-form. Alternatives: @haze/contact-split-form. ## Example requests that should lead here - List email, location and opening hours in a contact section ## Source ```astro --- import { Clock3, Mail, MapPin } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; eyebrow?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; methods?: { icon: "email" | "location" | "hours"; label: string; value: string; detail: string; href?: string }[]; class?: string; } const icons = { email: Mail, location: MapPin, hours: Clock3 }; const { id = "contact-methods", eyebrow = "Contact", title = "Find the right way to reach us", description = "These example details show how to share a few helpful ways to get in touch.", headingLevel = 2, methods = [ { icon: "email", label: "Email", value: "hello@example.com", detail: "For general questions and ideas." }, { icon: "location", label: "Visit", value: "12 Market Street", detail: "Example address, Northport." }, { icon: "hours", label: "Hours", value: "Monday to Friday", detail: "9:00 am–5:00 pm, local time." }, ], class: className, } = Astro.props; const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel]; const ItemHeading = ({ 1: "h2", 2: "h3", 3: "h4" } as const)[headingLevel]; ---

{eyebrow}

{title}

{description}

    {methods.map((method) => { const Icon = icons[method.icon]; return
  • {method.label}

    {method.href ? {method.value} : method.value}

    {method.detail}

  • ; })}
``` --- # Contact: split introduction and form > A contact introduction with response details and a labelled three-field form. - Kind: block · Category: Contact · Interactivity: native - Install: `npx shadcn@latest add @haze/contact-split-form` - File: `src/components/haze/blocks/contact-split-form.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/button, @haze/input, @haze/textarea, @haze/utils - Docs page: https://hazeui.com/blocks/contact-split-form ## Use when - Collecting a visitor's name, email and message for a team - You can supply a real endpoint to receive form submissions ## Avoid when - You only need an email signup; use newsletter-inline ## Alternatives - [newsletter-inline](https://hazeui.com/blocks/newsletter-inline.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "contact-split-form" | no | Unique ID prefix for the section and all its fields. | | eyebrow | `string` | "Get in touch" | no | Label above the section heading. | | title | `string` | demo heading | no | Heading above the contact details. | | description | `string` | demo copy | no | Introductory contact copy. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Heading level for the section title. | | email | `string` | "hello@example.com" | no | Displayed contact address; the default is an example. | | responseTime | `string` | demo response time | no | Expected response time shown alongside the email address. | | formAction | `string` | "" | no | POST endpoint. With no endpoint, submission is disabled and the form is labelled as a demo. | | submitLabel | `string` | "Send message" | no | Submit button text. | | class | `string` | | no | Additional classes on the section. | ## Accessibility - All three required controls have visible labels and use native browser validation. - The default preview announces that submission is unavailable until an endpoint is configured. - Key Tab: Move through the fields and, once configured, the submit button. ## Agent prompts ### Install and use Install the Haze UI block "Contact: split introduction and form" with `npx shadcn@latest add @haze/contact-split-form`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ContactSplitForm from "@/components/haze/blocks/contact-split-form.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/contact-split-form.md ### Customize with real content Adapt the Haze contact-split-form block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, description, headingLevel, email, responseTime, formAction, submitLabel, class. Keep the layout, the heading level rules and these accessibility details: All three required controls have visible labels and use native browser validation. The default preview announces that submission is unavailable until an endpoint is configured. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using contact-split-form, check it fits: use it when collecting a visitor's name, email and message for a team; you can supply a real endpoint to receive form submissions. Avoid it when you only need an email signup; use newsletter-inline. Alternatives: @haze/newsletter-inline. ## Example requests that should lead here - Add a contact section with name, email and message fields that posts to our endpoint ## Source ```astro --- import { Clock3, Mail } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Button from "../ui/button.astro"; import Input from "../ui/input.astro"; import Textarea from "../ui/textarea.astro"; interface Props { id?: string; eyebrow?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; email?: string; responseTime?: string; formAction?: string; submitLabel?: string; class?: string; } const { id = "contact-split-form", eyebrow = "Get in touch", title = "Tell us what you're working on", description = "Have a question or an idea? Share a little context and we'll help you find the right next step.", headingLevel = 2, email = "hello@example.com", responseTime = "We usually reply within two business days.", formAction = "", submitLabel = "Send message", class: className, } = Astro.props; const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel]; ---

{eyebrow}

{title}

{description}

Local test preview

Review the filled-in prompts and a sample ticket category based on keywords.

Sample category billing

System
{systemPrompt.replace("{{product}}", variables.product).replace("{{tone}}", variables.tone)}
User
{userPrompt.replace("{{ticket}}", variables.ticket)}

``` --- # Research run > Deep-research run card showing query planning steps, source badges and a synthesized report with interactive sentence citations. - Kind: block · Category: AI · Interactivity: script - Install: `npx shadcn@latest add @haze/research-run` - File: `src/components/haze/blocks/research-run.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/research-run ## Use when - Presenting multi-step web or workspace research alongside the final cited report - Letting readers inspect which research source backs each claim in the summary ## Avoid when - Showing a single short Q&A answer without research steps; use ai-answer ## Alternatives - [ai-answer](https://hazeui.com/blocks/ai-answer.md) - [timeline](https://hazeui.com/ui/timeline.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-research-run" | no | Unique prefix for section heading IDs. | | query | `string` | Database architecture research query | no | Research prompt shown as the main heading. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Research steps are presented in an ordered list so screen readers announce sequence and completion. - Source pills and inline citation buttons highlight their supporting sentence on hover or click and announce the selection. - Key Tab: Move across source chips and inline citation buttons - Key Enter / Space: Highlight the sentence backed by the focused source ## Agent prompts ### Install and use Install the Haze UI block "Research run" with `npx shadcn@latest add @haze/research-run`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ResearchRun from "@/components/haze/blocks/research-run.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/research-run.md ### Customize with real content Adapt the Haze research-run block for our product. Replace the demo values of these props with our real content: id, query, class. Keep the layout, the heading level rules and these accessibility details: Research steps are presented in an ordered list so screen readers announce sequence and completion. Source pills and inline citation buttons highlight their supporting sentence on hover or click and announce the selection. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using research-run, check it fits: use it when presenting multi-step web or workspace research alongside the final cited report; letting readers inspect which research source backs each claim in the summary. Avoid it when showing a single short q&a answer without research steps; use ai-answer. Alternatives: @haze/ai-answer, @haze/timeline. ## Example requests that should lead here - Add a deep research run view with query planning steps, source chips and interactive inline citations ## Source ```astro --- import { CheckCircle2, Globe, SearchCheck, Sparkles } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; query?: string; class?: string; } const { id = "haze-research-run", query = "Compare edge SQLite vs regional Postgres for read-heavy multi-tenant SaaS apps", class: className, } = Astro.props; const steps = [ { label: "Planned 4 sub-queries", detail: "latency benchmarks, write routing, backup RPO, pricing at 500 GB" }, { label: "Read 14 sources", detail: "Turso docs, Neon architecture notes, Cloudflare D1 limits, Postgres 17 benchmarks" }, { label: "Cross-checked contradictions", detail: "Verified global read replica lag vs single-writer consistency bounds" }, ]; const sources = [ { id: 1, title: "SQLite at the Edge", host: "turso.tech" }, { id: 2, title: "Serverless Postgres Read Replicas", host: "neon.tech" }, { id: 3, title: "Multi-tenant Isolation Patterns", host: "postgres.org" }, ]; ---
14 sources · 38s

{query}

    { steps.map((step) => (
  1. )) }
{ sources.map((s) => ( )) }

Per-tenant embedded SQLite replicas deliver sub-15 ms reads globally when each tenant's working set fits inside a single regional file. Regional Postgres with read replicas remains stronger when analytical joins, transactional queues, or strict row-level security span multiple tenants.

A pragmatic default is Postgres as the system of record with edge caching or SQLite read projections for high-frequency lookup tables.

``` --- # Search results > Faceted workspace search view with Docs/Files/People filter chips, live query matching and a split result preview pane. - Kind: block · Category: App shell · Interactivity: script - Install: `npx shadcn@latest add @haze/search-results` - File: `src/components/haze/blocks/search-results.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/search-results ## Use when - Building a dedicated workspace search page with type facets and an inline preview pane - Letting users inspect matched docs, files and people without leaving the results list ## Avoid when - You want a modal quick-jump dialog rather than a full results page; use command-palette ## Alternatives - [command-palette](https://hazeui.com/blocks/command-palette.md) - [ai-search-bar](https://hazeui.com/blocks/ai-search-bar.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-search-results" | no | Unique prefix for search label and heading IDs. | | initialQuery | `string` | "tokens" | no | Initial search query value. | | results | `SearchDoc[]` | 4 mixed results | no | Searchable docs, files and people with preview copy. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - Facet buttons and result rows expose aria-pressed and update the labelled preview aside in place. - Live match counts announce via a polite role="status" message. - Key Tab: Move across the search field, facet chips and result rows - Key Enter / Space: Filter by facet or load a result into the preview pane ## Agent prompts ### Install and use Install the Haze UI block "Search results" with `npx shadcn@latest add @haze/search-results`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import SearchResults from "@/components/haze/blocks/search-results.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/search-results.md ### Customize with real content Adapt the Haze search-results block for our product. Replace the demo values of these props with our real content: id, initialQuery, results, class. Keep the layout, the heading level rules and these accessibility details: Facet buttons and result rows expose aria-pressed and update the labelled preview aside in place. Live match counts announce via a polite role="status" message. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using search-results, check it fits: use it when building a dedicated workspace search page with type facets and an inline preview pane; letting users inspect matched docs, files and people without leaving the results list. Avoid it when you want a modal quick-jump dialog rather than a full results page; use command-palette. Alternatives: @haze/command-palette, @haze/ai-search-bar. ## Example requests that should lead here - Add a faceted search results page with Docs, Files and People filters and a side-by-side preview pane ## Source ```astro --- import { FileCode2, FileText, Search, Users } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface SearchDoc { id: string; type: "Docs" | "People" | "Files"; title: string; snippet: string; updated: string; preview: string; } interface Props { id?: string; initialQuery?: string; results?: SearchDoc[]; class?: string; } const { id = "haze-search-results", initialQuery = "tokens", results = [ { id: "sr1", type: "Docs", title: "Color tokens and dark contrast", snippet: "All surfaces read semantic OKLCH tokens rather than raw palette classes.", updated: "2h ago", preview: "Haze UI defines 35 semantic tokens in tokens/haze.tokens.json and compiles them into src/styles/haze.css with verified WCAG 2.2 AA contrast ratios." }, { id: "sr2", type: "Files", title: "tokens/haze.tokens.json", snippet: "Source of truth for background, card, popover, border border-frame and status tokens.", updated: "Yesterday", preview: "Defines 35 semantic surface, text, border border-frame and status tokens compiled into src/styles/haze.css." }, { id: "sr3", type: "People", title: "Nina Patel · Design Systems", snippet: "Maintains semantic tokens, contrast checks and component specs.", updated: "Active", preview: "Owner of the token pipeline and WCAG contrast gate (148/148 pairs passing)." }, { id: "sr4", type: "Docs", title: "Theming and custom brand accents", snippet: "Override --brand and --brand-border in your global CSS after importing haze.css.", updated: "3d ago", preview: "Swap --brand in :root to match your product accent while preserving accessible contrast on dark cards." }, ], class: className, } = Astro.props; const firstResult = results[0]; const facets = ["All", "Docs", "Files", "People"] as const; ---

Workspace search results

{ facets.map((f, i) => ( )) }
    { results.map((r, i) => (
  • )) }
``` --- # Security settings > Account security card combining two-factor status toggle, password rotation form and active browser/device sessions with Revoke. - Kind: block · Category: Settings · Interactivity: script - Install: `npx shadcn@latest add @haze/security-settings` - File: `src/components/haze/blocks/security-settings.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/security-settings ## Use when - Giving users a single place to manage 2FA, change their password and revoke unfamiliar sessions - Highlighting the current active device separately from revocable sessions ## Avoid when - Running the full 3-step QR and backup-code 2FA enrollment flow; use two-factor-setup ## Alternatives - [two-factor-setup](https://hazeui.com/blocks/two-factor-setup.md) - [settings-page](https://hazeui.com/blocks/settings-page.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-security-settings" | no | Unique prefix for password labels and heading IDs. | | sessions | `Session[]` | 3 active sessions | no | Signed-in devices with current session marker. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - The 2FA toggle exposes aria-pressed, and password inputs use explicit labels with type="password". - Revoking any session removes its row and announces the device name via role="status". - Key Tab: Move across the 2FA button, password inputs, Update button and session Revoke buttons - Key Enter / Space: Toggle 2FA, submit a password update or revoke an active session ## Agent prompts ### Install and use Install the Haze UI block "Security settings" with `npx shadcn@latest add @haze/security-settings`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import SecuritySettings from "@/components/haze/blocks/security-settings.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/security-settings.md ### Customize with real content Adapt the Haze security-settings block for our product. Replace the demo values of these props with our real content: id, sessions, class. Keep the layout, the heading level rules and these accessibility details: The 2FA toggle exposes aria-pressed, and password inputs use explicit labels with type="password". Revoking any session removes its row and announces the device name via role="status". Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using security-settings, check it fits: use it when giving users a single place to manage 2fa, change their password and revoke unfamiliar sessions; highlighting the current active device separately from revocable sessions. Avoid it when running the full 3-step qr and backup-code 2fa enrollment flow; use two-factor-setup. Alternatives: @haze/two-factor-setup, @haze/settings-page. ## Example requests that should lead here - Add a security settings block with 2FA status toggle, password change form and revocable active device sessions ## Source ```astro --- import { KeyRound, Laptop, LogOut, ShieldCheck, Smartphone } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Session { id: string; device: string; location: string; current?: boolean; mobile?: boolean; } interface Props { id?: string; sessions?: Session[]; class?: string; } const { id = "haze-security-settings", sessions = [ { id: "s1", device: "Chrome on Windows 11", location: "Sarajevo, BA · Active now", current: true }, { id: "s2", device: "Safari on macOS", location: "Berlin, DE · 2 hours ago" }, { id: "s3", device: "Haze iOS App", location: "Sarajevo, BA · Yesterday", mobile: true }, ], class: className, } = Astro.props; ---

Security & sessions

Authenticator 2FA, password rotation and active devices.

Active sessions

    { sessions.map((s) => (
  • {s.device} {s.current && Current}

    {s.location}

    {!s.current && ( )}
  • )) }

``` --- # Selection toolbar > Selectable list paired with a contextual batch-action toolbar that appears when items are checked for labeling, archiving or deleting. - Kind: block · Category: App shell · Interactivity: script - Install: `npx shadcn@latest add @haze/selection-toolbar` - File: `src/components/haze/blocks/selection-toolbar.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/selection-toolbar ## Use when - Enabling multi-item batch actions (label, archive, delete) without cluttering every row - Showing a floating selection count bar that hides automatically when nothing is checked ## Avoid when - Items only support single-row actions; use dropdown-menu or swipe-actions ## Alternatives - [toolbar](https://hazeui.com/ui/toolbar.md) - [inbox-list](https://hazeui.com/ui/inbox-list.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-selection-toolbar" | no | Unique prefix for section heading IDs. | | heading | `string` | "Release backlog" | no | List heading. | | items | `{ id: string; title: string; meta: string; selected?: boolean }[]` | 4 backlog items | no | Selectable list rows. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - The batch bar uses role="toolbar" with an accessible label and hides cleanly when zero checkboxes are checked. - Bulk actions announce the exact number of affected items via a polite role="status" message. - Key Tab: Move across row checkboxes and batch toolbar buttons - Key Enter / Space: Toggle row selection, run Label/Archive/Delete or clear selection ## Agent prompts ### Install and use Install the Haze UI block "Selection toolbar" with `npx shadcn@latest add @haze/selection-toolbar`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import SelectionToolbar from "@/components/haze/blocks/selection-toolbar.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/selection-toolbar.md ### Customize with real content Adapt the Haze selection-toolbar block for our product. Replace the demo values of these props with our real content: id, heading, items, class. Keep the layout, the heading level rules and these accessibility details: The batch bar uses role="toolbar" with an accessible label and hides cleanly when zero checkboxes are checked. Bulk actions announce the exact number of affected items via a polite role="status" message. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using selection-toolbar, check it fits: use it when enabling multi-item batch actions (label, archive, delete) without cluttering every row; showing a floating selection count bar that hides automatically when nothing is checked. Avoid it when items only support single-row actions; use dropdown-menu or swipe-actions. Alternatives: @haze/toolbar, @haze/inbox-list. ## Example requests that should lead here - Add a selectable list with a contextual floating batch-action toolbar for Label, Archive and Delete ## Source ```astro --- import { Archive, Check, Tag, Trash2, X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface ListItem { id: string; title: string; meta: string; selected?: boolean; } interface Props { id?: string; heading?: string; items?: ListItem[]; class?: string; } const { id = "haze-selection-toolbar", heading = "Release backlog", items = [ { id: "st1", title: "Audit dark-mode contrast ratios", meta: "Accessibility · High", selected: true }, { id: "st2", title: "Add keyboard shortcuts dialog", meta: "Navigation · Medium", selected: true }, { id: "st3", title: "Publish v2.8 registry manifest", meta: "Release · High" }, { id: "st4", title: "Write Astro 5 migration guide", meta: "Docs · Low" }, ], class: className, } = Astro.props; ---

{heading}

    { items.map((item) => (
  • )) }

``` --- # Settings command > Searchable workspace settings directory jumping to controls across General, Appearance, Notifications, Security, Members and Billing. - Kind: block · Category: Settings · Interactivity: script - Install: `npx shadcn@latest add @haze/settings-command` - File: `src/components/haze/blocks/settings-command.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/kbd, @haze/utils - Docs page: https://hazeui.com/blocks/settings-command ## Use when - Letting admins search and jump directly to a deeply nested setting by keyword - Presenting a compact overview of six workspace settings domains in one card ## Avoid when - Editing form fields directly inside a left-rail account page; use settings-page ## Alternatives - [settings-page](https://hazeui.com/blocks/settings-page.md) - [command-palette](https://hazeui.com/blocks/command-palette.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-settings-command" | no | Unique prefix for search label and heading IDs. | | entries | `SettingEntry[]` | 6 workspace settings | no | Searchable settings cards across 6 workspace sections. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - The search input filters cards in place and reveals a clear empty message when zero settings match. - Selecting any card announces the target section in a polite role="status" message. - Key Tab: Move between the quick-jump search input and matching settings cards - Key Enter / Space: Jump to the focused settings panel ## Agent prompts ### Install and use Install the Haze UI block "Settings command" with `npx shadcn@latest add @haze/settings-command`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import SettingsCommand from "@/components/haze/blocks/settings-command.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/settings-command.md ### Customize with real content Adapt the Haze settings-command block for our product. Replace the demo values of these props with our real content: id, entries, class. Keep the layout, the heading level rules and these accessibility details: The search input filters cards in place and reveals a clear empty message when zero settings match. Selecting any card announces the target section in a polite role="status" message. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using settings-command, check it fits: use it when letting admins search and jump directly to a deeply nested setting by keyword; presenting a compact overview of six workspace settings domains in one card. Avoid it when editing form fields directly inside a left-rail account page; use settings-page. Alternatives: @haze/settings-page, @haze/command-palette. ## Example requests that should lead here - Create a searchable workspace settings command block across General, Appearance, Notifications, Security, Members and Billing ## Source ```astro --- import { ArrowRight, Search, SlidersHorizontal } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Kbd from "../ui/kbd.astro"; interface SettingEntry { id: string; section: "General" | "Appearance" | "Notifications" | "Security" | "Members" | "Billing"; title: string; description: string; } interface Props { id?: string; entries?: SettingEntry[]; class?: string; } const { id = "haze-settings-command", entries = [ { id: "sc1", section: "General", title: "Workspace name & URL", description: "Change your workspace display name and custom subdomain." }, { id: "sc2", section: "Appearance", title: "Dark tokens & reduced motion", description: "Configure surface contrast and animation preferences." }, { id: "sc3", section: "Notifications", title: "Slack & email digest cadence", description: "Choose when team mentions and weekly summaries send." }, { id: "sc4", section: "Security", title: "SAML SSO & two-factor enforcement", description: "Require authenticator 2FA for all workspace members." }, { id: "sc5", section: "Members", title: "Seats, roles & pending invites", description: "Manage Admin, Editor and Viewer permissions." }, { id: "sc6", section: "Billing", title: "Invoices & spend alerts", description: "Download VAT receipts and set monthly budget thresholds." }, ], class: className, } = Astro.props; ---
/
    { entries.map((entry) => (
  • )) }

``` --- # Settings page > Account settings shell with Profile, Notifications, Security and Billing navigation rail plus a contextual Save/Discard bar on edit. - Kind: block · Category: Settings · Interactivity: script - Install: `npx shadcn@latest add @haze/settings-page` - File: `src/components/haze/blocks/settings-page.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/settings-page ## Use when - Organizing user account settings into a clean left rail with a dirty-state save bar - Letting users edit profile and notification preferences with explicit Save and Discard actions ## Avoid when - Providing instant command-search across dozens of workspace settings; use settings-command ## Alternatives - [tabs](https://hazeui.com/ui/tabs.md) - [settings-command](https://hazeui.com/blocks/settings-command.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-settings-page" | no | Unique prefix for form labels and heading IDs. | | heading | `string` | "Account settings" | no | Rail heading. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - The active rail tab provides keyboard access to its panel. Each field has an explicit label. - Save records edits for the current preview. Discard restores the last saved values across all sections. Both announce confirmation and return focus to the active tab. - Key Tab: Move across the active rail tab, settings fields, and Save and Discard buttons - Key Arrow keys: Switch settings sections using Up / Down in the vertical rail or Left / Right in the horizontal rail - Key Home / End: Move to the first or last settings section - Key Enter / Space: Activate the focused tab or button ## Agent prompts ### Install and use Install the Haze UI block "Settings page" with `npx shadcn@latest add @haze/settings-page`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import SettingsPage from "@/components/haze/blocks/settings-page.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/settings-page.md ### Customize with real content Adapt the Haze settings-page block for our product. Replace the demo values of these props with our real content: id, heading, class. Keep the layout, the heading level rules and these accessibility details: The active rail tab provides keyboard access to its panel. Each field has an explicit label. Save records edits for the current preview. Discard restores the last saved values across all sections. Both announce confirmation and return focus to the active tab. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using settings-page, check it fits: use it when organizing user account settings into a clean left rail with a dirty-state save bar; letting users edit profile and notification preferences with explicit save and discard actions. Avoid it when providing instant command-search across dozens of workspace settings; use settings-command. Alternatives: @haze/tabs, @haze/settings-command. ## Example requests that should lead here - Add an account settings page with Profile, Notifications, Security and Billing rail and an unsaved-changes Save bar ## Source ```astro --- import { Bell, Check, CreditCard, Shield, User } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; heading?: string; class?: string; } const { id = "haze-settings-page", heading = "Account settings", class: className } = Astro.props; const nav = [ { id: "profile", label: "Profile" }, { id: "notifications", label: "Notifications" }, { id: "security", label: "Security" }, { id: "billing", label: "Billing" }, ] as const; ---

Profile

Notifications

Security

Two-factor authentication is enabled via authenticator app. 2 active browser sessions.

Billing

Haze Core · $0 / month

Unlimited projects and full shadcn registry installs.

``` --- # Spend alert > Budget threshold card with live spend/forecast bar, range slider, Email/Slack/PagerDuty/Hard-stop toggles and live Slack alert preview. - Kind: block · Category: Settings · Interactivity: script - Install: `npx shadcn@latest add @haze/spend-alert` - File: `src/components/haze/blocks/spend-alert.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/spend-alert ## Use when - Configuring monthly spend alert thresholds with immediate visual context against current and projected spend - Previewing the exact Slack alert message for soft notifications versus hard-stop caps ## Avoid when - Displaying multiple resource usage meters and past spend history; use usage-billing ## Alternatives - [usage-billing](https://hazeui.com/blocks/usage-billing.md) - [slider](https://hazeui.com/ui/slider.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-spend-alert" | no | Unique prefix for slider label and heading IDs. | | currentSpend | `number` | 420 | no | Accrued spend in dollars. | | forecastSpend | `number` | 580 | no | Forecasted end-of-month spend in dollars. | | initialThreshold | `number` | 500 | no | Starting alert threshold in dollars. | | maxBudget | `number` | 1000 | no | Upper bound of the slider scale. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - The threshold control uses a native range input with an explicit label and announces updated dollar amounts via role="status". - Channel and Hard-stop toggles use native checkboxes and immediately update the live Slack preview text. - Key ArrowLeft / ArrowRight: Adjust the monthly spend threshold slider in $25 steps - Key Tab / Space: Toggle Email, Slack, PagerDuty or Hard-stop checkboxes ## Agent prompts ### Install and use Install the Haze UI block "Spend alert" with `npx shadcn@latest add @haze/spend-alert`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import SpendAlert from "@/components/haze/blocks/spend-alert.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/spend-alert.md ### Customize with real content Adapt the Haze spend-alert block for our product. Replace the demo values of these props with our real content: id, currentSpend, forecastSpend, initialThreshold, maxBudget, class. Keep the layout, the heading level rules and these accessibility details: The threshold control uses a native range input with an explicit label and announces updated dollar amounts via role="status". Channel and Hard-stop toggles use native checkboxes and immediately update the live Slack preview text. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using spend-alert, check it fits: use it when configuring monthly spend alert thresholds with immediate visual context against current and projected spend; previewing the exact slack alert message for soft notifications versus hard-stop caps. Avoid it when displaying multiple resource usage meters and past spend history; use usage-billing. Alternatives: @haze/usage-billing, @haze/slider. ## Example requests that should lead here - Add a budget and spend alert card with a threshold slider over a spend/forecast bar, channel toggles and live Slack preview ## Source ```astro --- import { BellRing, Check, Hash, ShieldAlert } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; currentSpend?: number; forecastSpend?: number; initialThreshold?: number; maxBudget?: number; class?: string; } const { id = "haze-spend-alert", currentSpend = 420, forecastSpend = 580, initialThreshold = 500, maxBudget = 1000, class: className, } = Astro.props; const curPct = Math.round((currentSpend / maxBudget) * 100); const forePct = Math.round((forecastSpend / maxBudget) * 100); const thrPct = Math.round((initialThreshold / maxBudget) * 100); ---

Budget & spend alert

Notify your team or pause metered calls at a monthly threshold.

${initialThreshold} / mo
Current: ${currentSpend} Forecast: ${forecastSpend} Scale max: ${maxBudget}

Spend alert: Workspace crossed ${initialThreshold} (forecast ${forecastSpend}). Soft alert only — requests remain active.

``` --- # Stats: featured metric with supporting results > One prominent result paired with a vertical list of supporting figures. - Kind: block · Category: Stats · Interactivity: none - Install: `npx shadcn@latest add @haze/stats-highlight` - File: `src/components/haze/blocks/stats-highlight.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/stats-highlight ## Use when - One result deserves more emphasis than the other measures - A small group of related metrics supports a concise story ## Avoid when - Every figure should have equal visual weight; use stats-row ## Alternatives - [stats-row](https://hazeui.com/blocks/stats-row.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "stats-highlight" | no | Unique section ID prefix. | | eyebrow | `string` | "A closer look" | no | Label above the section heading. | | title | `string` | demo heading | no | Heading for the results. | | description | `string` | demo copy | no | Context for the metrics; the default identifies them as illustrative. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Section heading level. | | primary | `{ value: string; label: string; detail: string }` | example metric | no | Featured result and context; replace the example with verified information. | | metrics | `{ value: string; label: string }[]` | 3 example metrics | no | Supporting figures and their labels. | | class | `string` | | no | Additional section classes. | ## Accessibility - Labels and figures are expressed as description lists so values retain their context. - The default figures are explicitly marked as examples and must be replaced with real evidence. ## Agent prompts ### Install and use Install the Haze UI block "Stats: featured metric with supporting results" with `npx shadcn@latest add @haze/stats-highlight`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import StatsHighlight from "@/components/haze/blocks/stats-highlight.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/stats-highlight.md ### Customize with real content Adapt the Haze stats-highlight block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, description, headingLevel, primary, metrics, class. Keep the layout, the heading level rules and these accessibility details: Labels and figures are expressed as description lists so values retain their context. The default figures are explicitly marked as examples and must be replaced with real evidence. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using stats-highlight, check it fits: use it when one result deserves more emphasis than the other measures; a small group of related metrics supports a concise story. Avoid it when every figure should have equal visual weight; use stats-row. Alternatives: @haze/stats-row. ## Example requests that should lead here - Highlight one customer outcome beside three supporting statistics ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; eyebrow?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; primary?: { value: string; label: string; detail: string }; metrics?: { value: string; label: string }[]; class?: string; } const { id = "stats-highlight", eyebrow = "A closer look", title = "Small improvements, shared across the team", description = "Illustrative figures show how a featured result can sit alongside supporting measures.", headingLevel = 2, primary = { value: "4.8 hrs", label: "saved per person each week", detail: "Example result from a fictional customer survey." }, metrics = [ { value: "82%", label: "found project updates more easily" }, { value: "3×", label: "faster to find a decision" }, { value: "24", label: "teams in the example survey" }, ], class: className, } = Astro.props; const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel]; ---

{eyebrow}

{title}

{description}

{primary.label}
{primary.value}
{primary.detail}
{metrics.map((metric) => (
{metric.label}
{metric.value}
))}
``` --- # Stats: four metrics with hairline dividers > Heading and caption over four large metrics separated by hairlines, two by two on mobile and in one row from lg. - Kind: block · Category: Stats · Interactivity: none - Install: `npx shadcn@latest add @haze/stats-row` - File: `src/components/haze/blocks/stats-row.astro` - npm dependencies: none - Registry dependencies: - Docs page: https://hazeui.com/blocks/stats-row ## Use when - You have three or four hard numbers that prove traction - Between features and testimonials on a landing page ## Avoid when - The numbers need charts or trends to make sense; use a chart-based stats block ## Alternatives - [logos-row](https://hazeui.com/blocks/logos-row.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | title | `string` | demo heading | no | Section heading (h2). | | description | `string` | demo caption | no | Caption that dates or qualifies the numbers. | | stats | `{ value: string; label: string }[]` | 4 demo stats | no | Metric value and its label. | ## Accessibility - Metrics use a description list (dl/dt/dd), so each value is announced with its label. - The hairline grid expects a count that fills its rows: a multiple of 2, and of 4 from lg. - The label is visually below the value but comes first in the DOM, so screen readers read it as label then value. ## Agent prompts ### Install and use Install the Haze UI block "Stats: four metrics with hairline dividers" with `npx shadcn@latest add @haze/stats-row`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import StatsRow from "@/components/haze/blocks/stats-row.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/stats-row.md ### Customize with real content Adapt the Haze stats-row block for our product. Replace the demo values of these props with our real content: title, description, stats. Keep the layout, the heading level rules and these accessibility details: Metrics use a description list (dl/dt/dd), so each value is announced with its label. The hairline grid expects a count that fills its rows: a multiple of 2, and of 4 from lg. The label is visually below the value but comes first in the DOM, so screen readers read it as label then value. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using stats-row, check it fits: use it when you have three or four hard numbers that prove traction; between features and testimonials on a landing page. Avoid it when the numbers need charts or trends to make sense; use a chart-based stats block. Alternatives: @haze/logos-row. ## Example requests that should lead here - Add a row of four big statistics with labels - Show our traction numbers: teams, uptime, rating ## Source ```astro --- interface Props { title?: string; description?: string; stats?: { value: string; label: string }[]; } const { title = "Built for teams that ship every week", description = "Numbers from the last twelve months across all workspaces.", stats = [ { value: "12,400+", label: "teams on Driftwork" }, { value: "38%", label: "faster cycle time on average" }, { value: "99.99%", label: "uptime over the past year" }, { value: "4.9/5", label: "average rating from 2,100 reviews" }, ], } = Astro.props; ---

{title}

{description}

{ stats.map((stat) => (
{stat.label}
{stat.value}
)) }
``` --- # Team: featured profile and biography > An individual profile pairs an initials panel with a biography and a short list of interests. - Kind: block · Category: Team · Interactivity: native - Install: `npx shadcn@latest add @haze/team-featured-profile` - File: `src/components/haze/blocks/team-featured-profile.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/team-featured-profile ## Use when - Introducing one person with more context than a compact team card allows - A team page needs a profile without relying on a portrait ## Avoid when - Several teammates should have equal emphasis; use team-profile-grid ## Alternatives - [team-profile-grid](https://hazeui.com/blocks/team-profile-grid.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "team-featured-profile" | no | Unique section ID prefix. | | eyebrow | `string` | "Example team profile" | no | Label above the heading; the default identifies the fictional profile. | | title | `string` | demo heading | no | Section heading. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Heading level; the person's name uses the next level. | | name | `string` | "Avery Solis" | no | Person's name; the default is fictional. | | initials | `string` | "AS" | no | Decorative initials used in place of a portrait. | | role | `string` | "Design lead" | no | Person's role. | | location | `string` | "Barcelona, Spain" | no | Location shown beneath the role. | | biography | `string` | fictional biography | no | Short profile biography. | | interests | `string[]` | 3 example interests | no | Short list of areas the person cares about. | | profileHref | `string` | | no | Optional destination for a fuller profile. | | class | `string` | | no | Additional section classes. | ## Accessibility - The profile has a heading and full name; initials and the location icon are decorative. - A descriptive profile link is rendered only when its destination is supplied. - Key Tab, Enter: Follow the optional profile link. ## Agent prompts ### Install and use Install the Haze UI block "Team: featured profile and biography" with `npx shadcn@latest add @haze/team-featured-profile`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import TeamFeaturedProfile from "@/components/haze/blocks/team-featured-profile.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/team-featured-profile.md ### Customize with real content Adapt the Haze team-featured-profile block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, headingLevel, name, initials, role, location, biography, interests, profileHref, class. Keep the layout, the heading level rules and these accessibility details: The profile has a heading and full name; initials and the location icon are decorative. A descriptive profile link is rendered only when its destination is supplied. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using team-featured-profile, check it fits: use it when introducing one person with more context than a compact team card allows; a team page needs a profile without relying on a portrait. Avoid it when several teammates should have equal emphasis; use team-profile-grid. Alternatives: @haze/team-profile-grid. ## Example requests that should lead here - Introduce a team member with a biography, location and areas of interest ## Source ```astro --- import { ArrowUpRight, MapPin } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; eyebrow?: string; title?: string; headingLevel?: 1 | 2 | 3; name?: string; initials?: string; role?: string; location?: string; biography?: string; interests?: string[]; profileHref?: string; class?: string; } const { id = "team-featured-profile", eyebrow = "Example team profile", title = "The people behind the work", headingLevel = 2, name = "Avery Solis", initials = "AS", role = "Design lead", location = "Barcelona, Spain", biography = "Avery helps teams turn complicated problems into useful, thoughtful products. Their practice brings research, writing and design together from the first sketch to the final detail.", interests = ["Making complex work feel approachable", "Building with small, focused teams", "Finding better questions to ask"], profileHref, class: className, } = Astro.props; const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel]; const PersonHeading = ({ 1: "h2", 2: "h3", 3: "h4" } as const)[headingLevel]; ---

{eyebrow}

{title}
{name}

{role}

A little about {name}

{biography}

What they care about

    {interests.map((interest) =>
  • {interest}
  • )}
{profileHref && Read {name}'s profile }
``` --- # Team: profile grid with initials > A grid of concise team profiles with initials, roles, locations and optional profile links. - Kind: block · Category: Team · Interactivity: native - Install: `npx shadcn@latest add @haze/team-profile-grid` - File: `src/components/haze/blocks/team-profile-grid.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/team-profile-grid ## Use when - Introducing a small team without requiring portraits - Each person needs a role and an optional link to a fuller profile ## Avoid when - The content is a customer quote rather than a team profile; use testimonials-grid ## Alternatives - [testimonials-grid](https://hazeui.com/blocks/testimonials-grid.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "team-profile-grid" | no | Section ID prefix, unique among instances on the page. | | eyebrow | `string` | "Example team" | no | Label above the title; the default identifies the fictional profiles. | | title | `string` | demo heading | no | Team section heading. | | description | `string` | demo copy | no | Brief introduction to the team. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Section heading level; names use the following level. | | members | `{ name: string; initials: string; role: string; location: string; href?: string }[]` | 4 fictional people | no | Profiles in display order; links are optional. | | class | `string` | | no | Additional classes on the section. | ## Accessibility - Names are headings inside a list, and decorative initials are hidden from screen readers. - Profile names become keyboard-focusable links only when an href is supplied. - Key Tab: Move between the linked team profiles. ## Agent prompts ### Install and use Install the Haze UI block "Team: profile grid with initials" with `npx shadcn@latest add @haze/team-profile-grid`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import TeamProfileGrid from "@/components/haze/blocks/team-profile-grid.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/team-profile-grid.md ### Customize with real content Adapt the Haze team-profile-grid block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, description, headingLevel, members, class. Keep the layout, the heading level rules and these accessibility details: Names are headings inside a list, and decorative initials are hidden from screen readers. Profile names become keyboard-focusable links only when an href is supplied. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using team-profile-grid, check it fits: use it when introducing a small team without requiring portraits; each person needs a role and an optional link to a fuller profile. Avoid it when the content is a customer quote rather than a team profile; use testimonials-grid. Alternatives: @haze/testimonials-grid. ## Example requests that should lead here - Introduce four team members in a compact grid without stock photos ## Source ```astro --- import { ArrowUpRight } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; eyebrow?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; members?: { name: string; initials: string; role: string; location: string; href?: string }[]; class?: string; } const { id = "team-profile-grid", eyebrow = "Example team", title = "Good work is a team sport", description = "A small group of people who care about useful tools and the details that make them feel right.", headingLevel = 2, members = [ { name: "Mira Solis", initials: "MS", role: "Product and strategy", location: "Lisbon, Portugal" }, { name: "Jonah Bell", initials: "JB", role: "Engineering", location: "Bristol, UK" }, { name: "Noor Patel", initials: "NP", role: "Design", location: "Toronto, Canada" }, { name: "Ellis Park", initials: "EP", role: "Customer experience", location: "Melbourne, Australia" }, ], class: className, } = Astro.props; const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel]; const MemberHeading = ({ 1: "h2", 2: "h3", 3: "h4" } as const)[headingLevel]; ---

{eyebrow}

{title}

{description}

    {members.map((member) => (
  • {member.href ? {member.name} : member.name}

    {member.role}

    {member.location}

  • ))}
``` --- # Testimonial: featured customer quote > A single attributed quote beside a short editorial introduction. - Kind: block · Category: Testimonials · Interactivity: none - Install: `npx shadcn@latest add @haze/testimonial-featured` - File: `src/components/haze/blocks/testimonial-featured.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/testimonial-featured ## Use when - One customer perspective should carry the section - A quote needs space for an attributed speaker and organization ## Avoid when - Several quotes need equal emphasis; use testimonials-grid ## Alternatives - [testimonials-grid](https://hazeui.com/blocks/testimonials-grid.md) - [case-study-outcomes](https://hazeui.com/blocks/case-study-outcomes.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "testimonial-featured" | no | Unique section ID prefix. | | eyebrow | `string` | "Example testimonial" | no | Label above the heading; the default identifies the fictional quote. | | title | `string` | demo heading | no | Section heading. | | quote | `string` | fictional example quote | no | The quoted customer statement. | | person | `string` | "Maya Chen" | no | Speaker name; the default is fictional. | | role | `string` | "Product lead" | no | Speaker role. | | organization | `string` | "Tidewell Studio" | no | Speaker organization; the default is fictional. | | initials | `string` | "MC" | no | Decorative initials for the speaker mark. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Section heading level. | | class | `string` | | no | Additional section classes. | ## Accessibility - The blockquote and its attribution are associated through figure and figcaption. - The quote icon and initials are decorative; the speaker's full name remains visible. ## Agent prompts ### Install and use Install the Haze UI block "Testimonial: featured customer quote" with `npx shadcn@latest add @haze/testimonial-featured`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import TestimonialFeatured from "@/components/haze/blocks/testimonial-featured.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/testimonial-featured.md ### Customize with real content Adapt the Haze testimonial-featured block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, quote, person, role, organization, initials, headingLevel, class. Keep the layout, the heading level rules and these accessibility details: The blockquote and its attribution are associated through figure and figcaption. The quote icon and initials are decorative; the speaker's full name remains visible. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using testimonial-featured, check it fits: use it when one customer perspective should carry the section; a quote needs space for an attributed speaker and organization. Avoid it when several quotes need equal emphasis; use testimonials-grid. Alternatives: @haze/testimonials-grid, @haze/case-study-outcomes. ## Example requests that should lead here - Feature one customer quote in a split panel with the speaker's attribution ## Source ```astro --- import { Quote } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; eyebrow?: string; title?: string; quote?: string; person?: string; role?: string; organization?: string; initials?: string; headingLevel?: 1 | 2 | 3; class?: string; } const { id = "testimonial-featured", eyebrow = "Example testimonial", title = "A little more space to do the work", quote = "We finally have a place where decisions and the thinking behind them can live together. It makes it much easier for everyone to move with confidence.", person = "Maya Chen", role = "Product lead", organization = "Tidewell Studio", initials = "MC", headingLevel = 2, class: className, } = Astro.props; const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel]; ---

{eyebrow}

{title}
“{quote}”
{person}{role}, {organization}
``` --- # Testimonials: grid of equal-height quote panels > Equal-height quote panels in one to three columns, each with the author row pinned to the bottom. - Kind: block · Category: Testimonials · Interactivity: none - Install: `npx shadcn@latest add @haze/testimonials-grid` - File: `src/components/haze/blocks/testimonials-grid.astro` - npm dependencies: none - Registry dependencies: @haze/avatar - Docs page: https://hazeui.com/blocks/testimonials-grid ## Use when - You have three to nine short customer quotes - You want a tidy, even wall of quotes ## Avoid when - You only have one strong quote; a single large quote block reads better ## Alternatives - [logos-row](https://hazeui.com/blocks/logos-row.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | title | `string` | demo heading | no | Section heading (h2). | | testimonials | `{ quote: string; name: string; role: string }[]` | 6 demo quotes | no | Quotes in reading order. | ## Accessibility - Each quote is a figure with blockquote and figcaption, so the attribution is tied to the quote. - Grid order matches DOM order, reading left to right; keep the most important quote first. ## Agent prompts ### Install and use Install the Haze UI block "Testimonials: grid of equal-height quote panels" with `npx shadcn@latest add @haze/testimonials-grid`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import TestimonialsGrid from "@/components/haze/blocks/testimonials-grid.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/testimonials-grid.md ### Customize with real content Adapt the Haze testimonials-grid block for our product. Replace the demo values of these props with our real content: title, testimonials. Keep the layout, the heading level rules and these accessibility details: Each quote is a figure with blockquote and figcaption, so the attribution is tied to the quote. Grid order matches DOM order, reading left to right; keep the most important quote first. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using testimonials-grid, check it fits: use it when you have three to nine short customer quotes; you want a tidy, even wall of quotes. Avoid it when you only have one strong quote; a single large quote block reads better. Alternatives: @haze/logos-row. ## Example requests that should lead here - Add a testimonial wall with six customer quotes in a grid - Customer quotes section with avatars, names and job titles ## Source ```astro --- import Avatar from "../ui/avatar.astro"; interface Props { title?: string; testimonials?: { quote: string; name: string; role: string }[]; } const { title = "Loved by the people who use it every day", testimonials = [ { quote: "We moved 40 engineers over in a weekend. Nobody asked to go back, which has never happened with a tool migration here.", name: "Maya Okafor", role: "VP Engineering, Halcyon" }, { quote: "The keyboard shortcuts alone saved me an hour a week.", name: "Arjun Reyes", role: "Staff Engineer, Northpeak" }, { quote: "Our planning meetings went from ninety minutes to twenty. The roadmap finally reflects what the team is really doing.", name: "Priya Natarajan", role: "Head of Product, Copperleaf" }, { quote: "Triage used to be a full-time job. Now it takes ten minutes after standup.", name: "Tomás Lindgren", role: "Support Lead, Verity" }, { quote: "Fast, quiet and opinionated in the right places.", name: "Hannah Brooks", role: "CTO, Outpost" }, { quote: "It is the first project tool our designers open without being reminded.", name: "Kenji Watanabe", role: "Design Manager, Lattice Bay" }, ], } = Astro.props; ---

{title}

    { testimonials.map((t) => (
  • {t.quote}

    {t.name} {t.role}
  • )) }
``` --- # Two-factor setup > Three-step 2FA setup demo with a QR placeholder, six-digit input validation, and copyable sample backup codes. - Kind: block · Category: Auth · Interactivity: script - Install: `npx shadcn@latest add @haze/two-factor-setup` - File: `src/components/haze/blocks/two-factor-setup.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/two-factor-setup ## Use when - Prototyping a two-factor setup flow with sample credentials - Previewing how people enter a code and save backup codes before connecting an authentication backend ## Avoid when - Enrolling users in live two-factor authentication - Verifying an already-enrolled user during sign-in; use otp-verification ## Alternatives - [otp-verification](https://hazeui.com/blocks/otp-verification.md) - [security-settings](https://hazeui.com/blocks/security-settings.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-two-factor-setup" | no | Unique prefix for input label and heading IDs. | | setupKey | `string` | "JBSW-Y3DP-EHPK-3PXP" | no | Sample setup key displayed in the demo. | | backupCodes | `string[]` | 6 sample codes | no | Sample backup codes shown on step 3. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - The sample setup key and backup codes have labelled copy buttons that announce success or failure. - An invalid demo code keeps focus on the labelled input and announces the six-digit requirement. - Key Tab: Move across the code field, copy buttons, and step controls - Key Enter / Space: Activate the focused button. Enter in the code field submits the demo code. ## Agent prompts ### Install and use Install the Haze UI block "Two-factor setup" with `npx shadcn@latest add @haze/two-factor-setup`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import TwoFactorSetup from "@/components/haze/blocks/two-factor-setup.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/two-factor-setup.md ### Customize with real content Adapt the Haze two-factor-setup block for our product. Replace the demo values of these props with our real content: id, setupKey, backupCodes, class. Keep the layout, the heading level rules and these accessibility details: The sample setup key and backup codes have labelled copy buttons that announce success or failure. An invalid demo code keeps focus on the labelled input and announces the six-digit requirement. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using two-factor-setup, check it fits: use it when prototyping a two-factor setup flow with sample credentials; previewing how people enter a code and save backup codes before connecting an authentication backend. Avoid it when enrolling users in live two-factor authentication; verifying an already-enrolled user during sign-in; use otp-verification. Alternatives: @haze/otp-verification, @haze/security-settings. ## Example requests that should lead here - Create a three-step two-factor setup demo with a QR placeholder, six-digit code validation, and copyable sample backup codes ## Source ```astro --- import { ArrowLeft, ArrowRight, Copy, QrCode, ShieldCheck } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id?: string; setupKey?: string; backupCodes?: string[]; class?: string; } const { id = "haze-two-factor-setup", setupKey = "JBSW-Y3DP-EHPK-3PXP", backupCodes = ["8412-9041", "3920-1184", "6745-2209", "1108-7732", "5591-4420", "9034-6158"], class: className, } = Astro.props; ---
Step 1 of 3

Demo only. This walkthrough uses sample credentials.

Sample setup details

QR placeholder

Sample setup key

{setupKey}

``` --- # Usage billing > Usage-based billing card tracking spend-to-date and projected spend against budget, resource meters and inline cap-increase confirmation. - Kind: block · Category: Settings · Interactivity: script - Install: `npx shadcn@latest add @haze/usage-billing` - File: `src/components/haze/blocks/usage-billing.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/blocks/usage-billing ## Use when - Monitoring metered AI token, storage or build-minute spend against a monthly budget - Letting admins confirm a budget cap increase inline before hitting rate limits ## Avoid when - Showing fixed seat-based plans and invoice PDFs; use billing-overview ## Alternatives - [billing-overview](https://hazeui.com/blocks/billing-overview.md) - [usage-meter](https://hazeui.com/ui/usage-meter.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "haze-usage-billing" | no | Unique prefix for section heading IDs. | | spendToDate | `string` | "$412.60" | no | Current accrued spend. | | projected | `string` | "$568.00" | no | End-of-cycle projected spend. | | budget | `string` | "$600.00" | no | Current monthly budget limit. | | meters | `Meter[]` | 3 resource meters | no | Individual usage bars with warning state. | | class | `string` | | no | Extra classes on the outer section. | ## Accessibility - The cap-increase button exposes aria-expanded to reveal the inline confirmation bar. - Confirming the new budget updates the metric in place and announces the change via role="status". - Key Tab: Move across Increase cap, Cancel and Confirm cap buttons - Key Enter / Space: Open the confirmation bar or confirm the higher monthly cap ## Agent prompts ### Install and use Install the Haze UI block "Usage billing" with `npx shadcn@latest add @haze/usage-billing`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import UsageBilling from "@/components/haze/blocks/usage-billing.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/usage-billing.md ### Customize with real content Adapt the Haze usage-billing block for our product. Replace the demo values of these props with our real content: id, spendToDate, projected, budget, meters, class. Keep the layout, the heading level rules and these accessibility details: The cap-increase button exposes aria-expanded to reveal the inline confirmation bar. Confirming the new budget updates the metric in place and announces the change via role="status". Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using usage-billing, check it fits: use it when monitoring metered ai token, storage or build-minute spend against a monthly budget; letting admins confirm a budget cap increase inline before hitting rate limits. Avoid it when showing fixed seat-based plans and invoice pdfs; use billing-overview. Alternatives: @haze/billing-overview, @haze/usage-meter. ## Example requests that should lead here - Add a usage-based billing dashboard with spend-to-date, projected spend, resource meters and inline budget cap confirmation ## Source ```astro --- import { AlertTriangle, ArrowUpRight, Check, Gauge } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Meter { label: string; used: string; limit: string; pct: number; warn?: boolean; } interface Props { id?: string; spendToDate?: string; projected?: string; budget?: string; meters?: Meter[]; class?: string; } const { id = "haze-usage-billing", spendToDate = "$412.60", projected = "$568.00", budget = "$600.00", meters = [ { label: "Model inference tokens", used: "82.4M", limit: "100M", pct: 82, warn: true }, { label: "Vector index storage", used: "18.2 GB", limit: "50 GB", pct: 36 }, { label: "Edge build minutes", used: "1,420 min", limit: "2,000 min", pct: 71 }, ], class: className, } = Astro.props; ---

Usage & metered spend

Cycle Nov 1 – Nov 30 · 9 days remaining

Spend to date

{spendToDate}

Projected spend

{projected}

Monthly budget

{budget}

{ meters.map((m) => (
{m.label} {m.used} / {m.limit} ({m.pct}%)
)) }

Raise your monthly cap to avoid rate-limiting on burst traffic.

``` --- # Waitlist: centered signup panel > A centered launch announcement and email signup inside a bordered panel. - Kind: block · Category: Waitlist · Interactivity: native - Install: `npx shadcn@latest add @haze/waitlist-signup-panel` - File: `src/components/haze/blocks/waitlist-signup-panel.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/button, @haze/input, @haze/utils - Docs page: https://hazeui.com/blocks/waitlist-signup-panel ## Use when - Collecting interest before a product becomes available - An email address is enough for the initial signup ## Avoid when - Collecting a detailed inquiry; use contact-split-form - The signup is for a recurring newsletter; use newsletter-inline ## Alternatives - [contact-split-form](https://hazeui.com/blocks/contact-split-form.md) - [newsletter-inline](https://hazeui.com/blocks/newsletter-inline.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | "waitlist-signup-panel" | no | Unique prefix for the section and email field. | | eyebrow | `string` | "Coming soon" | no | Small label above the heading. | | title | `string` | demo heading | no | Waitlist heading. | | description | `string` | demo copy | no | Explanation of the upcoming launch. | | headingLevel | `1 \| 2 \| 3` | 2 | no | Level of the section heading. | | formAction | `string` | "" | no | POST endpoint; without it the form is labelled as a demo and submission is disabled. | | submitLabel | `string` | "Join the waitlist" | no | Signup button text. | | privacyNote | `string` | demo privacy note | no | Explanation shown when an endpoint is configured. | | class | `string` | | no | Additional section classes. | ## Accessibility - The required email input has a visible label and uses native email validation. - The demo state explains why the signup button is disabled until an endpoint is supplied. - Key Tab: Reach the email field and the configured signup button. ## Agent prompts ### Install and use Install the Haze UI block "Waitlist: centered signup panel" with `npx shadcn@latest add @haze/waitlist-signup-panel`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import WaitlistSignupPanel from "@/components/haze/blocks/waitlist-signup-panel.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/waitlist-signup-panel.md ### Customize with real content Adapt the Haze waitlist-signup-panel block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, description, headingLevel, formAction, submitLabel, privacyNote, class. Keep the layout, the heading level rules and these accessibility details: The required email input has a visible label and uses native email validation. The demo state explains why the signup button is disabled until an endpoint is supplied. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using waitlist-signup-panel, check it fits: use it when collecting interest before a product becomes available; an email address is enough for the initial signup. Avoid it when collecting a detailed inquiry; use contact-split-form; the signup is for a recurring newsletter; use newsletter-inline. Alternatives: @haze/contact-split-form, @haze/newsletter-inline. ## Example requests that should lead here - Add a waitlist signup panel for an upcoming launch with a real form endpoint ## Source ```astro --- import { Sparkles } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Button from "../ui/button.astro"; import Input from "../ui/input.astro"; interface Props { id?: string; eyebrow?: string; title?: string; description?: string; headingLevel?: 1 | 2 | 3; formAction?: string; submitLabel?: string; privacyNote?: string; class?: string; } const { id = "waitlist-signup-panel", eyebrow = "Coming soon", title = "Get a note when we're ready", description = "We're building a quieter place to plan and share work. Join the list for an invitation when it opens.", headingLevel = 2, formAction = "", submitLabel = "Join the waitlist", privacyNote = "We'll only email you about this launch.", class: className, } = Astro.props; const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel]; ---

{eyebrow}

{title}

{description}

{formAction ? privacyNote : "Demo form: add a form endpoint to accept signups."}

``` --- # Accordion > List of expandable items built from an array, in three variants, with a chevron or plus icon and optional single-open behavior. - Kind: ui · Category: Data display · Interactivity: native - Install: `npx shadcn@latest add @haze/accordion` - File: `src/components/haze/ui/accordion.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/accordion ## Use when - A short list of questions and answers or settings groups, written as plain text - Keeping a long help page scannable with one open item at a time - Content that comes from data rather than from hand-written markup ## Avoid when - Items need rich content such as links or images; stack collapsible components instead - A full-width FAQ section; use the faq blocks ## Alternatives - [collapsible](https://hazeui.com/ui/collapsible.md) - [tabs](https://hazeui.com/ui/tabs.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | items | `{ title: string; content: string; open?: boolean }[]` | | yes | One entry per row; content renders as one paragraph. | | name | `string` | | no | Shared details name; when set, opening one item closes the others. | | variant | `"contained" \| "plain" \| "separated"` | "contained" | no | contained: one bordered panel with dividers. plain: hairlines only, for long FAQ lists. separated: each item is its own panel. | | icon | `"chevron" \| "plus"` | "chevron" | no | chevron turns over when the item opens. plus turns into a cross. | | class | `string` | | no | Extra classes on the outer element. | ## Accessibility - Each row is a native details element, so the summary is announced as an expandable button without extra ARIA. - In the contained and plain variants rows are separated by hairline dividers, so the group reads as a single list; in separated each row is its own panel. - The panel animates its height over 300 ms where the browser supports interpolate-size; elsewhere its content rises in. Both are switched off under prefers-reduced-motion. - With a name set, the browser closes the previous item itself and no script runs. - Key Enter / Space: Open or close the focused item - Key Tab: Move to the next item's summary ## Agent prompts ### Install and use Install the Haze UI component "Accordion" with `npx shadcn@latest add @haze/accordion`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Accordion from "@/components/haze/ui/accordion.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/accordion.md ### Customize with real content Adapt the Haze accordion ui for our product. Replace the demo values of these props with our real content: items, name, variant, icon, class. Keep the layout, the heading level rules and these accessibility details: Each row is a native details element, so the summary is announced as an expandable button without extra ARIA. In the contained and plain variants rows are separated by hairline dividers, so the group reads as a single list; in separated each row is its own panel. The panel animates its height over 300 ms where the browser supports interpolate-size; elsewhere its content rises in. Both are switched off under prefers-reduced-motion. With a name set, the browser closes the previous item itself and no script runs. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using accordion, check it fits: use it when a short list of questions and answers or settings groups, written as plain text; keeping a long help page scannable with one open item at a time; content that comes from data rather than from hand-written markup. Avoid it when items need rich content such as links or images; stack collapsible components instead; a full-width faq section; use the faq blocks. Alternatives: @haze/collapsible, @haze/tabs. ## Example requests that should lead here - Add an accordion with four billing questions, one open at a time - Show three shipping answers with the first item open ## Source ```astro --- import { ChevronDown, Plus } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Item { title: string; content: string; open?: boolean; } interface Props { items: Item[]; /** When set, only one item is open at a time. */ name?: string; /** contained: one bordered panel. plain: hairlines only, for long FAQ lists. separated: each item is its own panel. */ variant?: "contained" | "plain" | "separated"; /** chevron turns over when the item opens. plus turns into a cross. */ icon?: "chevron" | "plus"; class?: string; } const { items, name, variant = "contained", icon = "chevron", class: className } = Astro.props; const roots = { contained: "divide-y divide-border overflow-hidden rounded-xl border border-border bg-card", plain: "divide-y divide-border border-y border-border", separated: "grid gap-2", }; const itemLooks = { contained: "", plain: "", separated: "overflow-hidden rounded-xl border border-border bg-card transition-[border-color] duration-200 ease-snappy open:border-border-strong", }; const summaries = { contained: "px-4 [details:not([open])>&]:hover:bg-accent", plain: "px-0 hover:text-foreground/80", separated: "px-4 [details:not([open])>&]:hover:bg-accent", }; const bodies = { contained: "px-4", plain: "px-0", separated: "px-4" }; // Where the browser can animate to height:auto, the panel slides open and shut. Elsewhere its content rises in. const slide = "supports-[interpolate-size:allow-keywords]:[interpolate-size:allow-keywords] supports-[interpolate-size:allow-keywords]:details-content:h-0 supports-[interpolate-size:allow-keywords]:details-content:overflow-clip supports-[interpolate-size:allow-keywords]:details-content:transition-[height,content-visibility] supports-[interpolate-size:allow-keywords]:details-content:transition-discrete supports-[interpolate-size:allow-keywords]:details-content:duration-300 supports-[interpolate-size:allow-keywords]:details-content:ease-snappy supports-[interpolate-size:allow-keywords]:open:details-content:h-auto"; const Icon = icon === "plus" ? Plus : ChevronDown; ---
{ items.map((item) => (
{item.title} summary_&]:text-foreground", icon === "plus" ? "[[open]>summary_&]:rotate-45" : "[[open]>summary_&]:rotate-180", )} aria-hidden="true" />

{item.content}

)) }
``` --- # Account menu > Avatar-triggered popover with signed-in identity, account links, and a slot for actions such as signing out. - Kind: ui · Category: Overlays · Interactivity: script - Install: `npx shadcn@latest add @haze/account-menu` - File: `src/components/haze/ui/account-menu.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/avatar, @haze/dropdown-menu, @haze/utils - Docs page: https://hazeui.com/ui/account-menu ## Use when - A shell needs one place for personal settings and help links - A narrow toolbar needs a compact avatar trigger with an accessible name ## Avoid when - The menu controls an item unrelated to the current account. Use dropdown-menu. ## Alternatives - [dropdown-menu](https://hazeui.com/ui/dropdown-menu.md) - [popover](https://hazeui.com/ui/popover.md) - [sidebar](https://hazeui.com/ui/sidebar.md) - [avatar](https://hazeui.com/ui/avatar.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique popover ID and CSS anchor name. | | name | `string` | | yes | Display name for the account and source of initials. | | identifier | `string` | | no | Optional account detail, such as an email address or handle. | | avatarSrc | `string` | | no | Optional avatar image URL. Without an image, the trigger shows an account icon and the panel shows initials. | | items | `{ label: string; href: string; icon?: AstroComponent }[]` | | yes | Links to account-related destinations. | | compact | `boolean` | false | no | Hide the name in the trigger while keeping it inside the popover. | | label | `string` | "Account menu" | no | Localized description announced after the account holder's name. | | align | `"start" \| "end"` | "end" | no | Edge of the trigger to align with the popover. | | side | `"bottom" \| "top"` | "bottom" | no | Preferred placement. Use top for a sidebar footer. | | class | `string` | | no | Additional classes on the wrapper. | ## Accessibility - The trigger has a textual accessible name even in compact mode. - Account links are native anchors and the popover preserves standard tab order. - The actions slot can hold your application's authenticated sign-out form. - Key Enter / Space: Toggle the account popover. - Key Tab: Focus links and any supplied actions. - Key Arrow keys / Home / End / Letters: Move among the account links or jump to one by name. - Key Escape: Close the popover. ## Agent prompts ### Install and use Install the Haze UI component "Account menu" with `npx shadcn@latest add @haze/account-menu`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AccountMenu from "@/components/haze/ui/account-menu.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/account-menu.md ### Customize with real content Adapt the Haze account-menu ui for our product. Replace the demo values of these props with our real content: id, name, identifier, avatarSrc, items, compact, label, align, side, class. Keep the layout, the heading level rules and these accessibility details: The trigger has a textual accessible name even in compact mode. Account links are native anchors and the popover preserves standard tab order. The actions slot can hold your application's authenticated sign-out form. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using account-menu, check it fits: use it when a shell needs one place for personal settings and help links; a narrow toolbar needs a compact avatar trigger with an accessible name. Avoid it when the menu controls an item unrelated to the current account. use dropdown-menu.. Alternatives: @haze/dropdown-menu, @haze/popover, @haze/sidebar, @haze/avatar. ## Example requests that should lead here - Add an avatar menu with profile settings and help in the top bar - Put a compact account menu at the bottom of the sidebar and pass a sign-out form ## Source ```astro --- import { ChevronsUpDown, UserRound } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Avatar from "./avatar.astro"; import DropdownMenu from "./dropdown-menu.astro"; interface AccountLink { label: string; href: string; icon?: (props: Record) => unknown } interface Props { id: string; name: string; identifier?: string; avatarSrc?: string; items: AccountLink[]; compact?: boolean; label?: string; align?: "start" | "end"; side?: "bottom" | "top"; class?: string; } const { id, name, identifier, avatarSrc, items, compact = false, label = "Account menu", align = "end", side = "bottom", class: className } = Astro.props; ---
{avatarSrc ? : } {!compact && {name}}

{name}

{identifier &&

{identifier}

}
{Astro.slots.has("actions") &&
}
``` --- # Action swap > A real checkbox styled as one action that exchanges its label and icon when the state changes. - Kind: ui · Category: Actions · Interactivity: script - Install: `npx shadcn@latest add @haze/action-swap` - File: `src/components/haze/ui/action-swap.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/action-swap ## Use when - A follow or subscribe action has two lasting states - A compact action needs to show the checked result in place ## Avoid when - For a single asynchronous save with pending and error states, use stateful-button - For several independent choices, use toggle-group ## Alternatives - [toggle](https://hazeui.com/ui/toggle.md) - [stateful-button](https://hazeui.com/ui/stateful-button.md) - [toggle-group](https://hazeui.com/ui/toggle-group.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique caller-supplied prefix for this component and its related elements. | | name | `string` | id | no | Form submission name. | | label | `string` | "Follow project" | no | Visible label before selection. | | activeLabel | `string` | "Following" | no | Visible label while selected. | | checked | `boolean` | false | no | Initial checkbox state. | | disabled | `boolean` | | no | Disables the native control and its enhancement. | | class | `string` | | no | Additional classes for the component root. | | ...attributes | `native control attributes` | | no | Other attributes are forwarded to the real form control. | ## Accessibility - The visible label remains associated with the real checkbox as it changes. - The checked value submits through native forms, including with scripts disabled; haze:action-swap reports enhanced changes. - Key Tab, Space: Focus the checkbox and exchange its lasting state. ## Agent prompts ### Install and use Install the Haze UI component "Action swap" with `npx shadcn@latest add @haze/action-swap`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ActionSwap from "@/components/haze/ui/action-swap.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/action-swap.md ### Customize with real content Adapt the Haze action-swap ui for our product. Replace the demo values of these props with our real content: id, name, label, activeLabel, checked, disabled, class, ...attributes. Keep the layout, the heading level rules and these accessibility details: The visible label remains associated with the real checkbox as it changes. The checked value submits through native forms, including with scripts disabled; haze:action-swap reports enhanced changes. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using action-swap, check it fits: use it when a follow or subscribe action has two lasting states; a compact action needs to show the checked result in place. Avoid it when for a single asynchronous save with pending and error states, use stateful-button; for several independent choices, use toggle-group. Alternatives: @haze/toggle, @haze/stateful-button, @haze/toggle-group. ## Example requests that should lead here - Add a follow-project control that changes to Following and retains a native checked state. ## Source ```astro --- import { Check, Plus } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id: string; name?: string; label?: string; activeLabel?: string; checked?: boolean; disabled?: boolean; class?: string; [key: string]: unknown; } const { id, name = id, label = "Follow project", activeLabel = "Following", checked = false, disabled, class: className, ...rest } = Astro.props; ---
``` --- # Activity Heatmap > Plots daily counts across up to twelve weeks with a five-step intensity scale and a readable data list. - Kind: ui · Category: Data display · Interactivity: native - Install: `npx shadcn@latest add @haze/activity-heatmap` - File: `src/components/haze/ui/activity-heatmap.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/activity-heatmap ## Use when - Daily activity varies enough to show trends by weekday. - You need a compact view plus the option to read exact daily counts. ## Avoid when - Events are best understood in chronological detail with descriptions. ## Alternatives - [timeline](https://hazeui.com/ui/timeline.md) - [sparkline](https://hazeui.com/ui/sparkline.md) - [uptime-tracker](https://hazeui.com/ui/uptime-tracker.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | label | `string` | Deployment activity | no | Title for the chart. | | unit | `string` | deployments | no | Name of the measured activity. | | unitSingular | `string` | | no | Singular form of unit, used for a count of 1. Defaults to unit without a trailing "s" (not for -ss or -us). Pass it for irregular plurals such as "series". | | samples | `Sample[]` | [] | no | Dated counts. Missing dates are bucketed as zero. | | end | `string` | | no | Last day to display in YYYY-MM-DD format. | | weeks | `number` | 8 | no | Number of Monday-aligned weeks, clamped to 1–12. | | maxCount | `number` | | no | Optional positive input for the darkest color band. | | class | `string` | | no | Classes for the chart panel. | ## Accessibility - The disclosure includes each date and count in text. - Future cells in the final week are blank and excluded from the count list. - Key Enter / Space: Expand or collapse the daily data. - Key Tab: Focus the scrollable list. - Key Arrow keys: Scroll the list of counts. ## Agent prompts ### Install and use Install the Haze UI component "Activity Heatmap" with `npx shadcn@latest add @haze/activity-heatmap`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ActivityHeatmap from "@/components/haze/ui/activity-heatmap.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/activity-heatmap.md ### Customize with real content Adapt the Haze activity-heatmap ui for our product. Replace the demo values of these props with our real content: label, unit, unitSingular, samples, end, weeks, maxCount, class. Keep the layout, the heading level rules and these accessibility details: The disclosure includes each date and count in text. Future cells in the final week are blank and excluded from the count list. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using activity-heatmap, check it fits: use it when daily activity varies enough to show trends by weekday.; you need a compact view plus the option to read exact daily counts.. Avoid it when events are best understood in chronological detail with descriptions.. Alternatives: @haze/timeline, @haze/sparkline, @haze/uptime-tracker. ## Example requests that should lead here - Visualize deployment frequency over the last eight weeks. - Add a compact calendar heatmap for daily signups. ## Source ```astro --- import { ChevronDown } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Sample { date: string; count: number } interface Props { label?: string; unit?: string; /** Singular form of unit, used when a count is 1. Defaults to unit without a trailing "s" (not for -ss or -us). */ unitSingular?: string; samples?: Sample[]; end?: string; weeks?: number; maxCount?: number; class?: string; } const { label = "Deployment activity", unit = "deployments", unitSingular, end, weeks = 8, maxCount, samples = [], class: className, } = Astro.props; const countByDate = new Map(samples.map(({ date, count }) => [date, Number.isFinite(count) ? Math.max(0, count) : 0])); const day = 86_400_000; const newest = end ?? Array.from(countByDate.keys()).sort().at(-1); const parsed = Date.parse(`${newest}T00:00:00Z`); const last = Number.isFinite(parsed) ? parsed : Math.floor(Date.now() / day) * day; const weekCount = Number.isFinite(weeks) ? Math.max(1, Math.min(12, Math.round(weeks))) : 8; const mondayOffset = (new Date(last).getUTCDay() + 6) % 7; const first = last - (mondayOffset + (weekCount - 1) * 7) * day; const dates = Array.from({ length: weekCount * 7 }, (_, index) => { const stamp = first + index * day; const iso = new Date(stamp).toISOString().slice(0, 10); return { stamp, iso, count: countByDate.get(iso) ?? 0, future: stamp > last }; }); const peak = maxCount && Number.isFinite(maxCount) && maxCount > 0 ? maxCount : Math.max(1, ...dates.filter(({ future }) => !future).map(({ count }) => count)); const dateLabel = new Intl.DateTimeFormat("en", { month: "short", day: "numeric", timeZone: "UTC" }); const colors = ["bg-foreground/8", "bg-brand/24", "bg-brand/42", "bg-brand/64", "bg-brand"]; const numberLabel = new Intl.NumberFormat("en"); const singular = unitSingular ?? (/[^su]s$/.test(unit) ? unit.slice(0, -1) : unit); const unitFor = (count: number) => (count === 1 ? singular : unit); ---
{label} {dateLabel.format(first)} to {dateLabel.format(last)}
View daily counts
{dates.filter(({ future }) => !future).reverse().map(({ stamp, iso, count }) => (
{numberLabel.format(count)} {unitFor(count)}
))}
``` --- # Alert dialog > A native confirmation dialog that starts focus on Cancel and ignores outside clicks. - Kind: ui · Category: Overlays · Interactivity: script - Install: `npx shadcn@latest add @haze/alert-dialog` - File: `src/components/haze/ui/alert-dialog.astro` - npm dependencies: none - Registry dependencies: @haze/button, @haze/dialog, @haze/utils - Docs page: https://hazeui.com/ui/alert-dialog ## Use when - People must acknowledge the consequence of discarding, revoking, or deleting something - A short irreversible action needs distinct cancel and confirm labels ## Avoid when - The modal collects fields or longer content. Use dialog. - A routine notification can be read without interrupting the user. Use alert. ## Alternatives - [dialog](https://hazeui.com/ui/dialog.md) - [alert](https://hazeui.com/ui/alert.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique dialog ID. An external trigger can target it with commandfor. | | title | `string` | "Discard this draft?" | no | Question or brief confirmation title. | | description | `string` | "Your unsaved edits will be lost." | no | Consequence of accepting the action. | | trigger | `boolean` | true | no | Renders the default opener. | | triggerLabel | `string` | "Discard draft" | no | Text on the opener. | | cancelLabel | `string` | "Keep editing" | no | Label of the cancel action. | | confirmLabel | `string` | "Discard draft" | no | Label of the confirm action. | | confirmForm | `string` | | no | ID of a form outside the dialog to submit. When omitted, confirmation closes with returnValue confirm. | | destructive | `boolean` | true | no | Uses destructive styling for confirmation. | | headingLevel | `2 \| 3 \| 4 \| 5 \| 6` | 2 | no | Heading level for the title. | | default slot | `slot` | | no | Optional content below the description. | | class | `string` | | no | Additional classes on the dialog. | ## Accessibility - Initial focus is on Cancel. The native modal manages focus containment and restoration. - Handle the close event and look for returnValue equal to confirm before accepting the result. - Place the dialog outside its optional submission form and explain the specific consequence in the description. - Key Enter or Space: Open the dialog or activate the focused action. - Key Escape: Cancel and restore focus to the trigger. ## Agent prompts ### Install and use Install the Haze UI component "Alert dialog" with `npx shadcn@latest add @haze/alert-dialog`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AlertDialog from "@/components/haze/ui/alert-dialog.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/alert-dialog.md ### Customize with real content Adapt the Haze alert-dialog ui for our product. Replace the demo values of these props with our real content: id, title, description, trigger, triggerLabel, cancelLabel, confirmLabel, confirmForm, destructive, headingLevel, default slot, class. Keep the layout, the heading level rules and these accessibility details: Initial focus is on Cancel. The native modal manages focus containment and restoration. Handle the close event and look for returnValue equal to confirm before accepting the result. Place the dialog outside its optional submission form and explain the specific consequence in the description. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using alert-dialog, check it fits: use it when people must acknowledge the consequence of discarding, revoking, or deleting something; a short irreversible action needs distinct cancel and confirm labels. Avoid it when the modal collects fields or longer content. use dialog.; a routine notification can be read without interrupting the user. use alert.. Alternatives: @haze/dialog, @haze/alert. ## Example requests that should lead here - Confirm before discarding a draft, focus Keep editing first, and submit the discard form only on confirmation. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; import Button from "./button.astro"; import Dialog from "./dialog.astro"; interface Props { id: string; title?: string; description?: string; trigger?: boolean; triggerLabel?: string; cancelLabel?: string; confirmLabel?: string; confirmForm?: string; destructive?: boolean; headingLevel?: 2 | 3 | 4 | 5 | 6; class?: string; } const { id, title = "Discard this draft?", description = "Your unsaved edits will be lost.", trigger = true, triggerLabel = "Discard draft", cancelLabel = "Keep editing", confirmLabel = "Discard draft", confirmForm, destructive = true, headingLevel = 2, class: className, } = Astro.props; ---
``` --- # Alert > Inline message panel with a status icon, title, optional description and action slot, in five variants. - Kind: ui · Category: Feedback · Interactivity: none - Install: `npx shadcn@latest add @haze/alert` - File: `src/components/haze/ui/alert.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/alert ## Use when - A message that stays in the flow of the page, such as a billing notice or a failed import - Telling the reader what happened and offering one follow-up action - Status messages that need an icon and text, not only a tint ## Avoid when - A short-lived confirmation that should disappear on its own - A blocking decision that needs a dialog ## Alternatives - [status](https://hazeui.com/ui/status.md) - [dialog](https://hazeui.com/ui/dialog.md) - [empty](https://hazeui.com/ui/empty.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | variant | `"default" \| "info" \| "success" \| "warning" \| "destructive"` | "default" | no | Picks the icon and the tint of the panel: a 25% border and 8% fill for the four status variants, the card surface for default. | | title | `string` | | yes | First line, rendered as a paragraph in medium weight. | | class | `string` | | no | Extra classes on the box. | | ...rest | `HTML attributes` | | no | Passed to the box; add role="alert" for messages inserted after load. | | default slot | `slot` | | no | Description text under the title. | | action | `slot` | | no | A button or link, shown to the right of the text on wide layouts and under it on narrow ones. | ## Accessibility - The action sits to the right of the text on wide layouts and below it on narrow ones. - No role is set by default, so an alert that is part of the page does not interrupt screen readers; pass role="alert" when you insert it after load. - Each status has its own icon shape: a circle with a check for success, a triangle for warning and a circle with a cross for destructive. Default and info share the circle with an i, and differ by color and by the title text, so the status is not carried by color alone. - The title is a paragraph, not a heading, so it never disturbs the outline of the page. ## Agent prompts ### Install and use Install the Haze UI component "Alert" with `npx shadcn@latest add @haze/alert`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Alert from "@/components/haze/ui/alert.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/alert.md ### Customize with real content Adapt the Haze alert ui for our product. Replace the demo values of these props with our real content: variant, title, class, ...rest, default slot, action. Keep the layout, the heading level rules and these accessibility details: The action sits to the right of the text on wide layouts and below it on narrow ones. No role is set by default, so an alert that is part of the page does not interrupt screen readers; pass role="alert" when you insert it after load. Each status has its own icon shape: a circle with a check for success, a triangle for warning and a circle with a cross for destructive. Default and info share the circle with an i, and differ by color and by the title text, so the status is not carried by color alone. The title is a paragraph, not a heading, so it never disturbs the outline of the page. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using alert, check it fits: use it when a message that stays in the flow of the page, such as a billing notice or a failed import; telling the reader what happened and offering one follow-up action; status messages that need an icon and text, not only a tint. Avoid it when a short-lived confirmation that should disappear on its own; a blocking decision that needs a dialog. Alternatives: @haze/status, @haze/dialog, @haze/empty. ## Example requests that should lead here - Show a warning that the trial ends in three days with an upgrade button - Add a destructive alert above the form when saving fails ## Source ```astro --- import { CircleCheck, CircleX, Info, TriangleAlert } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { variant?: "default" | "info" | "success" | "warning" | "destructive"; /** Short first line, rendered as plain text (not a heading). */ title: string; class?: string; [key: string]: unknown; } const { variant = "default", title, class: className, ...rest } = Astro.props; const boxes = { default: "border-border bg-card shadow-key", info: "border-border bg-card shadow-key", success: "border-border bg-card shadow-key", warning: "border-border bg-card shadow-key", destructive: "border-border bg-card shadow-key", }; const iconColors = { default: "text-muted-foreground", info: "text-brand", success: "text-success", warning: "text-warning", destructive: "text-destructive", }; const icons = { default: Info, info: Info, success: CircleCheck, warning: TriangleAlert, destructive: CircleX }; const Icon = icons[variant]; const hasDescription = Astro.slots.has("default"); const hasAction = Astro.slots.has("action"); ---

{title}

{hasDescription &&
}
{hasAction &&
}
``` --- # Animated number > A formatted number whose changing digits roll individually, with stable columns, width transitions and reduced-motion support. - Kind: ui · Category: Data display · Interactivity: script - Install: `npx shadcn@latest add @haze/animated-number` - File: `src/components/haze/ui/animated-number.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/animated-number ## Use when - A metric or count changes in response to an action or a new reading - The initial value should be readable immediately ## Avoid when - The number never changes. Use stat. - The per-step intermediate values carry meaning. ## Alternatives - [stat](https://hazeui.com/ui/stat.md) - [sparkline](https://hazeui.com/ui/sparkline.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | value | `number` | 128 | no | Initial number. Set data-value on the rendered wrapper to update it. | | locale | `string` | "en-US" | no | BCP 47 locale for Intl.NumberFormat. | | fractionDigits | `number` | 0 | no | Fixed number of fraction digits, from 0 through 6. | | prefix | `string` | "" | no | Text before the localized number. | | suffix | `string` | "" | no | Text after the localized number. | | announce | `boolean` | false | no | Announces the final value after updates. Enable for infrequent changes. | | once | `boolean` | false | no | Counts up once from `from` to `value` when the number first scrolls into view (60% visible). The HTML holds the final value, so it is static without JavaScript and instant under reduced motion. | | from | `number` | 0 | no | Starting number for the once count-up. Ignored unless once is set. | | class | `string` | | no | Additional classes on the inline number. | ## Accessibility - Assistive technology reads the final value. Animation layers are hidden from its tree. - The once count-up leaves the final value in the accessible text from the start. - Keep motion off for reduced-motion users and reserve live announcements for user-relevant updates. ## Agent prompts ### Install and use Install the Haze UI component "Animated number" with `npx shadcn@latest add @haze/animated-number`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AnimatedNumber from "@/components/haze/ui/animated-number.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/animated-number.md ### Customize with real content Adapt the Haze animated-number ui for our product. Replace the demo values of these props with our real content: value, locale, fractionDigits, prefix, suffix, announce, once, from, class. Keep the layout, the heading level rules and these accessibility details: Assistive technology reads the final value. Animation layers are hidden from its tree. The once count-up leaves the final value in the accessible text from the start. Keep motion off for reduced-motion users and reserve live announcements for user-relevant updates. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using animated-number, check it fits: use it when a metric or count changes in response to an action or a new reading; the initial value should be readable immediately. Avoid it when the number never changes. use stat.; the per-step intermediate values carry meaning.. Alternatives: @haze/stat, @haze/sparkline. ## Example requests that should lead here - Show a job counter that animates on value changes and announces the result when the user adds a batch. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Props { value?: number; locale?: string; fractionDigits?: number; prefix?: string; suffix?: string; announce?: boolean; /** Counts up once from `from` to `value` when it first scrolls into view. Static final value without JS. */ once?: boolean; from?: number; class?: string; } const { value = 128, locale = "en-US", fractionDigits = 0, prefix = "", suffix = "", announce = false, once = false, from = 0, class: className, } = Astro.props; const digits = Number.isFinite(fractionDigits) ? Math.min(6, Math.max(0, Math.trunc(fractionDigits))) : 0; const number = Number.isFinite(value) ? value : 0; const formatter = new Intl.NumberFormat(locale, { minimumFractionDigits: digits, maximumFractionDigits: digits }); const start = Number.isFinite(from) ? from : 0; const formatted = `${prefix}${formatter.format(number)}${suffix}`; --- {formatted} ``` --- # Announcement pill > A small pill link with an optional leading tag and a trailing arrow, set above a hero headline to point at a release or news item. - Kind: ui · Category: Actions · Interactivity: none - Install: `npx shadcn@latest add @haze/announcement-pill` - File: `src/components/haze/ui/announcement-pill.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/tag, @haze/utils - Docs page: https://hazeui.com/ui/announcement-pill ## Use when - A hero headline needs one short pointer to a release, changelog entry or launch post above it. - A feature or beta label should sit next to a one-line teaser that links onward. - The pointer should stay inline with the page, not span the full width. ## Avoid when - The message is a site-wide or dismissible notice across the top of the page; use banner. - The label is only a status or count with no destination; use badge or tag. - The action is the main call to action of the page; use button. ## Alternatives - [banner](https://hazeui.com/ui/banner.md) - [badge](https://hazeui.com/ui/badge.md) - [tag](https://hazeui.com/ui/tag.md) - [button](https://hazeui.com/ui/button.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | href | `string` | "#changelog" | no | Destination of the whole pill. Always rendered as a real link. | | text | `string` | "Ledgerline 4.2 adds bank rules" | no | Announcement text. It wraps onto a second line on narrow screens. | | tag | `string` | "New" | no | Short leading tag. Pass an empty string to hide it. | | variant | `"default" \| "brand"` | "default" | no | Neutral pill or an emphasised muted pill with a solid tag. | | arrow | `boolean` | true | no | Shows the trailing arrow, which nudges 2 px right on hover. | | class | `string` | | no | Extra classes, merged with tailwind-merge. | | ...attributes | `HTML anchor attributes` | | no | Passed to the : target, rel, aria-label and so on. | ## Accessibility - The whole pill is one anchor, so the tag, text and arrow read as a single link name such as "New Ledgerline 4.2 adds bank rules". - The arrow is decorative and hidden from assistive technology; the tag text is part of the link name, so keep it meaningful. - The pill is at least 28 px tall and has a visible focus ring. The muted fill keeps 4.5:1 text contrast. - The arrow nudge and the press scale are switched off under prefers-reduced-motion. - Key Enter: Follow the link ## Agent prompts ### Install and use Install the Haze UI component "Announcement pill" with `npx shadcn@latest add @haze/announcement-pill`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AnnouncementPill from "@/components/haze/ui/announcement-pill.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/announcement-pill.md ### Customize with real content Adapt the Haze announcement-pill ui for our product. Replace the demo values of these props with our real content: href, text, tag, variant, arrow, class, ...attributes. Keep the layout, the heading level rules and these accessibility details: The whole pill is one anchor, so the tag, text and arrow read as a single link name such as "New Ledgerline 4.2 adds bank rules". The arrow is decorative and hidden from assistive technology; the tag text is part of the link name, so keep it meaningful. The pill is at least 28 px tall and has a visible focus ring. The muted fill keeps 4.5:1 text contrast. The arrow nudge and the press scale are switched off under prefers-reduced-motion. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using announcement-pill, check it fits: use it when a hero headline needs one short pointer to a release, changelog entry or launch post above it.; a feature or beta label should sit next to a one-line teaser that links onward.; the pointer should stay inline with the page, not span the full width.. Avoid it when the message is a site-wide or dismissible notice across the top of the page; use banner.; the label is only a status or count with no destination; use badge or tag.; the action is the main call to action of the page; use button.. Alternatives: @haze/banner, @haze/badge, @haze/tag, @haze/button. ## Example requests that should lead here - Put an announcement pill above the hero headline that links to the 4.2 release notes. - Add a brand-tinted pill with a Beta tag and no arrow above the page title. - Show a pill that says what is new and wraps cleanly on a phone. ## Source ```astro --- import { ArrowRight } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Tag from "./tag.astro"; interface Props { /** Where the pill leads, for example a changelog entry. Optional with a demo default ("#changelog"); the whole pill is one link. */ href?: string; /** The announcement text. It wraps on narrow screens instead of being cut off. */ text?: string; /** Short leading tag such as "New". Pass an empty string to leave it out. */ tag?: string; /** default: neutral pill. brand: emphasised muted pill, for the one announcement that should stand out. */ variant?: "default" | "brand"; /** Trailing arrow that nudges right on hover. Decorative. */ arrow?: boolean; class?: string; /** Any other anchor attribute, for example target, rel or aria-label. */ [key: string]: unknown; } const { href = "#changelog", text = "Ledgerline 4.2 adds bank rules", tag = "New", variant = "default", arrow = true, class: className, ...rest } = Astro.props; const variants = { default: "border-frame bg-field text-foreground hover:border-frame-strong hover:bg-accent", brand: "border-frame-strong bg-muted text-foreground hover:bg-accent", }; --- {tag && {tag}} {text} { arrow && ( ``` --- # Activity rings card > High-impact concentric triple progress rings with bold rounded strokes, subtle halo depth, and minimal color-matched tabular readouts. - Kind: ui · Category: Data display · Interactivity: none - Install: `npx shadcn@latest add @haze/apple-activity-card` - File: `src/components/haze/ui/apple-activity-card.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/apple-activity-card ## Use when - A summary card tracks three concurrent daily or sprint goals against numeric targets at a glance - You want an iconic radial ring graphic paired with clean tabular-nums ratios and units ## Avoid when - Only a single completion percentage is needed. Use progress-ring. - Parts add up to a shared 100% total rather than independent targets. Use donut-chart. ## Alternatives - [progress-ring](https://hazeui.com/ui/progress-ring.md) - [donut-chart](https://hazeui.com/ui/donut-chart.md) - [usage-meter](https://hazeui.com/ui/usage-meter.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | title | `string` | "Activity Rings" | no | Centered card heading text. | | rings | `{ label: string; value: number; target: number; unit: string; tone?: "destructive" \| "success" \| "brand" \| "warning" }[]` | | no | Up to three concentric activity rings ordered from outer to inner. | | headingLevel | `2 \| 3 \| 4` | 3 | no | Heading level for the card title. | | class | `string` | | no | Additional classes on the outer card element. | ## Accessibility - The concentric rings SVG exposes role="img", aria-label, and an embedded summarizing all three rings. - Each numeric readout row carries role="progressbar" with aria-valuemin, aria-valuemax, aria-valuenow, and aria-valuetext so progress is never conveyed by color alone. ## Agent prompts ### Install and use Install the Haze UI component "Activity rings card" with `npx shadcn@latest add @haze/apple-activity-card`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AppleActivityCard from "@/components/haze/ui/apple-activity-card.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/apple-activity-card.md ### Customize with real content Adapt the Haze apple-activity-card ui for our product. Replace the demo values of these props with our real content: title, rings, headingLevel, class. Keep the layout, the heading level rules and these accessibility details: The concentric rings SVG exposes role="img", aria-label, and an embedded <title> summarizing all three rings. Each numeric readout row carries role="progressbar" with aria-valuemin, aria-valuemax, aria-valuenow, and aria-valuetext so progress is never conveyed by color alone. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using apple-activity-card, check it fits: use it when a summary card tracks three concurrent daily or sprint goals against numeric targets at a glance; you want an iconic radial ring graphic paired with clean tabular-nums ratios and units. Avoid it when only a single completion percentage is needed. use progress-ring.; parts add up to a shared 100% total rather than independent targets. use donut-chart.. Alternatives: @haze/progress-ring, @haze/donut-chart, @haze/usage-meter. ## Example requests that should lead here - Show a three-ring Activity Rings card tracking Move calories, Exercise minutes, and Stand hours. - Build a concentric activity rings card summarizing daily Focus, Active, and Stand targets. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; type RingTone = "destructive" | "success" | "brand" | "warning"; interface ActivityRing { label: string; value: number; target: number; unit: string; tone?: RingTone; } interface Props { title?: string; rings?: ActivityRing[]; headingLevel?: 2 | 3 | 4; class?: string; } const { title = "Activity Rings", rings = [ { label: "Move", value: 456, target: 800, unit: "CAL", tone: "destructive" }, { label: "Exercise", value: 33, target: 30, unit: "MIN", tone: "success" }, { label: "Stand", value: 9, target: 12, unit: "HR", tone: "brand" }, ], headingLevel = 3, class: className, } = Astro.props; const Heading = ({ 2: "h2", 3: "h3", 4: "h4" } as const)[headingLevel]; const defaultTones: RingTone[] = ["destructive", "success", "brand"]; const radii = [75, 56, 37]; const textTone: Record<RingTone, string> = { destructive: "text-destructive", success: "text-success", brand: "text-brand", warning: "text-warning", }; const fmt = new Intl.NumberFormat("en", { maximumFractionDigits: 1 }); const normalized = rings.slice(0, 3).map((ring, index) => { const safeTarget = Number.isFinite(ring.target) && ring.target > 0 ? ring.target : 1; const safeValue = Number.isFinite(ring.value) && ring.value > 0 ? ring.value : 0; const rawPct = Math.round((safeValue / safeTarget) * 100); const fillPct = Math.min(100, rawPct); const overflowPct = rawPct > 100 ? Math.min(85, rawPct - 100) : 0; const tone = ring.tone ?? defaultTones[index % defaultTones.length]!; return { ...ring, safeTarget, safeValue, rawPct, fillPct, overflowPct, radius: radii[index]!, tone, }; }); const svgSummary = normalized.length ? `${title}: ${normalized .map((r) => `${r.label} ${fmt.format(r.safeValue)} of ${fmt.format(r.safeTarget)} ${r.unit} (${r.rawPct}%)`) .join(", ")}.` : `${title}: no activity rings configured.`; --- <article class={cn( "w-full max-w-[380px] min-w-0 rounded-xl border border-border bg-card p-6 text-card-foreground", className, )} > <Heading class="mb-5 text-center text-[1.0625rem]/6 font-semibold tracking-tight text-card-foreground wrap-anywhere"> {title} </Heading> { normalized.length > 0 && ( <div class="flex min-w-0 flex-col items-center justify-center gap-6 sm:flex-row"> <svg role="img" aria-label={svgSummary} viewBox="0 0 180 180" class="size-40 shrink-0 -rotate-90 sm:size-44" > <title>{svgSummary} {normalized.map((ring) => ( {ring.fillPct > 0 && ( )} {ring.overflowPct > 0 && ( <> {/* The lap past 100 %: a card-coloured outline 1.5 px wider than the ring separates its rounded end from the ring below (no shadow). */} )} ))}
    {normalized.map((ring) => (
  • {ring.label} {fmt.format(ring.safeValue)}/{fmt.format(ring.safeTarget)} {ring.unit}
  • ))}
) } ``` --- # Area chart > Multi-series SVG area chart with filled bands, series toggles, pointer crosshair scrubber, and accessible data table fallback. - Kind: ui · Category: Data display · Interactivity: script - Install: `npx shadcn@latest add @haze/area-chart` - File: `src/components/haze/ui/area-chart.astro` - npm dependencies: none - Registry dependencies: @haze/collapsible, @haze/table, @haze/utils - Docs page: https://hazeui.com/ui/area-chart ## Use when - Visualizing cumulative or volume trends over time - Comparing one primary metric against a baseline with shaded area fills ## Avoid when - Discrete categorical comparisons belong in bar-chart - Single inline numeric trends with no axes belong in sparkline ## Alternatives - [line-chart](https://hazeui.com/ui/line-chart.md) - [bar-chart](https://hazeui.com/ui/bar-chart.md) - [streamgraph](https://hazeui.com/ui/streamgraph.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | label | `string` | "Monthly active workspaces" | no | Chart heading. | | data | `Datum[]` | | no | Time-series points with named numeric values. | | series | `Series[]` | | no | Series definitions controlling tone, label, and optional dashed line. | | unit | `string` | "" | no | Optional unit suffix shown after readouts. | | class | `string` | | no | Extra classes. | ## Accessibility - Keyboard users can inspect points via an underlying range input alongside the collapsible data table. - Series toggle pills expose aria-pressed state and keep non-color line style distinctions. - Key ArrowLeft / ArrowRight: Step through time buckets when the plot slider is focused. ## Agent prompts ### Install and use Install the Haze UI component "Area chart" with `npx shadcn@latest add @haze/area-chart`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AreaChart from "@/components/haze/ui/area-chart.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/area-chart.md ### Customize with real content Adapt the Haze area-chart ui for our product. Replace the demo values of these props with our real content: label, data, series, unit, class. Keep the layout, the heading level rules and these accessibility details: Keyboard users can inspect points via an underlying range input alongside the collapsible data table. Series toggle pills expose aria-pressed state and keep non-color line style distinctions. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using area-chart, check it fits: use it when visualizing cumulative or volume trends over time; comparing one primary metric against a baseline with shaded area fills. Avoid it when discrete categorical comparisons belong in bar-chart; single inline numeric trends with no axes belong in sparkline. Alternatives: @haze/line-chart, @haze/bar-chart, @haze/streamgraph. ## Example requests that should lead here - Add a multi-series area chart showing active workspaces vs trials with interactive hover inspection ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; import Collapsible from "./collapsible.astro"; import Table from "./table.astro"; type Tone = "brand" | "neutral" | "success" | "warning" | "destructive"; interface Series { key: string; label: string; tone?: Tone; dashed?: boolean; } interface Datum { label: string; values: Record; } interface Props { label?: string; data?: Datum[]; series?: Series[]; unit?: string; categoryLabel?: string; detailsLabel?: string; emptyLabel?: string; class?: string; } const { label = "Monthly active workspaces", unit = "", categoryLabel = "Month", detailsLabel = "View data", emptyLabel = "No measurements for this period.", class: className, series = [ { key: "active", label: "Active", tone: "brand" }, { key: "trial", label: "Trial", tone: "success", dashed: true }, ], data = [ { label: "Apr", values: { active: 1420, trial: 410 } }, { label: "May", values: { active: 1680, trial: 495 } }, { label: "Jun", values: { active: 1940, trial: 560 } }, { label: "Jul", values: { active: 2290, trial: 640 } }, { label: "Aug", values: { active: 2740, trial: 710 } }, { label: "Sep", values: { active: 3180, trial: 820 } }, ], } = Astro.props; const strokeTones: Record = { brand: "stroke-brand bg-brand", neutral: "stroke-muted-foreground bg-muted-foreground", success: "stroke-success bg-success", warning: "stroke-warning bg-warning", destructive: "stroke-destructive bg-destructive", }; const fillTones: Record = { brand: "fill-brand/14", neutral: "fill-foreground/8", success: "fill-success/14", warning: "fill-warning/14", destructive: "fill-destructive/14", }; const defaults: Tone[] = ["brand", "success", "neutral", "warning", "destructive"]; const seenKeys = new Set(); const fields = series .filter(({ key }) => { if (!key || seenKeys.has(key)) return false; seenKeys.add(key); return true; }) .map((field, index) => { const tone = field.tone ?? defaults[index % defaults.length]; return { ...field, strokeCls: strokeTones[tone], fillCls: fillTones[tone] }; }); const numeric = data.map(({ label: period, values }) => ({ label: period, values: fields.map(({ key }) => { const v = values[key]; return typeof v === "number" && Number.isFinite(v) ? v : null; }), })); let lowest = Infinity; let highest = -Infinity; for (const row of numeric) { for (const val of row.values) { if (val === null) continue; lowest = Math.min(lowest, val); highest = Math.max(highest, val); } } lowest = Number.isFinite(lowest) ? Math.min(0, lowest) : 0; const available = Number.isFinite(highest); const span = available ? highest - lowest || 1 : 1; const y = (val: number) => 6 + 88 * ((highest - val) / span); const baselineY = y(0); const grouped = new Intl.NumberFormat("en"); const compact = new Intl.NumberFormat("en", { notation: "compact", maximumSignificantDigits: 3 }); const tickLabel = (val: number) => { const txt = compact.format(val); return txt.length > 10 ? val.toExponential(2) : txt; }; const format = (val: number) => `${Number.isSafeInteger(val) ? grouped.format(val) : String(val)}${unit ? ` ${unit}` : ""}`; const points = numeric.map((row, index) => ({ label: row.label, x: numeric.length === 1 ? 50 : (index * 100) / (numeric.length - 1), values: row.values.map((val) => (val === null ? { text: "—", y: null } : { text: format(val), y: y(val) })), })); const shapes = fields.map((_, fi) => { const pts = points .map((pt) => ({ x: pt.x, y: pt.values[fi].y })) .filter((pt): pt is { x: number; y: number } => pt.y !== null); if (!pts.length) return { line: "", area: "" }; const line = pts.map((pt, i) => `${i === 0 ? "M" : "L"}${pt.x.toFixed(2)},${pt.y.toFixed(2)}`).join(" "); const area = `${line} L${pts.at(-1)!.x.toFixed(2)},${baselineY.toFixed(2)} L${pts[0].x.toFixed(2)},${baselineY.toFixed(2)} Z`; return { line, area }; }); const last = points.at(-1); const ticks = !available ? [] : highest === lowest ? [highest] : [highest, (highest + lowest) / 2, lowest]; const tableColumns = [ { key: "category", label: categoryLabel }, ...fields.map((field, index) => ({ key: `s${index}`, label: field.label, align: "right" as const })), ]; const tableRows = points.map((pt) => Object.fromEntries([["category", pt.label], ...pt.values.map((v, idx) => [`s${idx}`, v.text])]), ); ---
{label} {available && last && {last.label}}
{ available && last ? ( <>
    {fields.map((field, index) => (
  • ))}
{points[0].label} {points.length > 1 && {points[points.length - 1].label}}
) : (

{emptyLabel}

) } ``` --- # Aspect ratio > Box that holds a fixed width-to-height ratio and clips its child, which is stretched and cropped to cover it. - Kind: ui · Category: Layout and media · Interactivity: none - Install: `npx shadcn@latest add @haze/aspect-ratio` - File: `src/components/haze/ui/aspect-ratio.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/aspect-ratio ## Use when - Reserving space for an image or video so the page does not jump while it loads - A grid of thumbnails that must all share one shape - An iframe embed that should keep 16:9 at any width ## Avoid when - Text content, whose height must follow its length - An image that must never be cropped; give it width and height attributes and let it size itself ## Alternatives - [placeholder](https://hazeui.com/ui/placeholder.md) - [skeleton](https://hazeui.com/ui/skeleton.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | ratio | `"16/9" \| "4/3" \| "1/1" \| "21/9" \| "3/4"` | "16/9" | no | Width to height ratio. Each value maps to a full Tailwind aspect class. | | rounded | `boolean` | true | no | Rounds the corners with rounded-xl. The box clips its child either way. | | class | `string` | | no | Extra classes on the box. | | default slot | `slot` | | yes | One image, video, iframe or placeholder. Direct children get size-full and object-cover. | ## Accessibility - The wrapper adds no role and no name; the media inside carries the alt text, the iframe title or the placeholder label. - object-cover crops the edges, so keep the subject of an image away from the border or the crop can hide it. - A video inside keeps its own controls; the box only clips it and does not intercept pointer or keyboard input. ## Agent prompts ### Install and use Install the Haze UI component "Aspect ratio" with `npx shadcn@latest add @haze/aspect-ratio`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AspectRatio from "@/components/haze/ui/aspect-ratio.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/aspect-ratio.md ### Customize with real content Adapt the Haze aspect-ratio ui for our product. Replace the demo values of these props with our real content: ratio, rounded, class, default slot. Keep the layout, the heading level rules and these accessibility details: The wrapper adds no role and no name; the media inside carries the alt text, the iframe title or the placeholder label. object-cover crops the edges, so keep the subject of an image away from the border or the crop can hide it. A video inside keeps its own controls; the box only clips it and does not intercept pointer or keyboard input. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using aspect-ratio, check it fits: use it when reserving space for an image or video so the page does not jump while it loads; a grid of thumbnails that must all share one shape; an iframe embed that should keep 16:9 at any width. Avoid it when text content, whose height must follow its length; an image that must never be cropped; give it width and height attributes and let it size itself. Alternatives: @haze/placeholder, @haze/skeleton. ## Example requests that should lead here - Put the hero image in a 16:9 box with rounded corners - Make a row of square thumbnails with the aspect ratio component ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Props { ratio?: "16/9" | "4/3" | "1/1" | "21/9" | "3/4"; /** Rounds the corners (the box always clips its child). */ rounded?: boolean; class?: string; } const { ratio = "16/9", rounded = true, class: className } = Astro.props; const ratios = { "16/9": "aspect-video", "4/3": "aspect-[4/3]", "1/1": "aspect-square", "21/9": "aspect-[21/9]", "3/4": "aspect-[3/4]", }; ---
*]:size-full [&>*]:object-cover", ratios[ratio], rounded && "rounded-xl", className)}>
``` --- # Attachment > A file chip or card with a type icon, a middle-truncated name, size, upload progress, an error state and a remove button. - Kind: ui · Category: Data display · Interactivity: none - Install: `npx shadcn@latest add @haze/attachment` - File: `src/components/haze/ui/attachment.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/placeholder, @haze/progress, @haze/utils - Docs page: https://hazeui.com/ui/attachment ## Use when - Files queued under a message box or attached to a sent message - A list of downloadable documents, each with its size - Showing one file's upload progress or error next to its name ## Avoid when - The user still has to choose the files. Use file-upload or file-input. - You show a person's profile picture. Use avatar or avatar-upload. ## Alternatives - [file-upload](https://hazeui.com/ui/file-upload.md) - [file-input](https://hazeui.com/ui/file-input.md) - [chip](https://hazeui.com/ui/chip.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | name | `string` | | yes | Full file name with extension; the accessible name and tooltip. The visible text is cut in the middle so the end stays readable. | | bytes | `number` | | no | Size in bytes, shown as B, KB or MB. | | type | `string` | "" | no | MIME type; with the extension it picks the icon (image, document, sheet, code, archive or generic). | | variant | `"chip" \| "card"` | "chip" | no | Compact inline chip or a larger card. | | state | `"uploading" \| "ready" \| "error"` | "ready" | no | Uploading shows a progress bar, error shows the message in the destructive color with a warning icon. | | progress | `number` | | no | 0 to 100. Leave out while uploading for a bar with no value. | | errorMessage | `string` | "Upload failed" | no | Text of the error state. | | href | `string` | | no | Turns the name into a download link. | | removable | `boolean` | false | no | Adds a remove button with data-attachment-remove; the action is yours to wire. | | removeLabel | `string` | "Remove {name}" | no | Accessible name of the remove button; {name} becomes the file name. | | progressLabel | `string` | "Uploading {name}" | no | Accessible name of the progress bar. | | preview | `boolean` | | no | Card only: shows a picture placeholder on top. Defaults to true for images. | | previewLabel | `string` | "" | no | Describes the real preview image; leave empty while it is a placeholder. | | class | `string` | | no | Extra classes on the root. | | ...rest | `HTML attributes` | | no | Passed to the root element. | ## Accessibility - The full file name is in the accessible name and the tooltip; the visibly shortened text is hidden from assistive technology so it is not read twice. - Upload progress is a progressbar named with the file name and shows the percentage as text, and the error state has an icon and a message, so neither relies on color. - The remove button is named "Remove " so several chips stay distinguishable, and it is 28 px square. - Key Tab: Move to the download link, then to the remove button. - Key Enter: Follow the download link or activate the remove button. ## Agent prompts ### Install and use Install the Haze UI component "Attachment" with `npx shadcn@latest add @haze/attachment`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Attachment from "@/components/haze/ui/attachment.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/attachment.md ### Customize with real content Adapt the Haze attachment ui for our product. Replace the demo values of these props with our real content: name, bytes, type, variant, state, progress, errorMessage, href, removable, removeLabel, progressLabel, preview, previewLabel, class, ...rest. Keep the layout, the heading level rules and these accessibility details: The full file name is in the accessible name and the tooltip; the visibly shortened text is hidden from assistive technology so it is not read twice. Upload progress is a progressbar named with the file name and shows the percentage as text, and the error state has an icon and a message, so neither relies on color. The remove button is named "Remove " so several chips stay distinguishable, and it is 28 px square. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using attachment, check it fits: use it when files queued under a message box or attached to a sent message; a list of downloadable documents, each with its size; showing one file's upload progress or error next to its name. Avoid it when the user still has to choose the files. use file-upload or file-input.; you show a person's profile picture. use avatar or avatar-upload.. Alternatives: @haze/file-upload, @haze/file-input, @haze/chip. ## Example requests that should lead here - Show the files attached to a message as chips, one still uploading at 62 percent and one that failed. ## Source ```astro --- import { CircleAlert, File, FileArchive, FileCode, FileImage, FileSpreadsheet, FileText, X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Placeholder from "./placeholder.astro"; import Progress from "./progress.astro"; interface Props { /** Full file name with its extension. It is the accessible name and the tooltip. */ name: string; /** Size in bytes; shown as B, KB or MB. Leave out to hide it. */ bytes?: number; /** MIME type such as "application/pdf". Together with the extension it picks the icon. */ type?: string; variant?: "chip" | "card"; /** uploading shows the progress bar, error shows the message, ready shows the size. */ state?: "uploading" | "ready" | "error"; /** Upload progress from 0 to 100. Leave out while uploading for a bar with no value. */ progress?: number; /** Text shown in the error state. */ errorMessage?: string; /** Makes the name a download link. */ href?: string; /** Adds a remove button. It is a plain type="button" with data-attachment-remove; wire the action yourself. */ removable?: boolean; /** Accessible name of the remove button. `{name}` is replaced by the file name. */ removeLabel?: string; /** Accessible name of the progress bar. `{name}` is replaced by the file name. */ progressLabel?: string; /** Card only: shows a picture placeholder above the details. Defaults to true for images. */ preview?: boolean; /** Card only: describes the real preview image. Leave empty while it is only a placeholder. */ previewLabel?: string; class?: string; [key: string]: unknown; } const { name, bytes, type = "", variant = "chip", state = "ready", progress, errorMessage = "Upload failed", href, removable = false, removeLabel = "Remove {name}", progressLabel = "Uploading {name}", preview, previewLabel = "", class: className, ...rest } = Astro.props; const ext = (name.includes(".") ? name.split(".").pop() ?? "" : "").toLowerCase(); const is = (mime: RegExp, exts: string[]) => mime.test(type) || exts.includes(ext); const kind = is(/^image\//, ["png", "jpg", "jpeg", "gif", "webp", "svg", "avif", "heic"]) ? "image" : is(/spreadsheet|excel|csv/, ["xls", "xlsx", "csv", "tsv", "ods", "numbers"]) ? "sheet" : is(/pdf|msword|wordprocessing|^text\/(plain|markdown)/, ["pdf", "doc", "docx", "txt", "md", "rtf", "odt"]) ? "document" : is(/zip|compressed|tar|gzip|7z|rar/, ["zip", "tar", "gz", "7z", "rar", "tgz"]) ? "archive" : is(/json|javascript|typescript|xml|html|css|x-sh/, ["js", "ts", "tsx", "jsx", "json", "html", "css", "py", "go", "rs", "sh", "xml", "yml", "yaml"]) ? "code" : "file"; const icons = { image: FileImage, sheet: FileSpreadsheet, document: FileText, archive: FileArchive, code: FileCode, file: File }; const Icon = state === "error" ? CircleAlert : icons[kind]; function formatSize(n: number) { if (n < 1024) return `${n} B`; if (n < 1024 * 1024) return `${Math.round(n / 1024)} KB`; return `${(n / (1024 * 1024)).toFixed(1).replace(/\.0$/, "")} MB`; } const sizeText = typeof bytes === "number" && Number.isFinite(bytes) && bytes >= 0 ? formatSize(bytes) : ""; // Middle truncation: the tail (end of the stem plus the extension) never shrinks, the head gives way with an ellipsis. const tailLength = Math.min(name.length > 14 ? 9 : 0, name.length); const head = name.slice(0, name.length - tailLength); const tail = name.slice(name.length - tailLength); const uploading = state === "uploading"; const percent = typeof progress === "number" ? Math.round(Math.min(Math.max(progress, 0), 100)) : undefined; const meta = state === "error" ? errorMessage : uploading ? (percent === undefined ? "" : `${percent}%`) : sizeText; const card = variant === "card"; const showPreview = card && (preview ?? kind === "image"); const fill = (text: string) => text.replaceAll("{name}", name); ---
{showPreview && }
{ href ? ( {name} ) : (

{name}

) } {meta &&

{meta}

}
{ removable && ( ) }
{ uploading && (
) }
``` --- # Autocomplete > Free-text input with grouped typeahead suggestions, clear and browse controls, and a native datalist fallback. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/autocomplete` - File: `src/components/haze/ui/autocomplete.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/autocomplete ## Use when - Typing tags, commands, or custom strings while offering quick filtered suggestions - Allowing users to keep custom typed values alongside saved recommendations - Replacing basic browser datalist inputs with keyboard-navigable grouped menus ## Avoid when - Users must pick strictly from a fixed list of options; use combobox or select - Selecting multiple discrete tags into chips; use tags-input ## Alternatives - [combobox](https://hazeui.com/ui/combobox.md) - [search-field](https://hazeui.com/ui/search-field.md) - [tags-input](https://hazeui.com/ui/tags-input.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique id for the input and derived listbox and datalist ids. | | name | `string` | | no | Submitted form field name; defaults to id. | | label | `string` | "Model or tag" | no | Visible label associated with the input. | | value | `string` | "" | no | Initial text value. | | placeholder | `string` | "Search models..." | no | Placeholder hint shown when empty. | | suggestions | `{ value: string; label?: string; hint?: string; group?: string }[]` | | no | Grouped or flat suggestion entries. | | size | `"sm" \| "md" \| "lg"` | "md" | no | Field height matching Haze input sizing. | | leadingIcon | `boolean` | true | no | Displays a search icon at the start of the field. | | showClear | `boolean` | true | no | Displays a clear button whenever the field contains text. | | showTrigger | `boolean` | true | no | Displays a chevron button to browse all suggestions. | | required | `boolean` | false | no | Marks the underlying input as required. | | disabled | `boolean` | false | no | Disables typing, clearing, and opening suggestions. | | class | `string` | | no | Extra classes on the outer container. | ## Accessibility - Progressive enhancement strips native datalist and promotes the input to role="combobox" with aria-autocomplete="list" and aria-activedescendant. - Users can freely type and submit custom text or confirm a highlighted suggestion with Enter. - Clicking the clear button clears the field and returns keyboard focus directly to the input. - Key Down / Up: Open suggestions and cycle through visible matches - Key Enter: Accept the highlighted suggestion (or submit form when closed) - Key Escape: Close the suggestion popover while keeping typed text ## Agent prompts ### Install and use Install the Haze UI component "Autocomplete" with `npx shadcn@latest add @haze/autocomplete`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Autocomplete from "@/components/haze/ui/autocomplete.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/autocomplete.md ### Customize with real content Adapt the Haze autocomplete ui for our product. Replace the demo values of these props with our real content: id, name, label, value, placeholder, suggestions, size, leadingIcon, showClear, showTrigger, required, disabled, class. Keep the layout, the heading level rules and these accessibility details: Progressive enhancement strips native datalist and promotes the input to role="combobox" with aria-autocomplete="list" and aria-activedescendant. Users can freely type and submit custom text or confirm a highlighted suggestion with Enter. Clicking the clear button clears the field and returns keyboard focus directly to the input. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using autocomplete, check it fits: use it when typing tags, commands, or custom strings while offering quick filtered suggestions; allowing users to keep custom typed values alongside saved recommendations; replacing basic browser datalist inputs with keyboard-navigable grouped menus. Avoid it when users must pick strictly from a fixed list of options; use combobox or select; selecting multiple discrete tags into chips; use tags-input. Alternatives: @haze/combobox, @haze/search-field, @haze/tags-input. ## Example requests that should lead here - Add an Autocomplete field for deployment region with regional latency hints - Create a model picker input that allows custom model strings alongside suggested defaults ## Source ```astro --- import { ChevronsUpDown, Search, X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Suggestion { value: string; label?: string; hint?: string; group?: string; } interface Props { id: string; name?: string; label?: string; value?: string; placeholder?: string; suggestions?: Suggestion[]; size?: "sm" | "md" | "lg"; /** Shows a leading search icon inside the text field. */ leadingIcon?: boolean; /** Shows a clear button while the field holds text. */ showClear?: boolean; /** Shows a toggle button to browse all suggestions without typing first. */ showTrigger?: boolean; required?: boolean; disabled?: boolean; class?: string; [key: string]: unknown; } const { id, name = id, label = "Model or tag", value = "", placeholder = "Search models...", suggestions = [ { value: "gpt-4.1", label: "GPT-4.1", hint: "General", group: "Recommended" }, { value: "claude-sonnet-4", label: "Claude Sonnet 4", hint: "Code", group: "Recommended" }, { value: "gemini-2.5-pro", label: "Gemini 2.5 Pro", hint: "Reasoning", group: "Recommended" }, { value: "llama-3.3-70b", label: "Llama 3.3 70B", hint: "Open weights", group: "Self-hosted" }, { value: "qwen-2.5-coder", label: "Qwen 2.5 Coder", hint: "Open weights", group: "Self-hosted" }, ], size = "md", leadingIcon = true, showClear = true, showTrigger = true, required = false, disabled = false, class: className, ...rest } = Astro.props; const heights = { sm: "h-8 text-xs/5", md: "h-10 text-sm/5", lg: "h-11 text-sm/5", }; const rightPad = showClear && showTrigger ? "pe-16" : showClear || showTrigger ? "pe-9" : "pe-3"; // Group suggestions preserving first-seen group order. const grouped: { name: string; items: (Suggestion & { index: number })[] }[] = []; const byGroup = new Map(); suggestions.forEach((s, index) => { const g = s.group ?? ""; let list = byGroup.get(g); if (!list) { list = []; byGroup.set(g, list); grouped.push({ name: g, items: list }); } list.push({ ...s, index }); }); ---
{ leadingIcon && (
{ grouped.map((group) => (
{group.name && (

{group.name}

)} {group.items.map((item) => ( ))}
)) }
``` --- # Avatar group > Overlapping row of avatars that collapses extra people into a "+N" chip after a chosen limit. - Kind: ui · Category: Data display · Interactivity: none - Install: `npx shadcn@latest add @haze/avatar-group` - File: `src/components/haze/ui/avatar-group.astro` - npm dependencies: none - Registry dependencies: @haze/avatar, @haze/utils - Docs page: https://hazeui.com/ui/avatar-group ## Use when - Showing who is on a project, a document or a meeting in a small space - Teams of unknown size, where only the first few faces fit - Cards and table rows that need a compact member list ## Avoid when - Readers need every name in view; list the people instead - A single person; use avatar ## Alternatives - [avatar](https://hazeui.com/ui/avatar.md) - [tag](https://hazeui.com/ui/tag.md) - [item](https://hazeui.com/ui/item.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | people | `{ name: string; src?: string }[]` | | yes | People in order; each avatar shows the initials of its name, or the photo when src is set. | | max | `number` | 4 | no | Avatars shown before the overflow chip. | | size | `"sm" \| "md" \| "lg"` | "md" | no | Passed to every avatar and to the chip. | | label | `string` | | no | Accessible name of the group; defaults to a member count such as "5 members". | | moreLabel | `string` | "more" | no | Screen-reader word after the overflow count, so "+4" is read as "4 more". Translate it for other languages. | | class | `string` | | no | Extra classes on the group. | ## Accessibility - The group has role="group" and a label with the full count, so the total is known even when the chip hides most names. - Each avatar is announced by its full name and the chip as "3 more" (or the moreLabel you pass); the initials alone are never the only text. - The ring in the page background keeps overlapping avatars distinct without relying on their fill colors. ## Agent prompts ### Install and use Install the Haze UI component "Avatar group" with `npx shadcn@latest add @haze/avatar-group`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AvatarGroup from "@/components/haze/ui/avatar-group.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/avatar-group.md ### Customize with real content Adapt the Haze avatar-group ui for our product. Replace the demo values of these props with our real content: people, max, size, label, moreLabel, class. Keep the layout, the heading level rules and these accessibility details: The group has role="group" and a label with the full count, so the total is known even when the chip hides most names. Each avatar is announced by its full name and the chip as "3 more" (or the moreLabel you pass); the initials alone are never the only text. The ring in the page background keeps overlapping avatars distinct without relying on their fill colors. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using avatar-group, check it fits: use it when showing who is on a project, a document or a meeting in a small space; teams of unknown size, where only the first few faces fit; cards and table rows that need a compact member list. Avoid it when readers need every name in view; list the people instead; a single person; use avatar. Alternatives: @haze/avatar, @haze/tag, @haze/item. ## Example requests that should lead here - Show five teammates as an avatar group with a plus chip - Use a small avatar group in the card footer labelled Reviewers ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; import Avatar from "./avatar.astro"; interface Props { /** People in order. src is an optional photo URL. */ people: { name: string; src?: string }[]; /** Most avatars to show before the "+N" chip. */ max?: number; size?: "sm" | "md" | "lg"; /** Accessible name of the group. Defaults to the member count. */ label?: string; /** Screen-reader word after the overflow count, so "+4" is read as "4 more". Translate it for other languages. */ moreLabel?: string; class?: string; } const { people, max = 4, size = "md", label, moreLabel = "more", class: className } = Astro.props; const limit = Math.max(Math.floor(max), 0); const shown = people.slice(0, limit); const extra = people.length - shown.length; const groupLabel = label ?? `${people.length} ${people.length === 1 ? "member" : "members"}`; const chipSizes = { sm: "size-6 text-[0.625rem]/4", md: "size-8 text-xs/4", lg: "size-10 text-sm/5" }; // Overlap scales with size; the 2 px background ring separates neighbours without touching the initials. const overlaps = { sm: "-space-x-1", md: "-space-x-1.5", lg: "-space-x-2" }; ---
{ shown.map((person) => ( )) } { extra > 0 && ( +{extra} ) }
``` --- # Avatar upload > Select a real profile image, preview and crop it locally, then submit the prepared PNG through a native file input. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/avatar-upload` - File: `src/components/haze/ui/avatar-upload.astro` - npm dependencies: none - Registry dependencies: @haze/slider, @haze/utils - Docs page: https://hazeui.com/ui/avatar-upload ## Use when - A profile form needs a local image preview and a square crop before submission. - Zoom and crop position should have native keyboard accessible controls. ## Avoid when - Use file-upload when multiple files or nonimage attachments are accepted. - Use avatar when the photo is display only. ## Alternatives - [file-upload](https://hazeui.com/ui/file-upload.md) - [avatar](https://hazeui.com/ui/avatar.md) - [slider](https://hazeui.com/ui/slider.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique caller supplied prefix for the control and its associated content. | | name | `string` | id | no | Name submitted by the native form control. | | label | `string` | Profile photo | no | Legend for the photo field and crop controls. | | initials | `string` | ML | no | Fallback initials shown without an image. | | src | `string` | | no | Optional previously saved photo to show before selecting a new file. | | maxBytes | `number` | 5242880 | no | Maximum accepted local file size. | | disabled | `boolean` | false | no | Prevents user changes through the native disabled state. | | required | `boolean` | false | no | Requires a new file through native form validation. | | class | `string` | | no | Additional classes on this component's outer wrapper. | | [key: string] | `unknown` | | no | Additional native file input attributes. | ## Accessibility - A labelled native file input remains visible and accepts PNG, JPEG and WebP; the preview image is decorative. - Zoom plus horizontal and vertical crop positions are native range inputs, so cropping has a complete keyboard path. - Type and size errors are reported in text and through native validity; no upload or progress is simulated. - Applying the crop prepares a 256 pixel PNG file in the file input and emits haze:avatar-change; submission and persistence belong to the caller's form. - Replacement, cancellation, reset and Astro page swaps revoke temporary object URLs. If the browser cannot replace the selected file, the original remains selected and the limitation is stated. - Key Enter / Space on the file input: Open the operating system file chooser. - Key Arrow keys on crop controls: Adjust zoom or crop position. - Key Tab, Enter / Space: Apply, cancel or remove the photo. ## Agent prompts ### Install and use Install the Haze UI component "Avatar upload" with `npx shadcn@latest add @haze/avatar-upload`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AvatarUpload from "@/components/haze/ui/avatar-upload.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/avatar-upload.md ### Customize with real content Adapt the Haze avatar-upload ui for our product. Replace the demo values of these props with our real content: id, name, label, initials, src, maxBytes, disabled, required, class, [key: string]. Keep the layout, the heading level rules and these accessibility details: A labelled native file input remains visible and accepts PNG, JPEG and WebP; the preview image is decorative. Zoom plus horizontal and vertical crop positions are native range inputs, so cropping has a complete keyboard path. Type and size errors are reported in text and through native validity; no upload or progress is simulated. Applying the crop prepares a 256 pixel PNG file in the file input and emits haze:avatar-change; submission and persistence belong to the caller's form. Replacement, cancellation, reset and Astro page swaps revoke temporary object URLs. If the browser cannot replace the selected file, the original remains selected and the limitation is stated. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using avatar-upload, check it fits: use it when a profile form needs a local image preview and a square crop before submission.; zoom and crop position should have native keyboard accessible controls.. Avoid it when use file-upload when multiple files or nonimage attachments are accepted.; use avatar when the photo is display only.. Alternatives: @haze/file-upload, @haze/avatar, @haze/slider. ## Example requests that should lead here - Add a profile photo input with local zoom and crop position controls - Prepare a square avatar PNG before submitting the profile form ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; import Slider from "./slider.astro"; interface Props { id: string; name?: string; label?: string; initials?: string; src?: string; maxBytes?: number; disabled?: boolean; required?: boolean; class?: string; [key: string]: unknown; } const { id, name = id, label = "Profile photo", initials = "ML", src, maxBytes = 5 * 1024 * 1024, disabled, required, class: className, ...rest } = Astro.props; const limit = Number.isFinite(maxBytes) && maxBytes > 0 ? maxBytes : 5 * 1024 * 1024; const button = "min-h-8 cursor-pointer rounded-lg border border-frame bg-field px-3 text-[0.8125rem]/5 font-medium text-foreground shadow-key transition-[background-color,scale] duration-150 ease-snappy hover:bg-accent focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring active:scale-[0.97] active:duration-75 motion-reduce:transition-none motion-reduce:active:scale-100 disabled:cursor-not-allowed disabled:opacity-50"; ---
{label}

PNG, JPEG or WebP. Up to {Math.round(limit / 1024 / 1024 * 10) / 10} MB. Images are prepared locally.

Submit your form to upload the selected file.

``` --- # Avatar (initials) > Round avatar in three sizes that shows initials or a photo, is labelled with the full name and can show a presence dot. - Kind: ui · Category: Data display · Interactivity: none - Install: `npx shadcn@latest add @haze/avatar` - File: `src/components/haze/ui/avatar.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/avatar ## Use when - Testimonials, team lists and comment threads - You do not have, or do not want to load, profile photos ## Avoid when - The person's face matters for recognition; use an image avatar ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | name | `string` | | yes | Full name; first letters of the first two words become the initials. | | size | `"sm" \| "md" \| "lg"` | "md" | no | 24, 32 or 40 px. | | src | `string` | | no | Photo URL. The image replaces the initials; the name stays the accessible name. | | status | `"online" \| "away"` | | no | Presence dot at the bottom right: green for online, muted for away. | | statusLabel | `string` | | no | Screen-reader text for the dot, for example "Online". It is read after the name. Without it the dot is not announced. | | class | `string` | | no | Extra classes. | ## Accessibility - Exposed as role="img" named with the full name, plus the statusLabel when a presence dot is shown. The dot itself is aria-hidden. If the name is already printed next to it, consider hiding the avatar to avoid double announcement. ## Agent prompts ### Install and use Install the Haze UI component "Avatar (initials)" with `npx shadcn@latest add @haze/avatar`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Avatar from "@/components/haze/ui/avatar.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/avatar.md ### Customize with real content Adapt the Haze avatar ui for our product. Replace the demo values of these props with our real content: name, size, src, status, statusLabel, class. Keep the layout, the heading level rules and these accessibility details: Exposed as role="img" named with the full name, plus the statusLabel when a presence dot is shown. The dot itself is aria-hidden. If the name is already printed next to it, consider hiding the avatar to avoid double announcement. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using avatar, check it fits: use it when testimonials, team lists and comment threads; you do not have, or do not want to load, profile photos. Avoid it when the person's face matters for recognition; use an image avatar. ## Example requests that should lead here - Show initials avatars next to each testimonial - Show a team member avatar with a green online dot ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Props { /** Full name. It is the accessible name, and its first letters are the fallback initials. */ name: string; size?: "sm" | "md" | "lg"; /** Photo URL. When set, the image replaces the initials. */ src?: string; /** Presence dot at the bottom right: online is green, away is muted. */ status?: "online" | "away"; /** Screen-reader text for the presence dot, for example "Online". Read after the name. */ statusLabel?: string; class?: string; } const { name, size = "md", src, status, statusLabel, class: className } = Astro.props; const initials = name .split(/\s+/) .map((p) => p[0] ?? "") .join("") .slice(0, 2) .toUpperCase(); const sizes = { sm: "size-6 text-[0.625rem]/4", md: "size-8 text-xs/4", lg: "size-10 text-sm/5" }; const pixels = { sm: 24, md: 32, lg: 40 }; const dotSizes = { sm: "size-2", md: "size-2.5", lg: "size-3" }; const dots = { online: "bg-success", away: "bg-muted-foreground" }; const accessibleName = status && statusLabel ? `${name}, ${statusLabel}` : name; --- { src ? ( <>
({ label, value }))} rowHeader="label" class="min-w-0 rounded-md" /> ) :

{emptyLabel}

} ``` --- # Bar list > A compact horizontal bar chart with a shared scale and visible labels and values. - Kind: ui · Category: Data display · Interactivity: none - Install: `npx shadcn@latest add @haze/bar-list` - File: `src/components/haze/ui/bar-list.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/bar-list ## Use when - Readers compare a handful of categories by a single nonnegative measure - A dashboard needs a chart that stays legible in a narrow column ## Avoid when - The values represent a series over time. Use table for the raw figures. - Multiple measures per row need their own scales. ## Alternatives - [stat](https://hazeui.com/ui/stat.md) - [table](https://hazeui.com/ui/table.md) - [progress](https://hazeui.com/ui/progress.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | label | `string` | "Deployment volume" | no | Caption for the group of bars. | | items | `{ label: string; value: number; displayValue?: string }[]` | | no | Values and labels in display order. Use displayValue for formatted units. | | max | `number` | | no | Positive shared maximum. Defaults to the largest value. | | class | `string` | | no | Additional classes on the figure. | ## Accessibility - Bars are decorative. The complete data is available in the list of labels and textual values. - Keep the units and scale consistent across all rows. ## Agent prompts ### Install and use Install the Haze UI component "Bar list" with `npx shadcn@latest add @haze/bar-list`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BarList from "@/components/haze/ui/bar-list.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/bar-list.md ### Customize with real content Adapt the Haze bar-list ui for our product. Replace the demo values of these props with our real content: label, items, max, class. Keep the layout, the heading level rules and these accessibility details: Bars are decorative. The complete data is available in the list of labels and textual values. Keep the units and scale consistent across all rows. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using bar-list, check it fits: use it when readers compare a handful of categories by a single nonnegative measure; a dashboard needs a chart that stays legible in a narrow column. Avoid it when the values represent a series over time. use table for the raw figures.; multiple measures per row need their own scales.. Alternatives: @haze/stat, @haze/table, @haze/progress. ## Example requests that should lead here - Show project storage usage as four horizontal bars with visible GB values. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Props { label?: string; items?: { label: string; value: number; displayValue?: string }[]; max?: number; class?: string; } const { label = "Deployment volume", items = [ { label: "Production", value: 36 }, { label: "Preview", value: 57 }, { label: "Development", value: 21 }, ], max, class: className, } = Astro.props; const observedMax = items.reduce((highest, item) => Number.isFinite(item.value) ? Math.max(highest, item.value) : highest, 0); const scaleMax = max && Number.isFinite(max) && max > 0 ? max : observedMax || 1; ---
{label}
    {items.map(({ label: itemLabel, value, displayValue }) => { const proportion = Number.isFinite(value) ? Math.min(100, Math.max(0, value / scaleMax * 100)) : 0; return (
  • {itemLabel} {displayValue ?? value}
  • ); })}
``` --- # Bento checklist > An ordered status list with completed, current, and pending steps and checkmarks that settle as they scroll into view. - Kind: ui · Category: Data display · Interactivity: none - Install: `npx shadcn@latest add @haze/bento-checklist` - File: `src/components/haze/ui/bento-checklist.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/bento-checklist ## Use when - Readers need to see how far a release or review has progressed. - A compact tile needs to show which prerequisite is still pending. ## Avoid when - People must change the checked state themselves. ## Alternatives - [checkbox-group](https://hazeui.com/ui/checkbox-group.md) - [check-runs](https://hazeui.com/ui/check-runs.md) - [stepper](https://hazeui.com/ui/stepper.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | label | `string` | Review checklist | no | Accessible label for the list. | | items | `Item[]` | | no | Ordered steps with label, optional detail and done, current or pending state. | | stateLabels | `Partial>` | | no | Overrides the spoken names of the three states. | | motion | `boolean` | true | no | Animate completed icons on entry where scroll-driven motion is supported and enabled. | | class | `string` | | no | Classes on the ordered list. | ## Accessibility - The list announces each step and its state without relying on color. - Only decorative checkmarks animate. Reduced motion keeps them still. ## Agent prompts ### Install and use Install the Haze UI component "Bento checklist" with `npx shadcn@latest add @haze/bento-checklist`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BentoChecklist from "@/components/haze/ui/bento-checklist.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/bento-checklist.md ### Customize with real content Adapt the Haze bento-checklist ui for our product. Replace the demo values of these props with our real content: label, items, stateLabels, motion, class. Keep the layout, the heading level rules and these accessibility details: The list announces each step and its state without relying on color. Only decorative checkmarks animate. Reduced motion keeps them still. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using bento-checklist, check it fits: use it when readers need to see how far a release or review has progressed.; a compact tile needs to show which prerequisite is still pending.. Avoid it when people must change the checked state themselves.. Alternatives: @haze/checkbox-group, @haze/check-runs, @haze/stepper. ## Example requests that should lead here - Show the release gate with two checks complete, sign-off in progress and publication pending. ## Source ```astro --- import { Check, Circle, CircleDot } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; type State = "done" | "current" | "pending"; interface Item { label: string; detail?: string; state?: State; } interface Props { label?: string; items?: Item[]; stateLabels?: Partial>; motion?: boolean; class?: string; } const { label = "Review checklist", stateLabels, motion = true, class: className, items = [ { label: "Build verified", state: "done" }, { label: "Preview reviewed", state: "done" }, { label: "Release notes", detail: "In review", state: "current" }, { label: "Publish update", state: "pending" }, ], } = Astro.props; const states = { done: { Icon: Check, label: "Complete", tone: "bg-success/14 text-success" }, current: { Icon: CircleDot, label: "In progress", tone: "bg-accent text-foreground" }, pending: { Icon: Circle, label: "Pending", tone: "bg-muted text-muted-foreground" }, }; ---
    {items.map(({ label: itemLabel, detail, state = "pending" }, index) => { const { Icon, label: stateLabel, tone } = states[state]; return (
  1. {itemLabel}, {stateLabels?.[state] ?? stateLabel}

    {detail &&

    {detail}

    }
  2. ); })}
``` --- # Bento growth > A headline metric and prior-period comparison with compact animated columns and a disclosure for exact figures. - Kind: ui · Category: Data display · Interactivity: native - Install: `npx shadcn@latest add @haze/bento-growth` - File: `src/components/haze/ui/bento-growth.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/bento-growth ## Use when - A KPI needs both its latest value and a short history. - You want readers to see the comparison even when the chart is small. ## Avoid when - The item needs a shared axis for signed values or multiple data series. ## Alternatives - [sparkline](https://hazeui.com/ui/sparkline.md) - [stat](https://hazeui.com/ui/stat.md) - [bar-list](https://hazeui.com/ui/bar-list.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | label | `string` | Active workspaces | no | Metric name. | | value | `string` | 2,480 | no | Formatted current amount. | | comparison | `string` | | no | Text that names the direction, change and comparison period. Pass an empty string to omit it. | | direction | `up \| down \| flat` | up | no | Selects the comparison arrow. | | samples | `Sample[]` | | no | Ordered, nonnegative finite values with period labels and optional formatted values. | | detailsLabel | `string` | View values | no | Caption of the disclosure for the period values. | | motion | `boolean` | true | no | Animate columns as they enter the viewport where scroll-driven motion is supported and enabled. | | class | `string` | | no | Classes on the figure. | ## Accessibility - The exact chart values are in a native disclosure. - The comparison is written out and the decorative bars respect reduced motion. - Key Enter / Space: Open or close the period values. ## Agent prompts ### Install and use Install the Haze UI component "Bento growth" with `npx shadcn@latest add @haze/bento-growth`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BentoGrowth from "@/components/haze/ui/bento-growth.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/bento-growth.md ### Customize with real content Adapt the Haze bento-growth ui for our product. Replace the demo values of these props with our real content: label, value, comparison, direction, samples, detailsLabel, motion, class. Keep the layout, the heading level rules and these accessibility details: The exact chart values are in a native disclosure. The comparison is written out and the decorative bars respect reduced motion. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using bento-growth, check it fits: use it when a kpi needs both its latest value and a short history.; you want readers to see the comparison even when the chart is small.. Avoid it when the item needs a shared axis for signed values or multiple data series.. Alternatives: @haze/sparkline, @haze/stat, @haze/bar-list. ## Example requests that should lead here - Show active workspaces, the change from last month and the last six exact values. ## Source ```astro --- import { ArrowDownRight, ArrowRight, ArrowUpRight, ChevronDown } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { label?: string; value?: string; comparison?: string; direction?: "up" | "down" | "flat"; samples?: { label: string; value: number; displayValue?: string }[]; detailsLabel?: string; motion?: boolean; class?: string; } const { label = "Active workspaces", value = "2,480", comparison = "+16% vs last month", direction = "up", detailsLabel = "View values", motion = true, class: className, samples = [ { label: "Jun", value: 1620 }, { label: "Jul", value: 1800 }, { label: "Aug", value: 1730 }, { label: "Sep", value: 1960 }, { label: "Oct", value: 2138 }, { label: "Nov", value: 2480 }, ], } = Astro.props; const valid = samples.filter((sample) => Number.isFinite(sample.value) && sample.value >= 0); const maximum = valid.reduce((max, sample) => Math.max(max, sample.value), 0) || 1; const Direction = { up: ArrowUpRight, down: ArrowDownRight, flat: ArrowRight }[direction]; ---
{label}
{value} {comparison && ( )}
{valid.length > 0 && ( <>
{detailsLabel}
{valid.map(({ label: period, value: sample, displayValue }) => (
{period}
{displayValue ?? sample}
))}
)}
``` --- # Bento mosaic > A container-responsive grid for combining tiles of different widths without changing their reading order. - Kind: ui · Category: Layout and media · Interactivity: none - Install: `npx shadcn@latest add @haze/bento-mosaic` - File: `src/components/haze/ui/bento-mosaic.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/bento-mosaic ## Use when - You are composing a product showcase from small and large cards. - The same group needs to fit a narrow panel and a full-width section. ## Avoid when - A uniform gallery needs identical card sizes at every width. ## Alternatives - [bento-grid](https://hazeui.com/blocks/bento-grid.md) - [bento-tile](https://hazeui.com/ui/bento-tile.md) - [features-icon-grid](https://hazeui.com/blocks/features-icon-grid.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | default slot | `slot` | | yes | Bento tiles or other children. Give each child a desktop column span. | | class | `string` | | no | Classes on the outer width container. | | gridClass | `string` | | no | Classes on the inner grid for placement or gap overrides. | ## Accessibility - Put children in reading order before assigning spans. - Container queries stack tiles in narrow slots independent of the viewport width. ## Agent prompts ### Install and use Install the Haze UI component "Bento mosaic" with `npx shadcn@latest add @haze/bento-mosaic`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BentoMosaic from "@/components/haze/ui/bento-mosaic.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/bento-mosaic.md ### Customize with real content Adapt the Haze bento-mosaic ui for our product. Replace the demo values of these props with our real content: default slot, class, gridClass. Keep the layout, the heading level rules and these accessibility details: Put children in reading order before assigning spans. Container queries stack tiles in narrow slots independent of the viewport width. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using bento-mosaic, check it fits: use it when you are composing a product showcase from small and large cards.; the same group needs to fit a narrow panel and a full-width section.. Avoid it when a uniform gallery needs identical card sizes at every width.. Alternatives: @haze/bento-grid, @haze/bento-tile, @haze/features-icon-grid. ## Example requests that should lead here - Build a dashboard mosaic with a wide activity card, a smaller queue card and a full-width handoff. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Props { class?: string; gridClass?: string; } const { class: className, gridClass } = Astro.props; ---
``` --- # Bento presence > A compact team roster with an online total, role details, initials, and written availability states. - Kind: ui · Category: Data display · Interactivity: none - Install: `npx shadcn@latest add @haze/bento-presence` - File: `src/components/haze/ui/bento-presence.astro` - npm dependencies: none - Registry dependencies: @haze/avatar, @haze/status, @haze/utils - Docs page: https://hazeui.com/ui/bento-presence ## Use when - A handoff panel needs to show who is currently available. - The reader needs roles and availability beside each teammate's name. ## Avoid when - The roster must provide search, role editing, or invitations. ## Alternatives - [avatar-group](https://hazeui.com/ui/avatar-group.md) - [status](https://hazeui.com/ui/status.md) - [bento-collaboration](https://hazeui.com/blocks/bento-collaboration.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | label | `string` | Team availability | no | Accessible name of the roster. | | members | `Member[]` | | no | Names, optional roles and online, away or offline states. | | statusLabels | `Partial>` | | no | Localized availability words. | | emptyLabel | `string` | No teammates to show. | no | Text shown when the roster is empty. | | class | `string` | | no | Classes on the roster wrapper. | ## Accessibility - Names and states are visible as text. Initials are decorative. - The online count is derived from the displayed roster. ## Agent prompts ### Install and use Install the Haze UI component "Bento presence" with `npx shadcn@latest add @haze/bento-presence`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BentoPresence from "@/components/haze/ui/bento-presence.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/bento-presence.md ### Customize with real content Adapt the Haze bento-presence ui for our product. Replace the demo values of these props with our real content: label, members, statusLabels, emptyLabel, class. Keep the layout, the heading level rules and these accessibility details: Names and states are visible as text. Initials are decorative. The online count is derived from the displayed roster. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using bento-presence, check it fits: use it when a handoff panel needs to show who is currently available.; the reader needs roles and availability beside each teammate's name.. Avoid it when the roster must provide search, role editing, or invitations.. Alternatives: @haze/avatar-group, @haze/status, @haze/bento-collaboration. ## Example requests that should lead here - Add a team tile that shows who is online, away and offline for a handoff. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; import Avatar from "./avatar.astro"; import Status from "./status.astro"; type Availability = "online" | "away" | "offline"; interface Member { name: string; detail?: string; status: Availability; } interface Props { label?: string; members?: Member[]; statusLabels?: Partial>; emptyLabel?: string; class?: string; } const { label = "Team availability", statusLabels, emptyLabel = "No teammates to show.", class: className, members = [ { name: "Iris Chen", detail: "Design", status: "online" }, { name: "Rafi Okafor", detail: "Engineering", status: "online" }, { name: "Mina Vale", detail: "Support", status: "away" }, ], } = Astro.props; const labels = { online: "Online", away: "Away", offline: "Offline", ...statusLabels }; const tones = { online: "success", away: "warning", offline: "default" } as const; const onlineCount = members.filter(({ status }) => status === "online").length; ---

{onlineCount} {labels.online.toLocaleLowerCase()}

{members.length ? (
    {members.map(({ name, detail, status }) => (
  • {name} {detail && {detail}}

  • ))}
) :

{emptyLabel}

}
``` --- # Bento tile > A feature tile with an optional edge-to-edge visual, a caption, and room for controls or supporting content. - Kind: ui · Category: Layout and media · Interactivity: none - Install: `npx shadcn@latest add @haze/bento-tile` - File: `src/components/haze/ui/bento-tile.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/bento-tile ## Use when - You need a shared panel treatment across a product mosaic. - One panel should receive a restrained brand tint. ## Avoid when - The whole surface needs to be a single link. ## Alternatives - [card](https://hazeui.com/ui/card.md) - [bento-mosaic](https://hazeui.com/ui/bento-mosaic.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | title | `string` | | yes | Visible panel heading. | | description | `string` | | no | Supporting text below the title. | | headingLevel | `2 \| 3 \| 4` | 3 | no | Heading level in the surrounding document. | | span | `quarter \| third \| half \| two-thirds \| three-quarters \| full` | third | no | Column span inside Bento Mosaic. Full spans both columns at intermediate widths. | | variant | `default \| info` | default | no | Neutral surface, or a raised neutral surface with a stronger border for emphasis. | | default slot | `slot` | | no | Content or controls in the panel body. | | visual slot | `slot` | | no | Artwork or a working product sample above the caption. Give meaningful diagrams a text equivalent. | | accessory slot | `slot` | | no | Compact header detail such as a status. | | class | `string` | | no | Classes on the article. | | bodyClass | `string` | | no | Classes on the body grid. | | visualClass | `string` | | no | Sizing, alignment and surface classes for the visual slot. | ## Accessibility - Pick a heading level that matches the outline. - Controls keep their native focus order. Hide decorative artwork from assistive technology. ## Agent prompts ### Install and use Install the Haze UI component "Bento tile" with `npx shadcn@latest add @haze/bento-tile`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BentoTile from "@/components/haze/ui/bento-tile.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/bento-tile.md ### Customize with real content Adapt the Haze bento-tile ui for our product. Replace the demo values of these props with our real content: title, description, headingLevel, span, variant, default slot, visual slot, accessory slot, class, bodyClass, visualClass. Keep the layout, the heading level rules and these accessibility details: Pick a heading level that matches the outline. Controls keep their native focus order. Hide decorative artwork from assistive technology. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using bento-tile, check it fits: use it when you need a shared panel treatment across a product mosaic.; one panel should receive a restrained brand tint.. Avoid it when the whole surface needs to be a single link.. Alternatives: @haze/card, @haze/bento-mosaic. ## Example requests that should lead here - Create an emphasized tile with a preview environment status and the build identifier. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Props { title: string; description?: string; headingLevel?: 2 | 3 | 4; span?: "quarter" | "third" | "half" | "two-thirds" | "three-quarters" | "full"; variant?: "default" | "info"; class?: string; bodyClass?: string; visualClass?: string; } const { title, description, headingLevel = 3, span = "third", variant = "default", class: className, bodyClass, visualClass } = Astro.props; const Heading = ({ 2: "h2", 3: "h3", 4: "h4" } as const)[headingLevel]; const hasVisual = Astro.slots.has("visual"); const spans = { quarter: "@2xl/bento:col-span-3", third: "@2xl/bento:col-span-4", half: "@2xl/bento:col-span-6", "two-thirds": "@2xl/bento:col-span-8", "three-quarters": "@2xl/bento:col-span-9", full: "@md/bento:col-span-full", }; ---
{hasVisual && (
)}
{title} {description &&

{description}

}
{Astro.slots.has("default") &&
}
``` --- # Billing Toggle > Switches monthly and annual billing with a sliding thumb, savings badge, and animated price. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/billing-toggle` - File: `src/components/haze/ui/billing-toggle.astro` - npm dependencies: none - Registry dependencies: @haze/animated-number, @haze/utils - Docs page: https://hazeui.com/ui/billing-toggle ## Use when - Show two billing cycles for one plan. - Put the annual savings alongside the billing choice. ## Avoid when - The choices change views or filters instead of a price. ## Alternatives - [toggle-group](https://hazeui.com/ui/toggle-group.md) - [radio-group](https://hazeui.com/ui/radio-group.md) - [animated-number](https://hazeui.com/ui/animated-number.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique ID for the billing control. Defaults the form field name. | | name | `string` | | no | Native radio field name. | | legend | `string` | Billing cycle | no | Visible group label. | | monthlyLabel | `string` | Monthly | no | Text on the monthly option. | | annualLabel | `string` | Annual | no | Text on the annual option. | | monthly | `number` | 24 | no | Price per month when billed monthly. | | annual | `number` | 19 | no | Price per month when billed annually. | | value | `"monthly" \| "annual"` | monthly | no | Initial selection. | | currency | `string` | USD | no | ISO currency code for the display. | | locale | `string` | en-US | no | Locale for currency and numbers. | | badge | `string` | | no | Override the calculated savings badge. An empty string hides it. | | class | `string` | | no | Classes on the fieldset. | ## Accessibility - Native radios work with or without scripts. The billing cadence appears beside the amount, and price changes are announced when scripts are active. - Key Arrow keys: Switch billing cycle from a focused option. ## Agent prompts ### Install and use Install the Haze UI component "Billing Toggle" with `npx shadcn@latest add @haze/billing-toggle`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BillingToggle from "@/components/haze/ui/billing-toggle.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/billing-toggle.md ### Customize with real content Adapt the Haze billing-toggle ui for our product. Replace the demo values of these props with our real content: id, name, legend, monthlyLabel, annualLabel, monthly, annual, value, currency, locale, badge, class. Keep the layout, the heading level rules and these accessibility details: Native radios work with or without scripts. The billing cadence appears beside the amount, and price changes are announced when scripts are active. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using billing-toggle, check it fits: use it when show two billing cycles for one plan.; put the annual savings alongside the billing choice.. Avoid it when the choices change views or filters instead of a price.. Alternatives: @haze/toggle-group, @haze/radio-group, @haze/animated-number. ## Example requests that should lead here - Let people compare monthly and annual rates, and show how much the annual plan saves. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; import AnimatedNumber from "./animated-number.astro"; interface Props { id: string; name?: string; legend?: string; monthlyLabel?: string; annualLabel?: string; monthly?: number; annual?: number; value?: "monthly" | "annual"; currency?: string; locale?: string; badge?: string; class?: string; } const { id, name = id, legend = "Billing cycle", monthlyLabel = "Monthly", annualLabel = "Annual", monthly = 24, annual = 19, value = "monthly", currency = "USD", locale = "en-US", badge, class: className, } = Astro.props; const monthlyPrice = Number.isFinite(monthly) ? Math.max(0, monthly) : 0; const annualPrice = Number.isFinite(annual) ? Math.max(0, annual) : 0; const currencyDigits = new Intl.NumberFormat(locale, { style: "currency", currency }).resolvedOptions().maximumFractionDigits ?? 2; const fractionDigits = [monthlyPrice, annualPrice].some(price => !Number.isInteger(price)) ? currencyDigits : 0; const currencyFormatter = new Intl.NumberFormat(locale, { style: "currency", currency, minimumFractionDigits: fractionDigits, maximumFractionDigits: fractionDigits }); const currencyParts = currencyFormatter.formatToParts(1); const firstDigit = currencyParts.findIndex(part => part.type === "integer"); const lastDigit = currencyParts.findLastIndex(part => part.type === "fraction" || part.type === "integer"); const prefix = currencyParts.slice(0, firstDigit).map(part => part.value).join(""); const suffix = currencyParts.slice(lastDigit + 1).map(part => part.value).join(""); const savings = monthlyPrice > annualPrice ? Math.round(100 * (1 - annualPrice / monthlyPrice)) : 0; const badgeText = badge ?? (savings > 0 ? `Save ${savings}%` : ""); const options = [ { value: "monthly", label: monthlyLabel, price: monthlyPrice }, { value: "annual", label: annualLabel, price: annualPrice }, ] as const; const optionClass = "relative z-10 flex min-h-8 min-w-0 cursor-pointer flex-wrap content-center items-center justify-center gap-x-1.5 gap-y-0.5 rounded-sm px-3 py-1 text-center text-[0.8125rem]/5 font-medium wrap-anywhere text-muted-foreground hover:text-foreground has-checked:text-foreground has-focus-visible:outline-2 has-focus-visible:-outline-offset-2 has-focus-visible:outline-ring forced-colors:has-checked:outline"; ---
{legend}
{options.map(option => ( ))}
``` --- # Boarding Pass > A wide airline boarding pass card with route hero, 4-column boarding metadata, clipped perforation notches, and barcode footer. - Kind: ui · Category: Data display · Interactivity: none - Install: `npx shadcn@latest add @haze/boarding-pass` - File: `src/components/haze/ui/boarding-pass.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/boarding-pass ## Use when - Presenting a confirmed flight itinerary with gate, boarding time, seat, group, and scannable pass stub. - Showing a crisp digital travel ticket or event pass with structured departure metadata. ## Avoid when - Users need to compare multiple itineraries side by side. Use a table or card list. - The record is generic key-value data without a route or ticket stub. Use description-list. ## Alternatives - [card](https://hazeui.com/ui/card.md) - [description-list](https://hazeui.com/ui/description-list.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | airline | `string` | "Bramble" | no | Carrier or issuer name displayed in the pass top bar. | | flightNumber | `string` | "NW 214" | no | Flight number displayed beside the airline name. | | status | `string` | "On time" | no | Live flight status badge label. | | departureCode | `string` | "LIS" | no | Three-letter departure IATA airport code. | | departureCity | `string` | "Lisbon" | no | Departure city name. | | departureTime | `string` | "10:40" | no | Scheduled departure time. | | arrivalCode | `string` | "CPH" | no | Three-letter arrival IATA airport code. | | arrivalCity | `string` | "Copenhagen" | no | Arrival city name. | | arrivalTime | `string` | "15:05" | no | Scheduled arrival time. | | gate | `string` | "B12" | no | Departure gate assignment. | | boardingTime | `string` | "10:05" | no | Gate boarding time. | | seat | `string` | "14A" | no | Assigned seat code. | | boardingGroup | `string` | "2" | no | Boarding group or zone number. | | date | `string` | "Thu, 12 Nov" | no | Travel date displayed in the notice and passenger stub. | | notice | `string` | "Doors close 15 min before departure" | no | Boarding cutoff notice line. | | passenger | `string` | "Maya Chen" | no | Passenger full name in the barcode footer. | | passCode | `string` | "NW0214-LISCPH-14A" | no | Seed string used to generate the deterministic barcode pattern. | | headingLevel | `2 \| 3 \| 4` | 3 | no | Heading level for the airline title. | | class | `string` | | no | Additional classes on the outer boarding pass card. | ## Accessibility - The airline mark, flight path graphic, perforation cutouts, and SVG barcode are marked aria-hidden so screen readers focus on real flight text. - Gate, boarding time, seat, and boarding group are structured inside a semantic definition list. - Perforation cutouts are clipped inside overflow-hidden to keep horizontal layout intact down to 320px viewports. ## Agent prompts ### Install and use Install the Haze UI component "Boarding Pass" with `npx shadcn@latest add @haze/boarding-pass`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BoardingPass from "@/components/haze/ui/boarding-pass.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/boarding-pass.md ### Customize with real content Adapt the Haze boarding-pass ui for our product. Replace the demo values of these props with our real content: airline, flightNumber, status, departureCode, departureCity, departureTime, arrivalCode, arrivalCity, arrivalTime, gate, boardingTime, seat, boardingGroup, date, notice, passenger, passCode, headingLevel, class. Keep the layout, the heading level rules and these accessibility details: The airline mark, flight path graphic, perforation cutouts, and SVG barcode are marked aria-hidden so screen readers focus on real flight text. Gate, boarding time, seat, and boarding group are structured inside a semantic definition list. Perforation cutouts are clipped inside overflow-hidden to keep horizontal layout intact down to 320px viewports. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using boarding-pass, check it fits: use it when presenting a confirmed flight itinerary with gate, boarding time, seat, group, and scannable pass stub.; showing a crisp digital travel ticket or event pass with structured departure metadata.. Avoid it when users need to compare multiple itineraries side by side. use a table or card list.; the record is generic key-value data without a route or ticket stub. use description-list.. Alternatives: @haze/card, @haze/description-list. ## Example requests that should lead here - Display a Bramble boarding pass from LIS to CPH with On time badge, gate B12, seat 14A, and barcode footer. - Add a wide airline ticket card showing route codes, 4-column boarding details, perforated tear line, and passenger stub. ## Source ```astro --- import { Compass, Plane } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { airline?: string; flightNumber?: string; status?: string; departureCode?: string; departureCity?: string; departureTime?: string; arrivalCode?: string; arrivalCity?: string; arrivalTime?: string; gate?: string; boardingTime?: string; seat?: string; boardingGroup?: string; date?: string; notice?: string; passenger?: string; passCode?: string; headingLevel?: 2 | 3 | 4; class?: string; } const { airline = "Bramble", flightNumber = "NW 214", status = "On time", departureCode = "LIS", departureCity = "Lisbon", departureTime = "10:40", arrivalCode = "CPH", arrivalCity = "Copenhagen", arrivalTime = "15:05", gate = "B12", boardingTime = "10:05", seat = "14A", boardingGroup = "2", date = "Thu, 12 Nov", notice = "Doors close 15 min before departure", passenger = "Maya Chen", passCode = "NW0214-LISCPH-14A", headingLevel = 3, class: className, } = Astro.props; const Heading = ({ 2: "h2", 3: "h3", 4: "h4" } as const)[headingLevel]; // Deterministic high-contrast barcode bars derived from passCode. const bars: { x: number; w: number }[] = []; let cursor = 2; const seed = passCode.length ? passCode : "NW0214"; let idx = 0; while (cursor < 224) { const code = seed.charCodeAt(idx % seed.length) + idx * 17; const w = (code % 3) + 1.5; const gap = ((code >> 2) % 3) + 1.5; if (cursor + w <= 228) bars.push({ x: cursor, w }); cursor += w + gap; idx++; } ---
{status}

{departureCode}

{departureCity}{departureTime}

{arrivalCode}

{arrivalTime}{arrivalCity}

Gate
{gate}
Boards
{boardingTime}
Seat
{seat}
Group
{boardingGroup}

{date} · {notice}

Passenger {passenger} {date}
``` --- # Bottom navigation > Mobile app navigation with labeled icons, a current-page indicator, and padding for a bottom safe area. - Kind: ui · Category: Navigation · Interactivity: script - Install: `npx shadcn@latest add @haze/bottom-navigation` - File: `src/components/haze/ui/bottom-navigation.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/bottom-navigation ## Use when - A mobile app needs quick access to three to five primary destinations - The current destination should stay visible in a compact, touch-friendly bar ## Avoid when - There are more than five primary destinations. Use sidebar or navigation-menu. - The controls switch panels under one URL. Use tabs. ## Alternatives - [sidebar](https://hazeui.com/ui/sidebar.md) - [navigation-menu](https://hazeui.com/ui/navigation-menu.md) - [tabs](https://hazeui.com/ui/tabs.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | items | `{ label: string; href: string; icon: AstroComponent; current?: boolean }[]` | | yes | Page destinations with short, visible labels. Mark the current page with current. | | label | `string` | "App navigation" | no | Accessible name of the navigation landmark. | | class | `string` | | no | Additional classes for positioning. Reserve room for content when using fixed positioning. | ## Accessibility - Links have visible labels and minimum 48 px height. Icons are decorative. - The selected destination uses aria-current, a stronger label weight and one sliding key behind the icon and label. - Layout wraps when the destinations exceed the available width. - Key Tab: Reach each destination in reading order. ## Agent prompts ### Install and use Install the Haze UI component "Bottom navigation" with `npx shadcn@latest add @haze/bottom-navigation`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BottomNavigation from "@/components/haze/ui/bottom-navigation.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/bottom-navigation.md ### Customize with real content Adapt the Haze bottom-navigation ui for our product. Replace the demo values of these props with our real content: items, label, class. Keep the layout, the heading level rules and these accessibility details: Links have visible labels and minimum 48 px height. Icons are decorative. The selected destination uses aria-current, a stronger label weight and one sliding key behind the icon and label. Layout wraps when the destinations exceed the available width. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using bottom-navigation, check it fits: use it when a mobile app needs quick access to three to five primary destinations; the current destination should stay visible in a compact, touch-friendly bar. Avoid it when there are more than five primary destinations. use sidebar or navigation-menu.; the controls switch panels under one url. use tabs.. Alternatives: @haze/sidebar, @haze/navigation-menu, @haze/tabs. ## Example requests that should lead here - Create a mobile navigation bar with Home, Search, Saved, and Profile destinations - Add safe-area padding to a bottom app bar and highlight the current destination ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Destination { label: string; href: string; icon: (props: Record) => unknown; current?: boolean; } interface Props { items: Destination[]; label?: string; class?: string; } const { items, label = "App navigation", class: className } = Astro.props; --- ``` --- # Breadcrumb > Trail of links showing where the current page sits in the site, ending in the page itself as plain text. - Kind: ui · Category: Navigation · Interactivity: native - Install: `npx shadcn@latest add @haze/breadcrumb` - File: `src/components/haze/ui/breadcrumb.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/breadcrumb ## Use when - Pages nested two or more levels deep, such as docs, shops or settings - Letting readers jump back up the hierarchy in one click - Long trails that must wrap on a narrow screen ## Avoid when - A flat site with one level of pages - Showing steps of a process; use stepper ## Alternatives - [stepper](https://hazeui.com/ui/stepper.md) - [tabs](https://hazeui.com/ui/tabs.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | items | `{ label: string; href?: string }[]` | | yes | Trail from the top level down; the last item is the current page and is not a link. | | label | `string` | "Breadcrumb" | no | Accessible name of the nav landmark. | | class | `string` | | no | Extra classes on the nav. | ## Accessibility - The last item carries aria-current="page" and is plain text, so the reader is not offered a link to where they already are. - An ordered list tells screen readers how many levels the trail has. It carries role="list" because Safari drops list semantics from lists without markers. The chevrons between items are aria-hidden. - Long trails wrap onto more lines, and a single long label is cut with an ellipsis at 10 rem. - Translate the label prop when the page is not in English, since it names the landmark. - Key Tab: Move through the ancestor links ## Agent prompts ### Install and use Install the Haze UI component "Breadcrumb" with `npx shadcn@latest add @haze/breadcrumb`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Breadcrumb from "@/components/haze/ui/breadcrumb.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/breadcrumb.md ### Customize with real content Adapt the Haze breadcrumb ui for our product. Replace the demo values of these props with our real content: items, label, class. Keep the layout, the heading level rules and these accessibility details: The last item carries aria-current="page" and is plain text, so the reader is not offered a link to where they already are. An ordered list tells screen readers how many levels the trail has. It carries role="list" because Safari drops list semantics from lists without markers. The chevrons between items are aria-hidden. Long trails wrap onto more lines, and a single long label is cut with an ellipsis at 10 rem. Translate the label prop when the page is not in English, since it names the landmark. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using breadcrumb, check it fits: use it when pages nested two or more levels deep, such as docs, shops or settings; letting readers jump back up the hierarchy in one click; long trails that must wrap on a narrow screen. Avoid it when a flat site with one level of pages; showing steps of a process; use stepper. Alternatives: @haze/stepper, @haze/tabs. ## Example requests that should lead here - Add a breadcrumb Home, Docs, Components, Alert above the title - Show a three-level trail for a product page ## Source ```astro --- import { ChevronRight } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Crumb { label: string; href?: string; } interface Props { /** Trail from the top level down. The last item is the current page and is not a link. */ items: Crumb[]; /** Accessible name of the nav landmark. */ label?: string; class?: string; } const { items, label = "Breadcrumb", class: className } = Astro.props; const last = items.length - 1; --- ``` --- # Browser window > A browser-style figure with an optional display address for an image or a live product preview. - Kind: ui · Category: Layout and media · Interactivity: none - Install: `npx shadcn@latest add @haze/browser-window` - File: `src/components/haze/ui/browser-window.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/browser-window ## Use when - A web application screenshot needs context - An embedded product mock should have the same finish as other Haze panels ## Avoid when - The address needs to be edited or navigated to. Use input or a link. - The content only needs a fixed shape, not window chrome. Use aspect-ratio. ## Alternatives - [aspect-ratio](https://hazeui.com/ui/aspect-ratio.md) - [terminal-window](https://hazeui.com/ui/terminal-window.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | label | `string` | "Browser preview" | no | Accessible description of the preview. | | address | `string` | "console.example.test/releases" | no | Display-only address. Supply an empty string to omit it. | | default slot | `slot` | | no | Screenshot or responsive product mockup. | | class | `string` | | no | Additional classes on the figure. | ## Accessibility - The address is plain text and the browser chrome is decorative. - Use a meaningful picture description or semantic markup for the preview content. ## Agent prompts ### Install and use Install the Haze UI component "Browser window" with `npx shadcn@latest add @haze/browser-window`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BrowserWindow from "@/components/haze/ui/browser-window.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/browser-window.md ### Customize with real content Adapt the Haze browser-window ui for our product. Replace the demo values of these props with our real content: label, address, default slot, class. Keep the layout, the heading level rules and these accessibility details: The address is plain text and the browser chrome is decorative. Use a meaningful picture description or semantic markup for the preview content. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using browser-window, check it fits: use it when a web application screenshot needs context; an embedded product mock should have the same finish as other haze panels. Avoid it when the address needs to be edited or navigated to. use input or a link.; the content only needs a fixed shape, not window chrome. use aspect-ratio.. Alternatives: @haze/aspect-ratio, @haze/terminal-window. ## Example requests that should lead here - Frame a release workspace preview with a visible sample address and no simulated browser buttons. ## Source ```astro --- import { Globe, PanelTop } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { label?: string; address?: string; class?: string; } const { label = "Browser preview", address = "console.example.test/releases", class: className } = Astro.props; ---
{label} {address && ( )}

Your workspace preview appears here.

``` --- # Brush chart > Zoom a dense ordered series with two native window handles, pan or reset the window, and inspect values and named events. - Kind: ui · Category: Data display · Interactivity: script - Install: `npx shadcn@latest add @haze/brush-chart` - File: `src/components/haze/ui/brush-chart.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/brush-chart ## Use when - A long metric needs a focused view while retaining its complete overview. - Events must be read alongside the measurements within a selected interval. ## Avoid when - A short series fits on one axis without zooming. Use line-chart. ## Alternatives - [line-chart](https://hazeui.com/ui/line-chart.md) - [streamgraph](https://hazeui.com/ui/streamgraph.md) - [sparkline](https://hazeui.com/ui/sparkline.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | label | `string` | Daily build volume | no | Visible metric caption. | | data | `{ label: string; value: number; event?: string }[]` | | no | Ordered readings; nonfinite measurements are excluded while finite negative values remain valid. | | unit | `string` | builds | no | Measurement unit. | | initialWindow | `number` | 12 | no | Initial count of most-recent readings; clamped to at least one. | | class | `string` | | no | Additional classes on the chart figure. | ## Accessibility - Independent native range controls select both window endpoints and expose their period names, with another range reading inside the window. - The overview and main line are decorative; the disclosure lists every finite value and its event for access without scripts. - Key Arrow keys / Home / End: Resize either window endpoint or read the focused window. - Key Enter / Space: Pan, reset to all data or select the latest seven readings. ## Agent prompts ### Install and use Install the Haze UI component "Brush chart" with `npx shadcn@latest add @haze/brush-chart`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BrushChart from "@/components/haze/ui/brush-chart.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/brush-chart.md ### Customize with real content Adapt the Haze brush-chart ui for our product. Replace the demo values of these props with our real content: label, data, unit, initialWindow, class. Keep the layout, the heading level rules and these accessibility details: Independent native range controls select both window endpoints and expose their period names, with another range reading inside the window. The overview and main line are decorative; the disclosure lists every finite value and its event for access without scripts. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using brush-chart, check it fits: use it when a long metric needs a focused view while retaining its complete overview.; events must be read alongside the measurements within a selected interval.. Avoid it when a short series fits on one axis without zooming. use line-chart.. Alternatives: @haze/line-chart, @haze/streamgraph, @haze/sparkline. ## Example requests that should lead here - Create an incident metric chart with a retained overview, keyboard window handles and event notes in each reading. ## Source ```astro --- import { ChevronDown } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Point{label:string;value:number;event?:string} interface Props{label?:string;data?:Point[];unit?:string;initialWindow?:number;class?:string} const{label="Daily build volume",unit="builds",initialWindow=12,data=Array.from({length:36},(_,i)=>({label:"Day "+(i+1),value:70+(i*17%43)+Math.round(Math.sin(i*.6)*24),event:i===18?"Build cache enabled":i===29?"Release candidate":undefined})),class:className}=Astro.props; const points=data.filter(point=>Number.isFinite(point.value)),start=Math.max(0,points.length-(Number.isFinite(initialWindow)?Math.max(1,Math.floor(initialWindow)):12)),end=Math.max(0,points.length-1); const layout=(items:Point[])=>{const lo=Math.min(...items.map(p=>p.value)),hi=Math.max(...items.map(p=>p.value)),magnitude=Math.max(Math.abs(lo),Math.abs(hi),1);return items.map((p,i)=>[items.length===1?150:i/(items.length-1)*300,hi===lo?100:180-(p.value/magnitude-lo/magnitude)/(hi/magnitude-lo/magnitude)*160]);}; const path=(items:Point[])=>layout(items).map((p,i)=>(i?"L":"M")+p.join(" ")).join(" "); ---
{label}
{points.length?<>
{points[start].label}{points[end].label}
:

No finite readings to explore.

}

Resize the window with its two native range handles; the overview retains the complete series.

All readings and events
{points.map(point=>)}
{label}
PeriodValue / event
{point.label}{point.value} {unit}{point.event?" · "+point.event:""}
``` --- # Button group > Related actions share joined borders, or sit in a sunken track where a raised key slides to the pressed button. - Kind: ui · Category: Actions · Interactivity: script - Install: `npx shadcn@latest add @haze/button-group` - File: `src/components/haze/ui/button-group.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/button-group ## Use when - Related actions that read as one control, such as Day, Week and Month - A split of a primary action and a secondary one that belong together - A small cluster of outline buttons that should share borders ## Avoid when - Choosing one option from a set that stays selected; toggle-group tracks pressed state - Unrelated actions, which need their own spacing and visual weight - More than about five buttons, which wrap badly on narrow screens ## Alternatives - [button](https://hazeui.com/ui/button.md) - [toggle-group](https://hazeui.com/ui/toggle-group.md) - [tabs](https://hazeui.com/ui/tabs.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | label | `string` | | yes | Accessible name of the group, set as aria-label on the role="group" wrapper. | | orientation | `"horizontal" \| "vertical"` | "horizontal" | no | Row or column. The outer corners stay round, inner corners go square and borders overlap by 1 px. | | variant | `"joined" \| "segmented"` | "joined" | no | Joined shares borders between outline buttons. Segmented is a sunken track of ghost buttons; a raised key slides to the child with aria-pressed="true", which your own script toggles. | | class | `string` | | no | Extra classes on the wrapper. | | default slot | `slot` | | yes | Button components; the outline variant looks best because it has a border to share. | ## Accessibility - role="group" with a required label tells a screen reader that the buttons belong together, for example "Time range, group". - A focused or hovered button is raised with z-10 so its ring and border are not covered by the neighbor that overlaps it by 1 px. - Buttons in the group do not shrink when pressed, so the joined edges stay aligned. - The group sets no pressed state itself; for a single choice that manages its own state, use toggle-group or segmented-control. - In the segmented variant the sliding key is decorative; the state is the aria-pressed attribute on each button, which your script must keep in sync, and the key follows it. - Every action keeps its native activation and tab stop; the key never takes pointer events. - Key Tab: Each button in the group is its own tab stop; Enter or Space activates the focused one ## Agent prompts ### Install and use Install the Haze UI component "Button group" with `npx shadcn@latest add @haze/button-group`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ButtonGroup from "@/components/haze/ui/button-group.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/button-group.md ### Customize with real content Adapt the Haze button-group ui for our product. Replace the demo values of these props with our real content: label, orientation, variant, class, default slot. Keep the layout, the heading level rules and these accessibility details: role="group" with a required label tells a screen reader that the buttons belong together, for example "Time range, group". A focused or hovered button is raised with z-10 so its ring and border are not covered by the neighbor that overlaps it by 1 px. Buttons in the group do not shrink when pressed, so the joined edges stay aligned. The group sets no pressed state itself; for a single choice that manages its own state, use toggle-group or segmented-control. In the segmented variant the sliding key is decorative; the state is the aria-pressed attribute on each button, which your script must keep in sync, and the key follows it. Every action keeps its native activation and tab stop; the key never takes pointer events. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using button-group, check it fits: use it when related actions that read as one control, such as day, week and month; a split of a primary action and a secondary one that belong together; a small cluster of outline buttons that should share borders. Avoid it when choosing one option from a set that stays selected; toggle-group tracks pressed state; unrelated actions, which need their own spacing and visual weight; more than about five buttons, which wrap badly on narrow screens. Alternatives: @haze/button, @haze/toggle-group, @haze/tabs. ## Example requests that should lead here - Group Day, Week and Month into one segmented control - Stack Zoom in and Zoom out as a vertical button group ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Props { /** Accessible name of the group, for example "Text alignment". */ label: string; /** Row or column. Only the outer corners stay round, and the buttons overlap by 1 px. */ orientation?: "horizontal" | "vertical"; /** "joined" shares borders between outline buttons. "segmented" is a sunken track with a raised key that slides to the button marked aria-pressed="true". */ variant?: "joined" | "segmented"; class?: string; } const { label, orientation = "horizontal", variant = "joined", class: className } = Astro.props; // Each class is a whole literal string. Joined: the group owns the key shadow; children give up their own. Segmented: a sunken track, flat buttons and one sliding raised key. const orientations = { horizontal: "flex-row [&>*:first-child]:rounded-l-lg [&>*:last-child]:rounded-r-lg [&>*:not(:first-child)]:-ml-px", vertical: "flex-col [&>*:first-child]:rounded-t-lg [&>*:last-child]:rounded-b-lg [&>*:not(:first-child)]:-mt-px", }; const segmented = "flex-row gap-1 rounded-lg border border-frame bg-muted p-1 [&>*]:rounded-sm [&>[aria-pressed=true]]:text-foreground [&>[aria-pressed=true]:hover]:bg-transparent [&:not([data-enhanced])>[aria-pressed=true]]:border-frame [&:not([data-enhanced])>[aria-pressed=true]]:bg-background [&:not([data-enhanced])>[aria-pressed=true]]:shadow-key before:pointer-events-none before:absolute before:top-0 before:left-0 before:-z-10 before:h-(--group-h) before:w-(--group-w) before:translate-x-(--group-x) before:translate-y-(--group-y) before:rounded-sm before:border before:border-frame before:bg-background before:shadow-key before:opacity-0 before:content-[''] data-[active]:before:opacity-100 data-[moving]:before:transition-[translate,width,height,opacity] data-[moving]:before:duration-200 data-[moving]:before:ease-snappy motion-reduce:data-[moving]:before:transition-none"; ---
*]:relative [&>*]:shadow-none [&>*]:active:scale-100 [&>*:hover]:z-10 [&>*:focus-visible]:z-10", variant === "segmented" ? segmented : cn("[&>*]:rounded-none", orientations[orientation]), className, )} >
``` --- # Button > Button or link styled as a button, in seven variants and three text sizes, plus a square icon size and press and loading states. - Kind: ui · Category: Actions · Interactivity: native - Install: `npx shadcn@latest add @haze/button` - File: `src/components/haze/ui/button.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/button ## Use when - Any action or navigation that should look like a button - Pass href to render a real link; omit it for a ) : ( ) } ``` --- # Calendar > An inline month grid for choosing one date, backed by a native date input with limits and form validation. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/calendar` - File: `src/components/haze/ui/calendar.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/button, @haze/input, @haze/utils - Docs page: https://hazeui.com/ui/calendar ## Use when - The weeks around a date matter, such as when scheduling a release. - People should be able to type the date or choose it from a month grid. ## Avoid when - The user must choose both ends of a date range. ## Alternatives - [date-picker](https://hazeui.com/ui/date-picker.md) - [date-range-picker](https://hazeui.com/ui/date-range-picker.md) - [time-picker](https://hazeui.com/ui/time-picker.md) - [input](https://hazeui.com/ui/input.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique identifier for the date field. | | name | `string` | id | no | Submitted field name. | | label | `string` | Date | no | Visible label for the date field. | | value | `string` | | no | Initial date in YYYY-MM-DD format. | | min | `string` | | no | Earliest allowed date in YYYY-MM-DD format. | | max | `string` | | no | Latest allowed date in YYYY-MM-DD format. | | required | `boolean` | | no | Requires the user to enter a date. | | disabled | `boolean` | | no | Disables the native field. | | form | `string` | | no | ID of a form outside the component. | | locale | `string` | en | no | BCP 47 locale for the calendar labels. | | weekStart | `0 \| 1` | 1 | no | First day of the week, Sunday or Monday. | | presentation | `inline \| popover` | inline | no | Renders the grid inline or opens it from a calendar button. | | openLabel | `string` | Open calendar | no | Accessible name of the popover and its trigger. | | class | `string` | | no | Classes for the date field wrapper. | ## Accessibility - The native input preserves typing, form validation, and reset. - Once the script runs, the browser's own date popup is replaced by this grid, so two pickers never open at once. - The grid announces the month and full date of each day. - Key Arrow keys: Move by a day or week while focused in the grid. - Key Home / End: Move to the start or end of the week. - Key Page Up / Page Down: Go back or forward one month. Add Shift to move a year. - Key Enter / Space: Select the focused date. - Key Space, F4 or Alt + Down in the field: Open the calendar (popover) or move focus to the grid (inline). ## Agent prompts ### Install and use Install the Haze UI component "Calendar" with `npx shadcn@latest add @haze/calendar`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Calendar from "@/components/haze/ui/calendar.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/calendar.md ### Customize with real content Adapt the Haze calendar ui for our product. Replace the demo values of these props with our real content: id, name, label, value, min, max, required, disabled, form, locale, weekStart, presentation, openLabel, class. Keep the layout, the heading level rules and these accessibility details: The native input preserves typing, form validation, and reset. Once the script runs, the browser's own date popup is replaced by this grid, so two pickers never open at once. The grid announces the month and full date of each day. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using calendar, check it fits: use it when the weeks around a date matter, such as when scheduling a release.; people should be able to type the date or choose it from a month grid.. Avoid it when the user must choose both ends of a date range.. Alternatives: @haze/date-picker, @haze/date-range-picker, @haze/time-picker, @haze/input. ## Example requests that should lead here - Add an inline calendar for selecting a release date. - Let contributors pick a date from a schedule constrained to this quarter. ## Source ```astro --- import { CalendarDays, ChevronLeft, ChevronRight } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Button from "./button.astro"; import Input from "./input.astro"; interface Props { id: string; name?: string; label?: string; value?: string; min?: string; max?: string; required?: boolean; disabled?: boolean; form?: string; locale?: string; weekStart?: 0 | 1; presentation?: "inline" | "popover"; openLabel?: string; class?: string; [key: string]: unknown; } const { id, name = id, label = "Date", value, min, max, required, disabled, form, locale = "en", weekStart = 1, presentation = "inline", openLabel = "Open calendar", class: className, ...rest } = Astro.props; const popover = presentation === "popover"; const panelId = `${id}-calendar`; ---
{popover && ( )}

``` --- # Card flip > A tall two-sided event pass card that flips in 3D via an explicit button to reveal a check-in code and venue access notes. - Kind: ui · Category: Layout and media · Interactivity: script - Install: `npx shadcn@latest add @haze/card-flip` - File: `src/components/haze/ui/card-flip.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/card-flip ## Use when - A compact vertical pass, credential, or summary card has a focused reverse side such as a check-in code or access details - Users benefit from toggling between a display face and structured back metadata within the same footprint ## Avoid when - Both views need to be read or compared at the same time. Use card or expandable-card. - The back face contains long multi-section content or forms. Use expandable-card. ## Alternatives - [card](https://hazeui.com/ui/card.md) - [expandable-card](https://hazeui.com/ui/expandable-card.md) - [boarding-pass](https://hazeui.com/ui/boarding-pass.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique identifier for face landmarks and aria-controls links. | | eyebrow | `string` | "Admit one" | no | Micro uppercase label in the top-left corner of the front face. | | badge | `string` | "VIP" | no | Compact pass tier badge rendered in the top-right corner. | | badgeTone | `"warning" \| "brand" \| "success" \| "neutral"` | "neutral" | no | Semantic token tone for the pass badge and edition label. | | edition | `string` | "Vol. 04" | no | Accent edition or series label above the display title. | | title | `string` | "Fieldwork Sessions" | no | Primary display heading shown on the front face. | | metadata | `{ label: string; value: string; span?: 1 \| 2 }[]` | | no | Two-column metadata fields rendered when no default slot is provided. | | holder | `string` | "Jordan Vale" | no | Pass holder name displayed in the front footer. | | serial | `string` | "No. 004182" | no | Monospace serial number shown on both faces. | | backEyebrow | `string` | "Check-in pass" | no | Micro uppercase label above the back face heading. | | backTitle | `string` | "Entry & access" | no | Heading shown on the back face. | | accessNotes | `{ label: string; value: string }[]` | | no | Venue or access notes rendered beneath the check-in barcode when no back slot is provided. | | frontActionLabel | `string` | "Flip for check-in" | no | Label for the button that flips to the back face. | | backActionLabel | `string` | "Show front" | no | Label for the button that flips back to the front face. | | defaultFlipped | `boolean` | false | no | Start with the back face visible. | | headingLevel | `2 \| 3 \| 4` | 3 | no | Heading level for both face titles. | | class | `string` | | no | Additional classes on the outer perspective wrapper. | ## Accessibility - Flipping is triggered by explicit accessible buttons with aria-pressed and aria-controls rather than hover, so touch and keyboard users can operate both faces. - The hidden face is marked inert when enhanced so keyboard focus and screen readers never enter the unseen side, and prefers-reduced-motion swaps faces without a 3D spin. - Decorative barcode and QR SVG graphics carry aria-hidden, and without JavaScript a visually hidden checkbox and paired labels preserve full toggle access. - Key Enter or Space: Flip the card when focused on the face toggle button. - Key Escape: Return from the back face to the front face. ## Agent prompts ### Install and use Install the Haze UI component "Card flip" with `npx shadcn@latest add @haze/card-flip`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CardFlip from "@/components/haze/ui/card-flip.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/card-flip.md ### Customize with real content Adapt the Haze card-flip ui for our product. Replace the demo values of these props with our real content: id, eyebrow, badge, badgeTone, edition, title, metadata, holder, serial, backEyebrow, backTitle, accessNotes, frontActionLabel, backActionLabel, defaultFlipped, headingLevel, class. Keep the layout, the heading level rules and these accessibility details: Flipping is triggered by explicit accessible buttons with aria-pressed and aria-controls rather than hover, so touch and keyboard users can operate both faces. The hidden face is marked inert when enhanced so keyboard focus and screen readers never enter the unseen side, and prefers-reduced-motion swaps faces without a 3D spin. Decorative barcode and QR SVG graphics carry aria-hidden, and without JavaScript a visually hidden checkbox and paired labels preserve full toggle access. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using card-flip, check it fits: use it when a compact vertical pass, credential, or summary card has a focused reverse side such as a check-in code or access details; users benefit from toggling between a display face and structured back metadata within the same footprint. Avoid it when both views need to be read or compared at the same time. use card or expandable-card.; the back face contains long multi-section content or forms. use expandable-card.. Alternatives: @haze/card, @haze/expandable-card, @haze/boarding-pass. ## Example requests that should lead here - Build a vertical studio event pass card that flips in 3D to reveal a check-in barcode and venue transit notes. - Add a two-sided conference badge that flips between attendee details and a check-in QR graphic. ## Source ```astro --- import { RotateCcw, RotateCw } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; type BadgeTone = "warning" | "brand" | "success" | "neutral"; interface MetaField { label: string; value: string; span?: 1 | 2; } interface AccessNote { label: string; value: string; } interface Props { /** Unique identifier used for face landmarks and aria-controls links. */ id: string; eyebrow?: string; badge?: string; badgeTone?: BadgeTone; edition?: string; title?: string; metadata?: MetaField[]; holder?: string; serial?: string; backEyebrow?: string; backTitle?: string; accessNotes?: AccessNote[]; frontActionLabel?: string; backActionLabel?: string; defaultFlipped?: boolean; headingLevel?: 2 | 3 | 4; class?: string; } const { id, eyebrow = "Admit one", badge = "VIP", badgeTone = "neutral", edition = "Vol. 04", title = "Fieldwork Sessions", metadata = [ { label: "Date", value: "Fri, Oct 24" }, { label: "Doors", value: "19:30" }, { label: "Venue", value: "Studio 09, North Pier", span: 2 }, ], holder = "Jordan Vale", serial = "No. 004182", backEyebrow = "Check-in pass", backTitle = "Entry & access", accessNotes = [ { label: "Doors", value: "West Gate scan opens at 19:30 sharp." }, { label: "Transit", value: "Harbor Line to North Pier, Exit B." }, { label: "Seating", value: "Unreserved floor & balcony access." }, ], frontActionLabel = "Flip for check-in", backActionLabel = "Show front", defaultFlipped = false, headingLevel = 3, class: className, } = Astro.props; const Heading = ({ 2: "h2", 3: "h3", 4: "h4" } as const)[headingLevel]; const hasFrontSlot = Astro.slots.has("default"); const hasBackSlot = Astro.slots.has("back"); const hasBadgeSlot = Astro.slots.has("badge"); const badgeStyles: Record = { warning: "bg-warning text-warning-foreground", brand: "bg-brand text-brand-foreground", success: "bg-success text-success-foreground", neutral: "bg-primary text-primary-foreground", }; const editionStyles: Record = { warning: "text-warning", brand: "text-brand", success: "text-success", neutral: "text-muted-foreground", }; const barcodeBars = [ [0, 3], [5, 1.5], [8, 4], [14, 1.5], [17, 2.5], [22, 1.5], [25, 3.5], [31, 2], [35, 1.5], [38, 4], [44, 2], [48, 1.5], [52, 3], [57, 1.5], [61, 2.5], [66, 4], [72, 1.5], [76, 3], [81, 1.5], [85, 2], [89, 3.5], [95, 1.5], [99, 2.5], [104, 1.5], [108, 4], [114, 2], [118, 1.5], [122, 3], [127, 2], [131, 1.5], [135, 3.5], ]; const triggerBase = "min-h-8 w-full cursor-pointer items-center justify-between gap-2 rounded-lg border border-frame bg-control px-3 py-1.5 text-xs/4 font-medium text-muted-foreground transition-colors duration-150 ease-snappy hover:border-frame-hover hover:bg-accent hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring"; const fallbackFocus = "[[data-haze-card-flip]:has(>[data-flip-fallback]:focus-visible)_&]:outline-2 [[data-haze-card-flip]:has(>[data-flip-fallback]:focus-visible)_&]:outline-offset-1 [[data-haze-card-flip]:has(>[data-flip-fallback]:focus-visible)_&]:outline-ring"; ---
{eyebrow && (

{eyebrow}

)} {hasBadgeSlot ? (
) : ( badge && ( {badge} ) )}
{edition && (

{edition}

)} {title}
{hasFrontSlot ? ( ) : ( metadata.length > 0 && (
{metadata.map((item) => (
{item.label}
{item.value}
))}
) )}
{holder && (
Holder {holder}
)} {serial && ( {serial} )}
{backEyebrow && (

{backEyebrow}

)} {backTitle}
{serial && ( {serial} )}
{hasBackSlot ? ( ) : (
{accessNotes.length > 0 && (
{accessNotes.map((note) => (
{note.label}
{note.value}
))}
)}
)}
``` --- # Card stack > Review cards one at a time with swipe decisions, native form choices, keyboard actions and undo. - Kind: ui · Category: Layout and media · Interactivity: script - Install: `npx shadcn@latest add @haze/card-stack` - File: `src/components/haze/ui/card-stack.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/card-stack ## Use when - People are reviewing a small finite set of ideas and making a binary decision on each one. - A deck should support touch gestures while retaining explicit radio choices for every card. ## Avoid when - Use carousel for browsing content without recording a decision. - Use sortable-list when people need to compare or rearrange the entire set simultaneously. ## Alternatives - [carousel](https://hazeui.com/ui/carousel.md) - [sortable-list](https://hazeui.com/ui/sortable-list.md) - [card](https://hazeui.com/ui/card.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique caller supplied prefix for the control and its associated content. | | name | `string` | id | no | Prefix for submitted fields in the form name[itemId]. | | label | `string` | Review workspace ideas | no | Legend explaining the review task. | | items | `{ id: string; title: string; description: string; eyebrow?: string; details?: string[] }[]` | Three workspace improvement ideas | no | Finite review items with stable identifiers. | | skipLabel | `string` | Skip | no | Visible label for the negative decision. | | saveLabel | `string` | Shortlist | no | Visible label for the positive decision. | | headingLevel | `2 \| 3 \| 4` | 3 | no | Heading level for each card title. | | class | `string` | | no | Additional classes on this component's outer wrapper. | ## Accessibility - Without enhancement every card and its native Later, Skip and Shortlist radios is available as a normal form. - Enhancement shows one card at a time, keeps hidden radio decisions in the form, and exposes arrow actions on the focused deck group. - Undo returns to the preceding card and resets that card to undecided; completion and decisions are announced in a live region. - Swiping requires horizontal intent, leaves vertical page scroll available and discards canceled drags without recording a decision. - Key Left / Right on the deck: Skip or shortlist the current card. - Key Tab, Space: Choose the current card's native decision or activate Undo and Start again. ## Agent prompts ### Install and use Install the Haze UI component "Card stack" with `npx shadcn@latest add @haze/card-stack`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CardStack from "@/components/haze/ui/card-stack.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/card-stack.md ### Customize with real content Adapt the Haze card-stack ui for our product. Replace the demo values of these props with our real content: id, name, label, items, skipLabel, saveLabel, headingLevel, class. Keep the layout, the heading level rules and these accessibility details: Without enhancement every card and its native Later, Skip and Shortlist radios is available as a normal form. Enhancement shows one card at a time, keeps hidden radio decisions in the form, and exposes arrow actions on the focused deck group. Undo returns to the preceding card and resets that card to undecided; completion and decisions are announced in a live region. Swiping requires horizontal intent, leaves vertical page scroll available and discards canceled drags without recording a decision. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using card-stack, check it fits: use it when people are reviewing a small finite set of ideas and making a binary decision on each one.; a deck should support touch gestures while retaining explicit radio choices for every card.. Avoid it when use carousel for browsing content without recording a decision.; use sortable-list when people need to compare or rearrange the entire set simultaneously.. Alternatives: @haze/carousel, @haze/sortable-list, @haze/card. ## Example requests that should lead here - Create a small card deck for shortlisting workflow ideas with Undo - Let users review one proposal at a time with buttons, radio values and optional swipes ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Item { id: string; title: string; description: string; eyebrow?: string; details?: string[]; } interface Props { id: string; name?: string; label?: string; items?: Item[]; skipLabel?: string; saveLabel?: string; headingLevel?: 2 | 3 | 4; class?: string; } const { id, name = id, label = "Review workspace ideas", items = [{ id: "quiet-hours", title: "A calmer workday", description: "Pause nonessential notifications while your team is concentrating.", eyebrow: "Workflow idea", details: ["Set a shared focus window", "Let urgent messages through"] }, { id: "weekly-notes", title: "Weekly notes", description: "Collect short updates in one place before the next planning session.", eyebrow: "Team ritual", details: ["One update per project", "Keep decisions searchable"] }, { id: "clean-archive", title: "A lighter workspace", description: "Archive finished projects while keeping their decisions available.", eyebrow: "Workspace care", details: ["Review inactive projects", "Export before removing"] }], skipLabel = "Skip", saveLabel = "Shortlist", headingLevel = 3, class: className } = Astro.props; const Heading = ({ 2: "h2", 3: "h3", 4: "h4" } as const)[headingLevel]; ---
{label}

Choose {skipLabel.toLowerCase()} or {saveLabel.toLowerCase()}. With scripting enabled, swipe sideways or use the arrow keys.

{items.map((item, index) =>
{item.eyebrow &&

{item.eyebrow}

} {item.title}

{item.description}

{item.details &&
    {item.details.map((detail) =>
  • {detail}
  • )}
}
{[{ value: "skip", label: skipLabel }, { value: "save", label: saveLabel }].map((action) => )}
)}

{items.length} cards to review.

``` --- # Card > Bordered surface with an optional header, a body slot and a footer band; it can lift on hover when the whole card is a link. - Kind: ui · Category: Data display · Interactivity: none - Install: `npx shadcn@latest add @haze/card` - File: `src/components/haze/ui/card.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/card ## Use when - Grouping a settings section, a form or a summary on a darker page background - A header with a title and one action, such as a badge or a small button, next to it - A footer row of buttons that belongs to the card's content ## Avoid when - Wrapping a whole page section; use a plain section with a heading - Cards nested inside cards; use a separator inside one card ## Alternatives - [item](https://hazeui.com/ui/item.md) - [stat](https://hazeui.com/ui/stat.md) - [separator](https://hazeui.com/ui/separator.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | title | `string` | | no | Card heading. The header is drawn when a title, a description or the action slot exists. | | description | `string` | | no | One muted line under the title. | | headingLevel | `2 \| 3 \| 4` | 3 | no | Tag used for the title, so the card fits the heading outline of the page. | | padding | `"sm" \| "md"` | "md" | no | Inner spacing: 16 px for sm, 24 px for md. | | interactive | `boolean` | false | no | Lifts the card 2 px on hover and strengthens its border. Use it only when the whole card leads somewhere, for example with a stretched link inside. | | class | `string` | | no | Extra classes on the outer box. | | default slot | `slot` | | no | Card body. | | action slot | `slot` | | no | Top-right of the header, for a badge or a button. | | footer slot | `slot` | | no | Footer band with a top border and a darker fill, for buttons or a note. | ## Accessibility - The title is a real heading whose level you choose with headingLevel, so a card list does not skip levels. - The card itself has no role and is not focusable; put links and buttons inside it and let each one carry its own focus ring. - Do not wrap the card in an anchor. For a card that is one link, set interactive, add class="relative" and give one link inside it an after:absolute after:inset-0 overlay, so there is one focusable element with a clear name. The card shows its stronger border while that link has focus. - The hover lift is a translate and a shadow, switched off under prefers-reduced-motion. For a list row that is one link, the item component with href is the alternative. ## Agent prompts ### Install and use Install the Haze UI component "Card" with `npx shadcn@latest add @haze/card`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Card from "@/components/haze/ui/card.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/card.md ### Customize with real content Adapt the Haze card ui for our product. Replace the demo values of these props with our real content: title, description, headingLevel, padding, interactive, class, default slot, action slot, footer slot. Keep the layout, the heading level rules and these accessibility details: The title is a real heading whose level you choose with headingLevel, so a card list does not skip levels. The card itself has no role and is not focusable; put links and buttons inside it and let each one carry its own focus ring. Do not wrap the card in an anchor. For a card that is one link, set interactive, add class="relative" and give one link inside it an after:absolute after:inset-0 overlay, so there is one focusable element with a clear name. The card shows its stronger border while that link has focus. The hover lift is a translate and a shadow, switched off under prefers-reduced-motion. For a list row that is one link, the item component with href is the alternative. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using card, check it fits: use it when grouping a settings section, a form or a summary on a darker page background; a header with a title and one action, such as a badge or a small button, next to it; a footer row of buttons that belongs to the card's content. Avoid it when wrapping a whole page section; use a plain section with a heading; cards nested inside cards; use a separator inside one card. Alternatives: @haze/item, @haze/stat, @haze/separator. ## Example requests that should lead here - Add a card with a title, a description and a Save button in the footer - Show a card with a status tag in the top-right corner ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Props { title?: string; description?: string; /** Heading level of the title. Pick the level that fits the page outline. */ headingLevel?: 2 | 3 | 4; padding?: "sm" | "md"; /** Lifts the card on hover. Use it when the whole card leads somewhere. */ interactive?: boolean; class?: string; } const { title, description, headingLevel = 3, padding = "md", interactive = false, class: className } = Astro.props; const Heading = ({ 2: "h2", 3: "h3", 4: "h4" } as const)[headingLevel]; const hasAction = Astro.slots.has("action"); const hasFooter = Astro.slots.has("footer"); const hasHeader = Boolean(title || description || hasAction); const pad = { sm: "p-4", md: "p-4.5" }; const gap = { sm: "gap-3", md: "gap-4" }; const footerPad = { sm: "px-4 py-3", md: "px-4.5 py-3.5" }; ---
{ hasHeader && (
{title && {title}} {description &&

{description}

}
{hasAction && (
)}
) }
{ hasFooter && (
) }
``` --- # Carousel Cards > An editorial peeking card carousel with plain media panels, favorite toggles, tabular counter, and scroll-snap controls. - Kind: ui · Category: Layout and media · Interactivity: script - Install: `npx shadcn@latest add @haze/carousel-cards` - File: `src/components/haze/ui/carousel-cards.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/carousel-cards ## Use when - Readers browse a curated horizontal strip of travel, product, or editorial cards where the next card peeks in. - Each card benefits from visual artwork, a quick-save toggle, and compact rating or pricing metadata. ## Avoid when - Only one full-width slide should fill the viewport at a time. Use carousel instead. - Users make binary keep-or-skip decisions on one card at a time. Use card-stack. ## Alternatives - [carousel](https://hazeui.com/ui/carousel.md) - [card-stack](https://hazeui.com/ui/card-stack.md) - [bento-tile](https://hazeui.com/ui/bento-tile.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique ID for the horizontal scroll track. | | eyebrow | `string` | "Picked for this autumn" | no | Small editorial eyebrow line above the carousel heading. | | label | `string` | "Weekend escapes" | no | Visible heading naming the card carousel region. | | items | `EscapeCard[]` | | no | Card items with title, location, badge, rating, review count and price (scene is accepted but ignored). | | previousLabel | `string` | "Previous card" | no | Accessible label for the previous card button. | | nextLabel | `string` | "Next card" | no | Accessible label for the next card button. | | headingLevel | `2 \| 3 \| 4` | 3 | no | Heading level for the carousel heading. | | default slot | `slot` | | no | Optional custom list items replacing the default items prop. | | class | `string` | | no | Additional classes on the outer carousel section. | ## Accessibility - The track uses native CSS scroll-snap with tabindex=0 so keyboard and touch scrolling work inside the track without page overflow. - Favorite toggle buttons expose descriptive aria-label names, aria-pressed state, and polite live announcements. - Scroll stepping respects prefers-reduced-motion by switching to instant scrolling. - Key Left / Right: Step to the previous or next card when the track is focused. - Key Home / End: Jump to the first or last card in the carousel. - Key Tab then Enter or Space: Activate previous/next controls or toggle save buttons on individual cards. ## Agent prompts ### Install and use Install the Haze UI component "Carousel Cards" with `npx shadcn@latest add @haze/carousel-cards`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CarouselCards from "@/components/haze/ui/carousel-cards.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/carousel-cards.md ### Customize with real content Adapt the Haze carousel-cards ui for our product. Replace the demo values of these props with our real content: id, eyebrow, label, items, previousLabel, nextLabel, headingLevel, default slot, class. Keep the layout, the heading level rules and these accessibility details: The track uses native CSS scroll-snap with tabindex=0 so keyboard and touch scrolling work inside the track without page overflow. Favorite toggle buttons expose descriptive aria-label names, aria-pressed state, and polite live announcements. Scroll stepping respects prefers-reduced-motion by switching to instant scrolling. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using carousel-cards, check it fits: use it when readers browse a curated horizontal strip of travel, product, or editorial cards where the next card peeks in.; each card benefits from visual artwork, a quick-save toggle, and compact rating or pricing metadata.. Avoid it when only one full-width slide should fill the viewport at a time. use carousel instead.; users make binary keep-or-skip decisions on one card at a time. use card-stack.. Alternatives: @haze/carousel, @haze/card-stack, @haze/bento-tile. ## Example requests that should lead here - Add an editorial weekend escapes peeking card carousel with plain media headers, save toggles, and 01 / 06 counter. - Show a horizontal scroll-snap collection strip of travel cards with circular previous and next buttons. ## Source ```astro --- import { ChevronLeft, ChevronRight, Heart, Star } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; type SceneKind = "coastal" | "alpine" | "mesa" | "forest" | "harbor" | "archipelago"; interface EscapeCard { title: string; location: string; badge: string; rating: string; reviews: number; price: string; /** Kept for API compatibility; the media area is a plain fill (owner decision 2026-11-24). */ scene?: SceneKind; } interface Props { id: string; eyebrow?: string; label?: string; items?: EscapeCard[]; previousLabel?: string; nextLabel?: string; headingLevel?: 2 | 3 | 4; class?: string; } const { id, eyebrow = "Picked for this autumn", label = "Weekend escapes", items = [ { title: "Weekend in Lisbon", location: "Lisbon, Portugal", badge: "2 nights", rating: "4.92", reviews: 318, price: "€340", }, { title: "Zermatt Chalet", location: "Valais, Switzerland", badge: "3 nights", rating: "4.96", reviews: 214, price: "€620", }, { title: "Desert Quiet", location: "Sedona, Arizona", badge: "2 nights", rating: "4.89", reviews: 164, price: "€410", }, { title: "Cedar Cabin", location: "Olympic, Washington", badge: "3 nights", rating: "4.94", reviews: 289, price: "€480", }, { title: "Cliffside Lighthouse", location: "Acadia, Maine", badge: "2 nights", rating: "4.87", reviews: 142, price: "€365", }, { title: "Nordic Fjord", location: "Lofoten, Norway", badge: "4 nights", rating: "4.98", reviews: 196, price: "€740", }, ], previousLabel = "Previous card", nextLabel = "Next card", headingLevel = 3, class: className, } = Astro.props; const Heading = ({ 2: "h2", 3: "h3", 4: "h4" } as const)[headingLevel]; const hasCustomSlot = Astro.slots.has("default"); const totalFormatted = String(items.length).padStart(2, "0"); ---
{eyebrow &&

{eyebrow}

} {label}
01 / {totalFormatted}
    {hasCustomSlot ? ( ) : ( items.map((item) => { return (
  1. {item.badge}

    {item.title}

    {item.location}

    {item.price} total
  2. ); }) )}

``` --- # Carousel > A swipeable ordered list with snap points, previous and next buttons, and a live position indicator. - Kind: ui · Category: Layout and media · Interactivity: script - Install: `npx shadcn@latest add @haze/carousel` - File: `src/components/haze/ui/carousel.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/button, @haze/utils - Docs page: https://hazeui.com/ui/carousel ## Use when - Readers browse a small ordered set of product highlights - Cards should be available as a regular list when scripting is unavailable ## Avoid when - Each option chooses a view in the same workspace. Use tabs. - The items need side-by-side comparison. ## Alternatives - [tabs](https://hazeui.com/ui/tabs.md) - [marquee](https://hazeui.com/ui/marquee.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique ID for the scroll viewport. | | label | `string` | "Project highlights" | no | Visible heading and name of the region. | | previousLabel | `string` | "Previous slide" | no | Accessible name of the previous button. | | nextLabel | `string` | "Next slide" | no | Accessible name of the next button. | | headingLevel | `2 \| 3 \| 4 \| 5 \| 6` | 2 | no | Heading level for the title. | | default slot | `slot` | | no | One direct list item per slide. | | class | `string` | | no | Additional classes on the carousel section. | ## Accessibility - Slides start as a regular ordered list and gain horizontal scrolling when enhanced. - The component keeps focus on the navigation button and announces the slide position. - Motion follows the user's reduced-motion preference. Slides never advance automatically. - Key Tab then Enter or Space: Use the previous or next button. - Key Left or Right: Scroll with focus on the slide viewport. ## Agent prompts ### Install and use Install the Haze UI component "Carousel" with `npx shadcn@latest add @haze/carousel`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Carousel from "@/components/haze/ui/carousel.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/carousel.md ### Customize with real content Adapt the Haze carousel ui for our product. Replace the demo values of these props with our real content: id, label, previousLabel, nextLabel, headingLevel, default slot, class. Keep the layout, the heading level rules and these accessibility details: Slides start as a regular ordered list and gain horizontal scrolling when enhanced. The component keeps focus on the navigation button and announces the slide position. Motion follows the user's reduced-motion preference. Slides never advance automatically. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using carousel, check it fits: use it when readers browse a small ordered set of product highlights; cards should be available as a regular list when scripting is unavailable. Avoid it when each option chooses a view in the same workspace. use tabs.; the items need side-by-side comparison.. Alternatives: @haze/tabs, @haze/marquee. ## Example requests that should lead here - Place three product feature cards in a user-controlled carousel with keyboard navigation. ## Source ```astro --- import { ChevronLeft, ChevronRight } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Button from "./button.astro"; interface Props { id: string; label?: string; previousLabel?: string; nextLabel?: string; headingLevel?: 2 | 3 | 4 | 5 | 6; class?: string; } const { id, label = "Project highlights", previousLabel = "Previous slide", nextLabel = "Next slide", headingLevel = 2, class: className, } = Astro.props; const Heading = `h${headingLevel}` as const; ---
{label}
    li]:min-w-0", "[[data-haze-carousel][data-enhanced]_&]:auto-cols-[100%] [[data-haze-carousel][data-enhanced]_&]:grid-flow-col [[data-haze-carousel][data-enhanced]_&]:overflow-x-auto", "snap-x snap-mandatory overscroll-x-contain motion-safe:scroll-smooth [&>li]:snap-start", "focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring", )}>
  1. Invite reviewers to your project.
  2. Publish an update after the review.
``` --- # Chat thread > An assistant or person conversation: timed bubbles that rise in, a typing indicator and a message box with a send button. - Kind: ui · Category: Data display · Interactivity: script - Install: `npx shadcn@latest add @haze/chat-thread` - File: `src/components/haze/ui/chat-thread.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/avatar, @haze/utils - Docs page: https://hazeui.com/ui/chat-thread ## Use when - A product has an AI assistant or agent the user talks to - A support or sales screen shows a short conversation with a reply box ## Avoid when - The screen lists many conversations to choose from. Use inbox-list. - Messages are announcements, not a dialogue. Use notification-stack. ## Alternatives - [inbox-list](https://hazeui.com/ui/inbox-list.md) - [notification-stack](https://hazeui.com/ui/notification-stack.md) - [timeline](https://hazeui.com/ui/timeline.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Base for the message box id. | | title | `string` | "Mira, sales assistant" | no | Visible name of the conversation. | | subtitle | `string` | | no | Line under the title: role or state. | | messages | `{ from: "user" \| "assistant"; name: string; text: string; time?: string }[]` | | no | Messages, oldest first. | | typing | `boolean` | true | no | Shows three dots while the assistant writes. | | action | `string` | "#send" | no | Where the message form posts; empty hides the composer. | | placeholder | `string` | "Write a message…" | no | Placeholder and label of the message box. | | sendLabel | `string` | "Send" | no | Accessible name of the send button. | | typingLabel | `string` | "Mira is writing" | no | Screen-reader text for the typing dots. | | class | `string` | | no | Additional classes on the panel. | ## Accessibility - Messages sit in a list with the log role, and each starts with its sender's name for screen readers. - The typing dots are hidden from assistive technology and replaced by a status text. - Key Tab: Move to the message box, then to Send. - Key Enter: Send the message when scripts run. Shift+Enter adds a new line. ## Agent prompts ### Install and use Install the Haze UI component "Chat thread" with `npx shadcn@latest add @haze/chat-thread`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ChatThread from "@/components/haze/ui/chat-thread.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/chat-thread.md ### Customize with real content Adapt the Haze chat-thread ui for our product. Replace the demo values of these props with our real content: id, title, subtitle, messages, typing, action, placeholder, sendLabel, typingLabel, class. Keep the layout, the heading level rules and these accessibility details: Messages sit in a list with the log role, and each starts with its sender's name for screen readers. The typing dots are hidden from assistive technology and replaced by a status text. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using chat-thread, check it fits: use it when a product has an ai assistant or agent the user talks to; a support or sales screen shows a short conversation with a reply box. Avoid it when the screen lists many conversations to choose from. use inbox-list.; messages are announcements, not a dialogue. use notification-stack.. Alternatives: @haze/inbox-list, @haze/notification-stack, @haze/timeline. ## Example requests that should lead here - Add an assistant chat panel with a few messages, a typing indicator and a message box. ## Source ```astro --- import { ArrowUp } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Avatar from "./avatar.astro"; interface Message { from: "user" | "assistant"; /** Sender name; read before the message and used for the assistant's avatar. */ name: string; text: string; /** Time as it should read, such as "09:41". */ time?: string; } interface Props { /** Required. The composer's ids are derived from it. */ id: string; /** Visible title of the conversation, such as the agent's name. */ title?: string; /** Line under the title: the agent's role or state. */ subtitle?: string; messages?: Message[]; /** Shows three dots under the last message while the assistant writes. */ typing?: boolean; /** Where the composer form posts. Leave empty to hide the composer. */ action?: string; placeholder?: string; sendLabel?: string; /** Screen-reader text for the typing dots. */ typingLabel?: string; class?: string; } const { id, title = "Mira, sales assistant", subtitle = "Answers from your price list and FAQ", messages = [ { from: "user", name: "You", text: "Can a customer book two services in one visit?", time: "09:40" }, { from: "assistant", name: "Mira", text: "Yes. They pick both services on the booking page and get one time slot long enough for both, 75 minutes for a cut and color.", time: "09:40", }, { from: "user", name: "You", text: "And if the stylist is busy for that long?", time: "09:41" }, ], typing = true, action = "#send", placeholder = "Write a message…", sendLabel = "Send", typingLabel = "Mira is writing", class: className, } = Astro.props; // Without a caller-supplied action the composer is a local demo: a script appends the message instead of posting. const local = Astro.props.action === undefined; const assistant = messages.find((m) => m.from === "assistant")?.name ?? title; ---

{title}

{subtitle &&

{subtitle}

}
    { messages.map((m) => (
  1. {m.name}:

    {m.text}

    {m.time && {m.time}}
  2. )) } { typing && (
  3. {typingLabel}
  4. ) }
{ action && (
) }
``` --- # Check runs > A list of automated checks such as tests, lint and build, each with its state, command, last run and Output and Run actions. - Kind: ui · Category: Feedback · Interactivity: none - Install: `npx shadcn@latest add @haze/check-runs` - File: `src/components/haze/ui/check-runs.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/button, @haze/utils - Docs page: https://hazeui.com/ui/check-runs ## Use when - A project dashboard shows whether its tests, lint, typecheck and build pass - A deploy screen lists the checks that gate a release ## Avoid when - The steps run in a fixed order a person walks through. Use stepper. - Only one overall state matters. Use status or alert. ## Alternatives - [stepper](https://hazeui.com/ui/stepper.md) - [status](https://hazeui.com/ui/status.md) - [uptime-tracker](https://hazeui.com/ui/uptime-tracker.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | title | `string` | "Checks" | no | Visible title; also names the section. | | checks | `{ name: string; command?: string; state: "passed" \| "failed" \| "running" \| "cancelled" \| "never"; detail?: string; outputHref?: string; runHref?: string }[]` | | no | Checks in display order. | | stateLabels | `Partial>` | | no | Replaces the words for each state, for translation. | | runLabel | `string` | "Run" | no | Label of the button that starts a check. | | outputLabel | `string` | "Output" | no | Label of the link to a check's output. | | headingLevel | `2 \| 3 \| 4` | 3 | no | Level of the list's title. | | class | `string` | | no | Additional classes on the panel. | ## Accessibility - Every state is written out next to its icon, so passed and failed never rely on green and red alone. - The Output and Run buttons name the check they act on, such as "Run Typecheck". - Key Tab: Move through the Output and Run actions. ## Agent prompts ### Install and use Install the Haze UI component "Check runs" with `npx shadcn@latest add @haze/check-runs`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CheckRuns from "@/components/haze/ui/check-runs.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/check-runs.md ### Customize with real content Adapt the Haze check-runs ui for our product. Replace the demo values of these props with our real content: title, checks, stateLabels, runLabel, outputLabel, headingLevel, class. Keep the layout, the heading level rules and these accessibility details: Every state is written out next to its icon, so passed and failed never rely on green and red alone. The Output and Run buttons name the check they act on, such as "Run Typecheck". Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using check-runs, check it fits: use it when a project dashboard shows whether its tests, lint, typecheck and build pass; a deploy screen lists the checks that gate a release. Avoid it when the steps run in a fixed order a person walks through. use stepper.; only one overall state matters. use status or alert.. Alternatives: @haze/stepper, @haze/status, @haze/uptime-tracker. ## Example requests that should lead here - Add a checks panel listing tests, lint, typecheck and build with pass or fail, duration and a Run button. ## Source ```astro --- import { CircleCheck, CircleDashed, CircleSlash, CircleX, LoaderCircle } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Button from "./button.astro"; type State = "passed" | "failed" | "running" | "cancelled" | "never"; interface Check { name: string; /** The command that runs the check, shown in monospace. */ command?: string; state: State; /** When it last ran and how long it took, as it should read: "2 min ago · 14 s". */ detail?: string; /** Link to the check's output. */ outputHref?: string; /** Link or form target that starts the check again. */ runHref?: string; } interface Props { /** Visible title of the list. */ title?: string; checks?: Check[]; /** Overrides the words used for each state, for translation. */ stateLabels?: Partial>; runLabel?: string; outputLabel?: string; headingLevel?: 2 | 3 | 4; class?: string; } const { title = "Checks", checks = [ { name: "Unit tests", command: "pnpm test", state: "passed", detail: "4 min ago · 18 s", outputHref: "#tests", runHref: "#run-tests" }, { name: "Lint", command: "pnpm lint", state: "passed", detail: "4 min ago · 6 s", outputHref: "#lint", runHref: "#run-lint" }, { name: "Typecheck", command: "pnpm typecheck", state: "failed", detail: "4 min ago · 11 s · exit code 2", outputHref: "#types", runHref: "#run-types" }, { name: "Build", command: "pnpm build", state: "running", detail: "Started 20 s ago", outputHref: "#build" }, { name: "End-to-end", command: "pnpm test:e2e", state: "never", runHref: "#run-e2e" }, ], stateLabels = {}, runLabel = "Run", outputLabel = "Output", headingLevel = 3, class: className, } = Astro.props; const H = `h${headingLevel}` as "h3"; const labels: Record = { passed: "Passed", failed: "Failed", running: "Running", cancelled: "Cancelled", never: "Never run", ...stateLabels }; const tones: Record = { passed: "text-success", failed: "text-destructive", running: "text-brand", cancelled: "text-muted-foreground", never: "text-muted-foreground", }; const icons = { passed: CircleCheck, failed: CircleX, running: LoaderCircle, cancelled: CircleSlash, never: CircleDashed }; const ran = checks.filter((c) => c.state === "passed" || c.state === "failed"); const passed = ran.filter((c) => c.state === "passed").length; const failed = ran.length - passed; ---
{title}

{passed} passed{failed > 0 && , {failed} failed}

    { checks.map((check) => { const Icon = icons[check.state]; return (
  • ); }) }
``` --- # Checkbox Group > A labeled set of native checkboxes with a select-all control that reflects partial selection. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/checkbox-group` - File: `src/components/haze/ui/checkbox-group.astro` - npm dependencies: none - Registry dependencies: @haze/checkbox, @haze/utils - Docs page: https://hazeui.com/ui/checkbox-group ## Use when - People can choose several items in a visible group. - A bulk selection shortcut saves several clicks. ## Avoid when - The choices favor search or take too much vertical space. ## Alternatives - [checkbox](https://hazeui.com/ui/checkbox.md) - [multi-select](https://hazeui.com/ui/multi-select.md) - [radio-group](https://hazeui.com/ui/radio-group.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique ID prefix for this group and its inputs. | | name | `string` | id | no | Repeated field name for selected values. | | legend | `string` | Notifications | no | Visible group label. | | options | `Option[]` | | no | Choices with value, label, and optional description or disabled state. | | values | `string[]` | [] | no | Initially checked values. | | selectAllLabel | `string` | Select all | no | Label for the master checkbox. | | disabled | `boolean` | | no | Disables the group. | | form | `string` | | no | ID of a form outside the group. | | class | `string` | | no | Classes for the fieldset. | ## Accessibility - The native master checkbox announces its mixed state after a partial selection. - Bulk changes apply to enabled choices. The individual checkboxes still work without scripting. - Key Tab: Move to the master checkbox or an individual choice. - Key Space: Toggle the focused checkbox. ## Agent prompts ### Install and use Install the Haze UI component "Checkbox Group" with `npx shadcn@latest add @haze/checkbox-group`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CheckboxGroup from "@/components/haze/ui/checkbox-group.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/checkbox-group.md ### Customize with real content Adapt the Haze checkbox-group ui for our product. Replace the demo values of these props with our real content: id, name, legend, options, values, selectAllLabel, disabled, form, class. Keep the layout, the heading level rules and these accessibility details: The native master checkbox announces its mixed state after a partial selection. Bulk changes apply to enabled choices. The individual checkboxes still work without scripting. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using checkbox-group, check it fits: use it when people can choose several items in a visible group.; a bulk selection shortcut saves several clicks.. Avoid it when the choices favor search or take too much vertical space.. Alternatives: @haze/checkbox, @haze/multi-select, @haze/radio-group. ## Example requests that should lead here - Add opt-in notification topics with a select-all checkbox. - Let an editor select several filters from a labeled checkbox group. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; import Checkbox from "./checkbox.astro"; interface Option { value: string; label: string; description?: string; disabled?: boolean } interface Props { id: string; name?: string; legend?: string; options?: Option[]; values?: string[]; selectAllLabel?: string; disabled?: boolean; form?: string; class?: string; [key: string]: unknown; } const { id, name = id, legend = "Notifications", values = [], selectAllLabel = "Select all", disabled, form, class: className, ...rest } = Astro.props; const options = Astro.props.options ?? [ { value: "mentions", label: "Mentions" }, { value: "reviews", label: "Review requests" }, { value: "releases", label: "Releases" }, ]; ---
{legend} {options.some((option) => !option.disabled) && } {options.map((option, index) => )}
``` --- # Checkbox Tree > Nested checkboxes with expandable groups. A parent shows checked, unchecked or mixed from its descendants and sets them all. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/checkbox-tree` - File: `src/components/haze/ui/checkbox-tree.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/checkbox-tree, @haze/utils - Docs page: https://hazeui.com/ui/checkbox-tree ## Use when - Permissions, scopes or categories that come in groups with sub-options. - Choosing a subset of a hierarchy, for example folders to sync. ## Avoid when - A flat list; use checkbox. - Browsing items that are opened rather than selected; use file-tree. ## Alternatives - [checkbox](https://hazeui.com/ui/checkbox.md) - [file-tree](https://hazeui.com/ui/file-tree.md) - [tree-table](https://hazeui.com/ui/tree-table.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique ID for the tree; input IDs derive from it. | | label | `string` | Permissions | no | Accessible name of the group. | | name | `string` | id | no | Form field name shared by the leaf checkboxes, whose value is the item id. Parents are not submitted. | | items | `{ id, label, checked?, disabled?, expanded?, children? }[]` | | no | The tree, to any depth. A demo permissions tree is used when omitted. Leaves hold the checked state; a parent starts checked when all its enabled leaves are. | | class | `string` | | no | Classes on the wrapper. | ## Accessibility - Every box is a native checkbox. A parent in the mixed state uses the native indeterminate property, which is exposed as mixed, and shows a minus. - Toggles are buttons with aria-expanded and aria-controls and appear once scripts run; without scripts every group stays open and leaf checkboxes still submit. - Disabled leaves keep their state and are skipped when a parent is toggled and when its state is worked out. - A tree-change event bubbles with the list of checked leaf values. - Key Tab / Shift+Tab: Move between checkboxes and group toggles. - Key Space: Toggle the focused checkbox. - Key Arrow Down / Arrow Up: Move to the next or previous visible checkbox. - Key Arrow Right / Arrow Left: Open a group or enter it; close a group or move to its parent. - Key Home / End: First or last visible checkbox. ## Agent prompts ### Install and use Install the Haze UI component "Checkbox Tree" with `npx shadcn@latest add @haze/checkbox-tree`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CheckboxTree from "@/components/haze/ui/checkbox-tree.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/checkbox-tree.md ### Customize with real content Adapt the Haze checkbox-tree ui for our product. Replace the demo values of these props with our real content: id, label, name, items, class. Keep the layout, the heading level rules and these accessibility details: Every box is a native checkbox. A parent in the mixed state uses the native indeterminate property, which is exposed as mixed, and shows a minus. Toggles are buttons with aria-expanded and aria-controls and appear once scripts run; without scripts every group stays open and leaf checkboxes still submit. Disabled leaves keep their state and are skipped when a parent is toggled and when its state is worked out. A tree-change event bubbles with the list of checked leaf values. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using checkbox-tree, check it fits: use it when permissions, scopes or categories that come in groups with sub-options.; choosing a subset of a hierarchy, for example folders to sync.. Avoid it when a flat list; use checkbox.; browsing items that are opened rather than selected; use file-tree.. Alternatives: @haze/checkbox, @haze/file-tree, @haze/tree-table. ## Example requests that should lead here - Add a permissions picker where each group can be selected as a whole ## Source ```astro --- import { Check, ChevronRight, Minus } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import CheckboxTree from "./checkbox-tree.astro"; export interface CheckboxTreeItem { id: string; label: string; checked?: boolean; disabled?: boolean; expanded?: boolean; children?: CheckboxTreeItem[]; } interface Props { id: string; label?: string; name?: string; items?: CheckboxTreeItem[]; nested?: boolean; class?: string; } const demo: CheckboxTreeItem[] = [ { id: "workspace", label: "Workspace", children: [ { id: "members", label: "Members", children: [{ id: "members-view", label: "View members", checked: true }, { id: "members-invite", label: "Invite members", checked: true }, { id: "members-remove", label: "Remove members" }] }, { id: "billing", label: "Billing", expanded: false, children: [{ id: "billing-view", label: "View invoices" }, { id: "billing-edit", label: "Change plan" }] }, { id: "audit", label: "Read the audit log" }, ], }, { id: "projects", label: "Projects", children: [{ id: "projects-create", label: "Create projects", checked: true }, { id: "projects-delete", label: "Delete projects", disabled: true }] }, ]; const { id, label = "Permissions", name = id, items = demo, nested = false, class: className } = Astro.props; const leaves = (item: CheckboxTreeItem): CheckboxTreeItem[] => (item.children?.length ? item.children.flatMap(leaves) : [item]); const checkedState = (item: CheckboxTreeItem) => { const active = leaves(item).filter(leaf => !leaf.disabled); return active.length > 0 && active.every(leaf => leaf.checked); }; const box = "peer col-start-1 row-start-1 size-4.5 cursor-pointer appearance-none rounded-sm border border-border-strong bg-field transition-[background-color,border-color,scale] duration-150 ease-snappy hover:border-foreground active:scale-90 active:duration-75 checked:border-primary checked:hover:border-primary checked:bg-primary indeterminate:border-primary indeterminate:bg-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring disabled:cursor-not-allowed disabled:hover:border-border-strong disabled:active:scale-100 forced-colors:appearance-auto"; ---
    {items.map(item => (
  • {item.children?.length ? ( <>
    ) : (
    )}
  • ))}
``` --- # Checkbox > A native checkbox with a label, optional description, and a mixed state for partially selected groups. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/checkbox` - File: `src/components/haze/ui/checkbox.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/checkbox ## Use when - Accepting terms or opting in to emails - Independent yes/no settings that are saved with a submit button - A list where several options can be on at once ## Avoid when - Settings that apply the moment they are flipped; use switch - Exactly one choice from a group; use radio-group ## Alternatives - [switch](https://hazeui.com/ui/switch.md) - [radio-group](https://hazeui.com/ui/radio-group.md) - [field](https://hazeui.com/ui/field.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Input id; the label's for and the description id (-description) derive from it. | | name | `string` | id | no | Form field name. | | label | `string` | | yes | Visible label text. | | description | `string` | | no | Secondary line; the input points at it with aria-describedby. | | checked | `boolean` | | no | Initial checked state. | | indeterminate | `boolean` | | no | Shows a mixed state initially and after a form reset. Checked still determines the submitted value. | | disabled | `boolean` | | no | Dims the box and its label (the description stays readable) and blocks input. | | value | `string` | | no | Value submitted when checked; the browser default is "on". | | class | `string` | | no | Extra classes on the wrapper. | | ...rest | `attributes` | | no | Any other input attribute, for example required or aria-invalid. | ## Accessibility - The input stays a real checkbox, so checked state, form submission and the label click target all come from the browser. - The mixed-state indicator uses the native indeterminate property. Without JavaScript the checked state remains available. - The check mark scales in over 200 ms and a press shrinks the box. The box border is foreground at 40%, which meets 3:1 against the surface. - In Windows forced-colors mode the custom drawing is dropped (appearance-auto) and the system checkbox shows instead. - The description is linked with aria-describedby only when it exists, so no dangling id reaches the accessibility tree. - Key Space: Toggles the checkbox - Key Tab: Moves to the next control ## Agent prompts ### Install and use Install the Haze UI component "Checkbox" with `npx shadcn@latest add @haze/checkbox`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Checkbox from "@/components/haze/ui/checkbox.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/checkbox.md ### Customize with real content Adapt the Haze checkbox ui for our product. Replace the demo values of these props with our real content: id, name, label, description, checked, indeterminate, disabled, value, class, ...rest. Keep the layout, the heading level rules and these accessibility details: The input stays a real checkbox, so checked state, form submission and the label click target all come from the browser. The mixed-state indicator uses the native indeterminate property. Without JavaScript the checked state remains available. The check mark scales in over 200 ms and a press shrinks the box. The box border is foreground at 40%, which meets 3:1 against the surface. In Windows forced-colors mode the custom drawing is dropped (appearance-auto) and the system checkbox shows instead. The description is linked with aria-describedby only when it exists, so no dangling id reaches the accessibility tree. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using checkbox, check it fits: use it when accepting terms or opting in to emails; independent yes/no settings that are saved with a submit button; a list where several options can be on at once. Avoid it when settings that apply the moment they are flipped; use switch; exactly one choice from a group; use radio-group. Alternatives: @haze/switch, @haze/radio-group, @haze/field. ## Example requests that should lead here - Add a terms checkbox above the sign-up button - Create a list of notification checkboxes with descriptions ## Source ```astro --- import { Check, Minus } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id: string; name?: string; label: string; description?: string; checked?: boolean; indeterminate?: boolean; disabled?: boolean; value?: string; class?: string; /** Any other input attribute, for example required, aria-invalid or form. */ [key: string]: unknown; } const { id, name = id, label, description, checked, indeterminate, disabled, value, class: className, ...rest } = Astro.props; ---
span]:opacity-50 has-[:disabled]:[&_label]:opacity-50", className)}>
{description &&

{description}

}
``` --- # Chip group > Native multi-select filter chips with a checkmark and a width change for selected values. - Kind: ui · Category: Forms · Interactivity: native - Install: `npx shadcn@latest add @haze/chip-group` - File: `src/components/haze/ui/chip-group.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/chip-group ## Use when - Several facets can be chosen independently. - Filters should submit as repeated values in a standard form. ## Avoid when - Use a Radio Group for one mutually exclusive choice. ## Alternatives - [checkbox-group](https://hazeui.com/ui/checkbox-group.md) - [toggle-group](https://hazeui.com/ui/toggle-group.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | name | `string` | | no | Shared form field name. | | legend | `string` | | no | Visible group legend. | | options | `Option[]` | | no | Label, value and optional disabled state per chip. | | values | `string[]` | | no | Values checked on first render. | | form | `string` | | no | ID of an external form owner. | | class | `string` | | no | Classes for the fieldset. | ## Accessibility - Each chip exposes native checked and disabled state. - The group uses a visible legend. - Key Keyboard: Tab focuses a chip. Space toggles its checked state. ## Agent prompts ### Install and use Install the Haze UI component "Chip group" with `npx shadcn@latest add @haze/chip-group`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ChipGroup from "@/components/haze/ui/chip-group.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/chip-group.md ### Customize with real content Adapt the Haze chip-group ui for our product. Replace the demo values of these props with our real content: name, legend, options, values, form, class. Keep the layout, the heading level rules and these accessibility details: Each chip exposes native checked and disabled state. The group uses a visible legend. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using chip-group, check it fits: use it when several facets can be chosen independently.; filters should submit as repeated values in a standard form.. Avoid it when use a radio group for one mutually exclusive choice.. Alternatives: @haze/checkbox-group, @haze/toggle-group. ## Example requests that should lead here - Add animated filter chips for release topics that submit as a normal form. ## Source ```astro --- import { Check } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Option { label: string; value: string; disabled?: boolean; } interface Props { name?: string; legend?: string; options?: Option[]; values?: string[]; form?: string; class?: string; } const { name = "status", legend = "Show issues", options = [ { label: "Open", value: "open" }, { label: "In review", value: "review" }, { label: "Closed", value: "closed" }, ], values = ["open"], form, class: className } = Astro.props; ---
{legend}
{options.map(option => ( ))}
``` --- # Chip > A compact label that can act as a form choice and expose a separate remove button. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/chip` - File: `src/components/haze/ui/chip.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/chip ## Use when - A short filter label needs to be selectable or removable. - Several options should wrap into one compact row. ## Avoid when - Every option needs a title, description, and larger click target. ## Alternatives - [tag](https://hazeui.com/ui/tag.md) - [checkbox-group](https://hazeui.com/ui/checkbox-group.md) - [tags-input](https://hazeui.com/ui/tags-input.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique ID for the label or checkbox. | | label | `string` | Design | no | Visible chip text. | | name | `string` | id | no | Submitted field name when selectable. | | value | `string` | label | no | Submitted value when selected. | | selectable | `boolean` | | no | Render as a native checkbox. | | selected | `boolean` | | no | Initial selection when selectable. | | removable | `boolean` | | no | Show a separate remove button when scripting is available. | | disabled | `boolean` | | no | Disable selection and removal. | | class | `string` | | no | Classes for the chip wrapper. | ## Accessibility - Selection uses a native checkbox and a visible check icon. - The remove action dispatches a cancelable haze:chip-remove event before hiding the chip and removing its value. - Key Space: Select or clear the focused chip. - Key Enter / Space: Remove the chip from its remove button. ## Agent prompts ### Install and use Install the Haze UI component "Chip" with `npx shadcn@latest add @haze/chip`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Chip from "@/components/haze/ui/chip.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/chip.md ### Customize with real content Adapt the Haze chip ui for our product. Replace the demo values of these props with our real content: id, label, name, value, selectable, selected, removable, disabled, class. Keep the layout, the heading level rules and these accessibility details: Selection uses a native checkbox and a visible check icon. The remove action dispatches a cancelable haze:chip-remove event before hiding the chip and removing its value. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using chip, check it fits: use it when a short filter label needs to be selectable or removable.; several options should wrap into one compact row.. Avoid it when every option needs a title, description, and larger click target.. Alternatives: @haze/tag, @haze/checkbox-group, @haze/tags-input. ## Example requests that should lead here - Add selectable and removable team filters. - Render compact tags that can be removed without toggling their selection first. ## Source ```astro --- import { Check, X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id: string; label?: string; name?: string; value?: string; selectable?: boolean; selected?: boolean; removable?: boolean; disabled?: boolean; class?: string; [key: string]: unknown; } const { id, label = "Design", name = id, value = label, selectable, selected, removable, disabled, class: className, ...rest } = Astro.props; const badge = "flex min-h-8 min-w-0 items-center gap-1 rounded-full px-2.5 py-0.5 text-[0.8125rem]/5 font-medium wrap-anywhere"; --- {selectable ? ( ) : {label}} {removable && } ``` --- # Choice card > Radio options drawn as selectable cards, each with a title, a description and an optional trailing hint such as a price. - Kind: ui · Category: Forms · Interactivity: native - Install: `npx shadcn@latest add @haze/choice-card` - File: `src/components/haze/ui/choice-card.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/choice-card ## Use when - Picking a plan, a role or a deployment target where each option needs a sentence of explanation - Two to four options that deserve more visual weight than a plain radio list ## Avoid when - Long lists of options; use select - Short labels that fit in a compact row; use toggle-group - Choices where several can be picked at once ## Alternatives - [radio-group](https://hazeui.com/ui/radio-group.md) - [toggle-group](https://hazeui.com/ui/toggle-group.md) - [select](https://hazeui.com/ui/select.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | name | `string` | | yes | Shared radio name; the form submits the chosen value under it. | | legend | `string` | | yes | Visible group title, announced as the group name. | | options | `{ value: string; title: string; description?: string; hint?: string; disabled?: boolean }[]` | | yes | The cards; hint is short trailing text such as a price, and disabled turns off that card only. | | value | `string` | | no | Value of the card that is checked on load. | | columns | `1 \| 2` | 1 | no | Layout; two columns apply from the sm breakpoint, narrower screens stack. | | required | `boolean` | | no | One card must be picked before the form submits; set on every radio. | | disabled | `boolean` | | no | Disables every card through the fieldset. | | class | `string` | | no | Extra classes on the fieldset. | | ...rest | `attributes` | | no | Any other fieldset attribute, for example form or aria-describedby. | ## Accessibility - The whole card is one label around a real radio, so the title, description and hint are read as the radio's name and the entire card is the click target. - The checked card gets a stronger border and a tinted background, and its radio box fills with a dot that scales in, so the state does not rely on color alone. Under forced colors the native radio is shown. - Disabled cards are dimmed, show a not-allowed cursor and ignore hover. - The focus outline is drawn around the card with has-focus-visible, not around the small radio. - Key Arrow keys: Move between cards and select the one reached - Key Tab: Enters or leaves the group at the checked card ## Agent prompts ### Install and use Install the Haze UI component "Choice card" with `npx shadcn@latest add @haze/choice-card`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ChoiceCard from "@/components/haze/ui/choice-card.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/choice-card.md ### Customize with real content Adapt the Haze choice-card ui for our product. Replace the demo values of these props with our real content: name, legend, options, value, columns, required, disabled, class, ...rest. Keep the layout, the heading level rules and these accessibility details: The whole card is one label around a real radio, so the title, description and hint are read as the radio's name and the entire card is the click target. The checked card gets a stronger border and a tinted background, and its radio box fills with a dot that scales in, so the state does not rely on color alone. Under forced colors the native radio is shown. Disabled cards are dimmed, show a not-allowed cursor and ignore hover. The focus outline is drawn around the card with has-focus-visible, not around the small radio. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using choice-card, check it fits: use it when picking a plan, a role or a deployment target where each option needs a sentence of explanation; two to four options that deserve more visual weight than a plain radio list. Avoid it when long lists of options; use select; short labels that fit in a compact row; use toggle-group; choices where several can be picked at once. Alternatives: @haze/radio-group, @haze/toggle-group, @haze/select. ## Example requests that should lead here - Add a plan picker with Solo, Team and Scale cards that show a price - Make a two-column role picker for the invite dialog ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Option { value: string; title: string; description?: string; /** Short trailing text, such as a price. */ hint?: string; /** Disables this card only. */ disabled?: boolean; } interface Props { /** Shared radio name. */ name: string; legend: string; options: Option[]; /** The value that is checked on load. */ value?: string; /** 2 columns apply from the sm breakpoint; below it the cards stack. */ columns?: 1 | 2; /** One card must be picked before the form submits. */ required?: boolean; /** Disables every card. */ disabled?: boolean; class?: string; /** Any other fieldset attribute, for example form or aria-describedby. */ [key: string]: unknown; } const { name, legend, options, value, columns = 1, required, disabled, class: className, ...rest } = Astro.props; ---
{legend}
{ options.map((option) => ( )) }
``` --- # Code block > Multi-line code in a bordered panel with an optional file name and language header and a copy button added by script; no highlighting. - Kind: ui · Category: Data display · Interactivity: script - Install: `npx shadcn@latest add @haze/code-block` - File: `src/components/haze/ui/code-block.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/code-block ## Use when - Showing a file, a config or a short example in documentation - A listing with a file name so readers know where the code lives - Code that readers will copy whole ## Avoid when - A single command people paste into a terminal; snippet is one line and smaller - Code that needs syntax colors or line numbers; this component ships neither ## Alternatives - [snippet](https://hazeui.com/ui/snippet.md) - [kbd](https://hazeui.com/ui/kbd.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | code | `string` | | yes | The source text. Rendered inside
, so line breaks and indentation are kept. |
| filename | `string` |  | no | File name in the header bar. Also the aria-label of the code region. |
| lang | `string` |  | no | Small uppercase language label at the right of the header, for example "astro". |
| copyLabel | `string` | "Copy code" | no | Accessible name of the copy button. The button sits in the header, so it exists only when filename or lang is set. |
| copiedLabel | `string` | "Copied" | no | Text announced after a successful copy. |
| failedLabel | `string` | "Copy failed" | no | Text announced when the browser refuses the copy. |
| class | `string` |  | no | Extra classes on the outer panel. |

## Accessibility
- The 
 is a focusable region named by the file name (or "Code"), so keyboard users can scroll lines that are wider than the box (WCAG 2.1.1).
- There is no syntax highlighting, so meaning never depends on token colors and the text keeps full contrast.
- The copy button is revealed by script, so without script the code is still selectable text and no dead button appears.
- After a copy, "Copied" or "Copy failed" is announced through a role="status" region, and the icon shows a check or a cross for 2 seconds.
- The language label is text in the header, not a class on the code, so it is read with the file name.
- Key Tab: Move to the copy button, then to the code region
- Key Enter / Space: Copy the code to the clipboard
- Key Arrow keys: Scroll the code region sideways or vertically while it has focus

## Agent prompts

### Install and use

Install the Haze UI component "Code block" with `npx shadcn@latest add @haze/code-block`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CodeBlock from "@/components/haze/ui/code-block.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/code-block.md

### Customize with real content

Adapt the Haze code-block ui for our product. Replace the demo values of these props with our real content: code, filename, lang, copyLabel, copiedLabel, failedLabel, class. Keep the layout, the heading level rules and these accessibility details: The 
 is a focusable region named by the file name (or "Code"), so keyboard users can scroll lines that are wider than the box (WCAG 2.1.1). There is no syntax highlighting, so meaning never depends on token colors and the text keeps full contrast. The copy button is revealed by script, so without script the code is still selectable text and no dead button appears. After a copy, "Copied" or "Copy failed" is announced through a role="status" region, and the icon shows a check or a cross for 2 seconds. The language label is text in the header, not a class on the code, so it is read with the file name. Do not add raw color classes; use the Haze tokens.

### Choose the right block

Before using code-block, check it fits: use it when showing a file, a config or a short example in documentation; a listing with a file name so readers know where the code lives; code that readers will copy whole. Avoid it when a single command people paste into a terminal; snippet is one line and smaller; code that needs syntax colors or line numbers; this component ships neither. Alternatives: @haze/snippet, @haze/kbd.

## Example requests that should lead here
- Show this Astro component in a code block named waitlist-cta.astro
- Add a code block with a JSON config and a json label

## Source

```astro
---
import { Copy, Check, X } from "@lucide/astro";
import { cn } from "../../../lib/haze/utils";

interface Props {
  code: string;
  /** File name shown in the header bar; also names the scroll region. */
  filename?: string;
  /** Small language label in the header, for example "astro". */
  lang?: string;
  /** Accessible name of the copy button (shown in the header, so only when filename or lang is set). */
  copyLabel?: string;
  /** Text announced after a successful copy. */
  copiedLabel?: string;
  /** Text announced when the browser refuses the copy. */
  failedLabel?: string;
  class?: string;
}

const {
  code,
  filename,
  lang,
  copyLabel = "Copy code",
  copiedLabel = "Copied",
  failedLabel = "Copy failed",
  class: className,
} = Astro.props;
const hasHeader = Boolean(filename || lang);
---

{ hasHeader && (
{filename}
{lang && {lang}}
) }
{code}
{hasHeader && }
``` --- # Code preview > Docs-style panel with a Preview and a Code pane: a live example in the slot, its source in a scrolling pre, and a copy button. - Kind: ui · Category: Data display · Interactivity: script - Install: `npx shadcn@latest add @haze/code-preview` - File: `src/components/haze/ui/code-preview.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/code-preview ## Use when - Documenting a component with a live example and the exact source beside it - Letting readers check an example at narrower widths by dragging the stage edge - Showing the same snippet either rendered or as text, one pane at a time ## Avoid when - Source only, with no rendered example; use code-block - Install commands in several package managers; use code-tabs - Showing a page or app inside a device or browser frame; use browser-window ## Alternatives - [code-tabs](https://hazeui.com/ui/code-tabs.md) - [code-block](https://hazeui.com/ui/code-block.md) - [browser-window](https://hazeui.com/ui/browser-window.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique on the page. The panes get ids `${id}-preview` and `${id}-code`. | | code | `string` | | yes | Source shown in the Code pane. Kept verbatim in
; the pane scrolls inside itself. |
| title | `string` |  | no | Optional plain-text line above the tabs. |
| language | `string` |  | no | Small language label beside the copy button, for example "astro". |
| defaultView | `"preview" \| "code"` | "preview" | no | Pane shown first, with and without script. |
| stage | `"default" \| "muted" \| "dots"` | "default" | no | Surface behind the example. dots is an SVG dot pattern filled with the border token. |
| align | `"center" \| "start"` | "center" | no | Where the example sits in the stage. |
| resizable | `boolean` | false | no | Native horizontal resize handle on the example, with a minimum width, to test responsive behavior. |
| resizeHint | `string` | "Drag the bottom-right corner to resize the example." | no | Visible hint shown under a resizable stage. |
| previewLabel | `string` | "Preview" | no | Text of the first tab. |
| codeLabel | `string` | "Code" | no | Text of the second tab and name of the code region. |
| viewsLabel | `string` | "Example view" | no | Accessible name of the tab list. |
| copyLabel | `string` | "Copy code" | no | Accessible name of the copy button. |
| copiedLabel | `string` | "Copied" | no | Text announced after a successful copy. |
| failedLabel | `string` | "Copy failed" | no | Text announced when the browser refuses the copy. |
| class | `string` |  | no | Extra classes on the outer panel. |
| default slot | `slot` |  | yes | The live example shown in the Preview pane. |

## Accessibility
- Without script the two tabs are in-page links and :target shows the matching pane; the first pane shows until a link targets the other.
- The script adds tablist, tab and tabpanel roles, aria-selected and a roving tabindex. The static markup never claims them.
- The code region is focusable and named "Code", so keyboard users can scroll long or wide source (WCAG 2.1.1).
- The copy button appears only with script and announces "Copied" or "Copy failed" through a role="status" region.
- The resize handle is a native pointer feature (resize-x): it has no keyboard or touch alternative, so do not hide information that only a narrow width reveals. The example stays reachable at any width because the stage scrolls instead of clipping.
- Key Left / Right: Switch between the Preview and Code tabs
- Key Home / End: Select the first or last tab
- Key Tab: Move from the selected tab to the copy button, then into the pane
- Key Enter / Space: Copy the code when the copy button has focus

## Agent prompts

### Install and use

Install the Haze UI component "Code preview" with `npx shadcn@latest add @haze/code-preview`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CodePreview from "@/components/haze/ui/code-preview.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/code-preview.md

### Customize with real content

Adapt the Haze code-preview ui for our product. Replace the demo values of these props with our real content: id, code, title, language, defaultView, stage, align, resizable, resizeHint, previewLabel, codeLabel, viewsLabel, copyLabel, copiedLabel, failedLabel, class, default slot. Keep the layout, the heading level rules and these accessibility details: Without script the two tabs are in-page links and :target shows the matching pane; the first pane shows until a link targets the other. The script adds tablist, tab and tabpanel roles, aria-selected and a roving tabindex. The static markup never claims them. The code region is focusable and named "Code", so keyboard users can scroll long or wide source (WCAG 2.1.1). The copy button appears only with script and announces "Copied" or "Copy failed" through a role="status" region. The resize handle is a native pointer feature (resize-x): it has no keyboard or touch alternative, so do not hide information that only a narrow width reveals. The example stays reachable at any width because the stage scrolls instead of clipping. Do not add raw color classes; use the Haze tokens.

### Choose the right block

Before using code-preview, check it fits: use it when documenting a component with a live example and the exact source beside it; letting readers check an example at narrower widths by dragging the stage edge; showing the same snippet either rendered or as text, one pane at a time. Avoid it when source only, with no rendered example; use code-block; install commands in several package managers; use code-tabs; showing a page or app inside a device or browser frame; use browser-window. Alternatives: @haze/code-tabs, @haze/code-block, @haze/browser-window.

## Example requests that should lead here
- Show this alert component live in a code preview with its Astro source on the Code tab
- Add a resizable code preview with a dotted stage so readers can test the card at narrow widths

## Source

```astro
---
import { Copy, Check, X } from "@lucide/astro";
import { cn } from "../../../lib/haze/utils";

interface Props {
  /** Unique on the page. The two panes get `${id}-preview` and `${id}-code`. */
  id: string;
  /** Source text shown in the Code pane. Rendered in 
, so line breaks and indentation are kept. */
  code: string;
  /** Optional heading line above the tabs, for example "Button group". Plain text, not a heading element. */
  title?: string;
  /** Small language label beside the copy button, for example "astro". */
  language?: string;
  /** Pane shown first. */
  defaultView?: "preview" | "code";
  /** Surface behind the live example. dots draws a quiet dot grid in the border color. */
  stage?: "default" | "muted" | "dots";
  /** Where the example sits inside the stage. */
  align?: "center" | "start";
  /** Lets the reader drag the corner of the example sideways to test narrower widths. */
  resizable?: boolean;
  /** Visible hint under a resizable stage. */
  resizeHint?: string;
  previewLabel?: string;
  codeLabel?: string;
  /** Accessible name of the Preview / Code tab list. */
  viewsLabel?: string;
  copyLabel?: string;
  /** Text announced after a successful copy. */
  copiedLabel?: string;
  /** Text announced when the browser refuses the copy. */
  failedLabel?: string;
  class?: string;
}

const {
  id,
  code,
  title,
  language,
  defaultView = "preview",
  stage = "default",
  align = "center",
  resizable = false,
  resizeHint = "Drag the bottom-right corner to resize the example.",
  previewLabel = "Preview",
  codeLabel = "Code",
  viewsLabel = "Example view",
  copyLabel = "Copy code",
  copiedLabel = "Copied",
  failedLabel = "Copy failed",
  class: className,
} = Astro.props;

const codeFirst = defaultView === "code";
const stages = { default: "bg-card", muted: "bg-muted", dots: "bg-card" };
const aligns = { center: "items-center justify-center", start: "items-start justify-start" };

// Without script the tabs are in-page links and :target picks the pane. The script marks the root with
// data-enhanced, which switches every rule below off and takes over with the hidden attribute.
// Tailwind only sees complete class names, so each variant is written out.
const previewPane = codeFirst
  ? "[[data-haze-code-preview]:not([data-enhanced])_&:not(:target)]:hidden"
  : "[[data-haze-code-preview]:not([data-enhanced]):has([data-cp-panel=code]:target)_&]:hidden";
const codePane = codeFirst
  ? "[[data-haze-code-preview]:not([data-enhanced]):has([data-cp-panel=preview]:target)_&]:hidden"
  : "[[data-haze-code-preview]:not([data-enhanced])_&:not(:target)]:hidden";
const previewTabState = codeFirst
  ? "[[data-haze-code-preview]:not([data-enhanced]):has([data-cp-panel=preview]:target)_&]:bg-background [[data-haze-code-preview]:not([data-enhanced]):has([data-cp-panel=preview]:target)_&]:text-foreground"
  : "[[data-haze-code-preview]:not([data-enhanced]):has([data-cp-panel=code]:target)_&]:bg-transparent [[data-haze-code-preview]:not([data-enhanced]):has([data-cp-panel=code]:target)_&]:text-muted-foreground";
const codeTabState = codeFirst
  ? "[[data-haze-code-preview]:not([data-enhanced]):has([data-cp-panel=preview]:target)_&]:bg-transparent [[data-haze-code-preview]:not([data-enhanced]):has([data-cp-panel=preview]:target)_&]:text-muted-foreground"
  : "[[data-haze-code-preview]:not([data-enhanced]):has([data-cp-panel=code]:target)_&]:bg-background [[data-haze-code-preview]:not([data-enhanced]):has([data-cp-panel=code]:target)_&]:text-foreground";

const tabBase =
  "inline-flex h-7 min-w-12 shrink-0 cursor-pointer items-center justify-center rounded-md px-2.5 text-[0.8125rem]/5 font-medium whitespace-nowrap text-muted-foreground transition-colors duration-150 ease-snappy hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring data-[active]:bg-background data-[active]:text-foreground";
---

{title &&

{title}

}
{language && {language}}
{ stage === "dots" && ( ) }
{resizable &&

{resizeHint}

}
{code}
``` --- # Code tabs > Tabbed command and code switcher for package managers or languages with keyboard arrow navigation and one-click copy. - Kind: ui · Category: Data display · Interactivity: script - Install: `npx shadcn@latest add @haze/code-tabs` - File: `src/components/haze/ui/code-tabs.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/code-tabs ## Use when - CLI install commands across pnpm, npm, yarn, and bun - SDK snippets switching between TypeScript, cURL, and Python ## Avoid when - A single static file snippet needs no tabs; use code-block or snippet ## Alternatives - [code-block](https://hazeui.com/ui/code-block.md) - [snippet](https://hazeui.com/ui/snippet.md) - [tabs](https://hazeui.com/ui/tabs.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Base DOM id for tablist and tabpanels. | | tabs | `TabItem[]` | | no | Tab items with id, label, and code string. | | showPrompt | `boolean` | true | no | Prepends a visual '$ ' prompt stripped automatically when copied. | | class | `string` | | no | Extra classes. | ## Accessibility - Implements ARIA tablist/tab/tabpanel linkage via aria-controls and aria-labelledby. - Clipboard result is announced through an aria-live status region. - Key ArrowLeft / ArrowRight: Move between package manager or language tabs. ## Agent prompts ### Install and use Install the Haze UI component "Code tabs" with `npx shadcn@latest add @haze/code-tabs`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CodeTabs from "@/components/haze/ui/code-tabs.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/code-tabs.md ### Customize with real content Adapt the Haze code-tabs ui for our product. Replace the demo values of these props with our real content: id, tabs, showPrompt, class. Keep the layout, the heading level rules and these accessibility details: Implements ARIA tablist/tab/tabpanel linkage via aria-controls and aria-labelledby. Clipboard result is announced through an aria-live status region. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using code-tabs, check it fits: use it when cli install commands across pnpm, npm, yarn, and bun; sdk snippets switching between typescript, curl, and python. Avoid it when a single static file snippet needs no tabs; use code-block or snippet. Alternatives: @haze/code-block, @haze/snippet, @haze/tabs. ## Example requests that should lead here - Add a package manager install block switching between pnpm, npm, yarn, and bun with a copy button ## Source ```astro --- import { Check, Copy, Terminal, X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface TabItem { id: string; label: string; code: string; lang?: string; } interface Props { id: string; tabs?: TabItem[]; showPrompt?: boolean; copyLabel?: string; class?: string; } const { id, tabs = [ { id: "pnpm", label: "pnpm", code: "pnpm dlx shadcn@latest add @haze/button" }, { id: "npm", label: "npm", code: "npx shadcn@latest add @haze/button" }, { id: "yarn", label: "yarn", code: "yarn dlx shadcn@latest add @haze/button" }, { id: "bun", label: "bun", code: "bunx --bun shadcn@latest add @haze/button" }, ], showPrompt = true, copyLabel = "Copy command", class: className, } = Astro.props; ---
{ tabs.map((t, index) => ( )) }
``` --- # Collapsible > One native details element in a bordered panel, with a chevron that turns when open and a panel that animates its height. - Kind: ui · Category: Data display · Interactivity: native - Install: `npx shadcn@latest add @haze/collapsible` - File: `src/components/haze/ui/collapsible.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/collapsible ## Use when - Hiding secondary content such as advanced options behind a single heading - Several sections that should behave as an accordion: give them the same name - Content that must work without any script ## Avoid when - A fixed list of questions and answers; accordion renders those from data - Content the reader needs to see to finish the task ## Alternatives - [accordion](https://hazeui.com/ui/accordion.md) - [tabs](https://hazeui.com/ui/tabs.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | title | `string` | | yes | Text of the summary row. | | open | `boolean` | false | no | Starts expanded. | | name | `string` | | no | Collapsibles with the same name close each other, so only one is open. | | class | `string` | | no | Extra classes on the details element. | | default slot | `slot` | | yes | The content shown when open. | ## Accessibility - The browser exposes the summary as a disclosure button with expanded state, so no ARIA is added. - The panel animates its height where the browser supports interpolate-size; elsewhere the content rises in. Both are switched off under prefers-reduced-motion. - The native triangle is hidden and replaced by a chevron icon that is aria-hidden; the title text names the control. - Closed content is removed from the accessibility tree and from the tab order by the browser. - Key Enter / Space: Open or close the focused summary ## Agent prompts ### Install and use Install the Haze UI component "Collapsible" with `npx shadcn@latest add @haze/collapsible`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Collapsible from "@/components/haze/ui/collapsible.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/collapsible.md ### Customize with real content Adapt the Haze collapsible ui for our product. Replace the demo values of these props with our real content: title, open, name, class, default slot. Keep the layout, the heading level rules and these accessibility details: The browser exposes the summary as a disclosure button with expanded state, so no ARIA is added. The panel animates its height where the browser supports interpolate-size; elsewhere the content rises in. Both are switched off under prefers-reduced-motion. The native triangle is hidden and replaced by a chevron icon that is aria-hidden; the title text names the control. Closed content is removed from the accessibility tree and from the tab order by the browser. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using collapsible, check it fits: use it when hiding secondary content such as advanced options behind a single heading; several sections that should behave as an accordion: give them the same name; content that must work without any script. Avoid it when a fixed list of questions and answers; accordion renders those from data; content the reader needs to see to finish the task. Alternatives: @haze/accordion, @haze/tabs. ## Example requests that should lead here - Add a collapsible called Advanced options under the form - Make three collapsibles that open one at a time ## Source ```astro --- import { ChevronDown } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { title: string; open?: boolean; /** Collapsibles that share a name open one at a time. */ name?: string; class?: string; } const { title, open = false, name, class: className } = Astro.props; // Where the browser can animate to height:auto, the panel slides open and shut. Elsewhere its content rises in. const slide = "supports-[interpolate-size:allow-keywords]:[interpolate-size:allow-keywords] supports-[interpolate-size:allow-keywords]:details-content:h-0 supports-[interpolate-size:allow-keywords]:details-content:overflow-clip supports-[interpolate-size:allow-keywords]:details-content:transition-[height,content-visibility] supports-[interpolate-size:allow-keywords]:details-content:transition-discrete supports-[interpolate-size:allow-keywords]:details-content:duration-300 supports-[interpolate-size:allow-keywords]:details-content:ease-snappy supports-[interpolate-size:allow-keywords]:open:details-content:h-auto"; ---
{title}
``` --- # Color Picker > A native color field with named preset swatches and a readable color value. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/color-picker` - File: `src/components/haze/ui/color-picker.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/color-picker ## Use when - A form collects an accent or label color. - A preset palette helps users choose quickly while still allowing custom colors. ## Avoid when - The application needs color profiles or transparency editing. ## Alternatives - [radio-group](https://hazeui.com/ui/radio-group.md) - [chip](https://hazeui.com/ui/chip.md) - [input](https://hazeui.com/ui/input.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique color field ID. | | name | `string` | id | no | Submitted field name. | | label | `string` | Color | no | Visible and accessible label. | | value | `string` | | no | Initial hexadecimal sRGB color. | | swatches | `Swatch[]` | | no | Named opaque CSS colors or custom properties. | | disabled | `boolean` | | no | Disables the picker and its presets. | | class | `string` | | no | Classes for the field wrapper. | ## Accessibility - Presets expose accessible names and a pressed state. - The selected color value and the native picker are available without relying on swatch color alone. - Key Tab: Move to the native picker and preset colors. - Key Enter / Space: Choose a preset or open the native color picker. ## Agent prompts ### Install and use Install the Haze UI component "Color Picker" with `npx shadcn@latest add @haze/color-picker`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ColorPicker from "@/components/haze/ui/color-picker.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/color-picker.md ### Customize with real content Adapt the Haze color-picker ui for our product. Replace the demo values of these props with our real content: id, name, label, value, swatches, disabled, class. Keep the layout, the heading level rules and these accessibility details: Presets expose accessible names and a pressed state. The selected color value and the native picker are available without relying on swatch color alone. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using color-picker, check it fits: use it when a form collects an accent or label color.; a preset palette helps users choose quickly while still allowing custom colors.. Avoid it when the application needs color profiles or transparency editing.. Alternatives: @haze/radio-group, @haze/chip, @haze/input. ## Example requests that should lead here - Let a project owner choose an accent color, with four presets. - Add a native color field for labels. ## Source ```astro --- import { Check, ChevronDown } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Swatch { label: string; color: string; } interface Props { id: string; name?: string; label?: string; value?: string; swatches?: Swatch[]; disabled?: boolean; class?: string; [key: string]: unknown; } const { id, name = id, label = "Color", value, disabled, class: className, swatches = [], ...rest } = Astro.props; const panelId = `${id}-color-popover`; ---
{value}
``` --- # Combobox > Filters a list as you type and submits a single selected value through a native select. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/combobox` - File: `src/components/haze/ui/combobox.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/input, @haze/select, @haze/utils - Docs page: https://hazeui.com/ui/combobox ## Use when - A form asks users to pick one item from a long list. - People know part of the option name and can type to find it. ## Avoid when - A few choices fit in a visible radio group. ## Alternatives - [select](https://hazeui.com/ui/select.md) - [radio-group](https://hazeui.com/ui/radio-group.md) - [multi-select](https://hazeui.com/ui/multi-select.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique field ID and prefix for the option list. | | name | `string` | id | no | Submitted field name. | | label | `string` | Workspace | no | Visible and accessible field label. | | options | `Option[]` | | no | Choices with nonempty values, labels, and optional disabled state. | | value | `string` | | no | Initially selected option value. | | placeholder | `string` | | no | Prompt shown before a choice is made. | | required | `boolean` | | no | Requires a matching choice before submission. | | disabled | `boolean` | | no | Disables input and form submission. | | class | `string` | | no | Classes for the field wrapper. | ## Accessibility - The native select remains usable when scripting or popovers are unavailable. - The active option is announced while focus stays in the search field. - Key ↑ / ↓: Open the list or move through matching options. - Key Enter: Choose the active option. - Key Escape: Close suggestions and keep the selected value. ## Agent prompts ### Install and use Install the Haze UI component "Combobox" with `npx shadcn@latest add @haze/combobox`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Combobox from "@/components/haze/ui/combobox.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/combobox.md ### Customize with real content Adapt the Haze combobox ui for our product. Replace the demo values of these props with our real content: id, name, label, options, value, placeholder, required, disabled, class. Keep the layout, the heading level rules and these accessibility details: The native select remains usable when scripting or popovers are unavailable. The active option is announced while focus stays in the search field. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using combobox, check it fits: use it when a form asks users to pick one item from a long list.; people know part of the option name and can type to find it.. Avoid it when a few choices fit in a visible radio group.. Alternatives: @haze/select, @haze/radio-group, @haze/multi-select. ## Example requests that should lead here - Add a searchable workspace field to the move-project form. - Choose a single department from a long directory. ## Source ```astro --- import { Check, Search } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Input from "./input.astro"; import Select from "./select.astro"; interface Option { value: string; label: string; disabled?: boolean } interface Props { id: string; name?: string; label?: string; options?: Option[]; value?: string; placeholder?: string; required?: boolean; disabled?: boolean; class?: string; [key: string]: unknown; } const { id, name = id, label = "Workspace", value, placeholder = "Select a workspace", required, disabled, class: className, ...rest } = Astro.props; const options = (Astro.props.options ?? [ { value: "studio", label: "Design studio" }, { value: "docs", label: "Documentation" }, { value: "support", label: "Customer support" }, ]).filter((option) => option.value !== ""); const available = required ? options : [{ value: "", label: "No selection" }, ...options]; ---
    {available.map((option, index) => (
  • {option.label}
  • ))}
``` --- # Command Menu > Opens a searchable dialog of page links with keyword matching and arrow-key navigation. - Kind: ui · Category: Overlays · Interactivity: script - Install: `npx shadcn@latest add @haze/command-menu` - File: `src/components/haze/ui/command-menu.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/dialog, @haze/input, @haze/utils - Docs page: https://hazeui.com/ui/command-menu ## Use when - Several common destinations are available from one place. - Aliases can help users find pages by the terms they already know. ## Avoid when - The available actions should be visible on the page at all times. ## Alternatives - [dialog](https://hazeui.com/ui/dialog.md) - [dropdown-menu](https://hazeui.com/ui/dropdown-menu.md) - [combobox](https://hazeui.com/ui/combobox.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique ID for the dialog and its inner controls. | | title | `string` | Jump to | no | Visible accessible dialog title. | | triggerLabel | `string` | Find a page | no | Caption on the visible launch button. | | placeholder | `string` | Search pages | no | Search prompt and accessible label. | | items | `Command[]` | | no | Page links with optional context, icon, and search keywords. | | headingLevel | `2 \| 3 \| 4 \| 5 \| 6` | 2 | no | Level of the dialog heading. | | class | `string` | | no | Classes for the wrapper. | ## Accessibility - The link list remains readable and navigable without the search enhancement. - A live region announces match counts as the list filters. - Key ↑ / ↓: Move from search to a result or between results. - Key Enter: Open the focused result or the first match from search. - Key Escape: Close the dialog and return focus to the trigger. ## Agent prompts ### Install and use Install the Haze UI component "Command Menu" with `npx shadcn@latest add @haze/command-menu`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CommandMenu from "@/components/haze/ui/command-menu.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/command-menu.md ### Customize with real content Adapt the Haze command-menu ui for our product. Replace the demo values of these props with our real content: id, title, triggerLabel, placeholder, items, headingLevel, class. Keep the layout, the heading level rules and these accessibility details: The link list remains readable and navigable without the search enhancement. A live region announces match counts as the list filters. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using command-menu, check it fits: use it when several common destinations are available from one place.; aliases can help users find pages by the terms they already know.. Avoid it when the available actions should be visible on the page at all times.. Alternatives: @haze/dialog, @haze/dropdown-menu, @haze/combobox. ## Example requests that should lead here - Build a keyboard-friendly menu for finding catalog pages. - Add a searchable jump menu with aliases for settings and reports. ## Source ```astro --- import { ArrowUpRight, Search } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Dialog from "./dialog.astro"; import Input from "./input.astro"; interface Command { label: string; href: string; context?: string; keywords?: string; icon?: (props: Record) => unknown; } interface Props { id: string; title?: string; triggerLabel?: string; placeholder?: string; items?: Command[]; headingLevel?: 2 | 3 | 4 | 5 | 6; class?: string; } const { id, title = "Jump to", triggerLabel = "Find a page", placeholder = "Search pages", items = [{ href: "#overview", label: "Overview" }], headingLevel, class: className, } = Astro.props; ---

{items.length ? "" : "No matching pages."}

``` --- # Comment Thread > A discussion with nested replies, reaction toggles, editable own comments, and resolve and reopen controls. - Kind: ui · Category: Data display · Interactivity: script - Install: `npx shadcn@latest add @haze/comment-thread` - File: `src/components/haze/ui/comment-thread.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/avatar, @haze/button, @haze/textarea, @haze/utils - Docs page: https://hazeui.com/ui/comment-thread ## Use when - Review feedback needs replies anchored to one document or draft. - People should edit their own notes and resolve a finished discussion. ## Avoid when - The conversation is a flat realtime feed. Use chat-thread. ## Alternatives - [chat-thread](https://hazeui.com/ui/chat-thread.md) - [inline-edit](https://hazeui.com/ui/inline-edit.md) - [timeline](https://hazeui.com/ui/timeline.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Heading and composer input prefix. | | label | `string` | | no | Thread title. | | author | `string` | | no | Display author for new local comments. Defaults to You. | | comments | `Comment[]` | | no | Initial id, author, text, time, own flag and optional reply array. | | class | `string` | | no | Additional classes on the component wrapper. | ## Accessibility - Every comment and reply is an article named by its author. Replies use native disclosures; reaction controls expose aria-pressed. - New text is inserted as plain text. Comment changes emit haze:comment-change for host persistence, and resolve retains access through the reopen control. - Key Enter / Space: Open replies, react, edit, delete, resolve or reopen. - Key Tab: Reach the labelled composer and post or cancel a reply. ## Agent prompts ### Install and use Install the Haze UI component "Comment Thread" with `npx shadcn@latest add @haze/comment-thread`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CommentThread from "@/components/haze/ui/comment-thread.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/comment-thread.md ### Customize with real content Adapt the Haze comment-thread ui for our product. Replace the demo values of these props with our real content: id, label, author, comments, class. Keep the layout, the heading level rules and these accessibility details: Every comment and reply is an article named by its author. Replies use native disclosures; reaction controls expose aria-pressed. New text is inserted as plain text. Comment changes emit haze:comment-change for host persistence, and resolve retains access through the reopen control. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using comment-thread, check it fits: use it when review feedback needs replies anchored to one document or draft.; people should edit their own notes and resolve a finished discussion.. Avoid it when the conversation is a flat realtime feed. use chat-thread.. Alternatives: @haze/chat-thread, @haze/inline-edit, @haze/timeline. ## Example requests that should lead here - Build a design review discussion with nested replies, likes and a resolved state. ## Source ```astro --- import { ChevronDown, MessageSquare, Pencil, ThumbsUp, Trash2 } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Avatar from "./avatar.astro"; import Button from "./button.astro"; import Textarea from "./textarea.astro"; interface Comment { id: string; author: string; text: string; time: string; own?: boolean; replies?: Comment[] } interface Props { id: string; label?: string; author?: string; comments?: Comment[]; class?: string } const { id, label = "Design review", author = "You", class: className, comments = [ { id: "mila", author: "Mila Chen", text: "Could we keep the export action next to the date range?", time: "Today, 10:24", replies: [{ id: "owen", author: "Owen Park", text: "That also makes the keyboard path shorter.", time: "Today, 10:31" }] }, { id: "you", author: "You", text: "I will update that grouping before the next review.", time: "Today, 10:42", own: true }, ] } = Astro.props; ---

{label}

{comments.map(comment =>

{comment.author}{comment.time}

{comment.text}

{comment.own && <>}
{comment.replies?.length ?? 0} {comment.replies?.length === 1 ? "reply" : "replies"}
{comment.replies?.map(reply =>

{reply.author}{reply.time}

{reply.text}

)}
)}
{ attach && ( ) } {hasActions &&
} { maxLength && ( = maxLength ? "" : undefined} class="px-1 text-xs/5 text-muted-foreground tabular-nums data-limit:font-medium data-limit:text-destructive"> {counterLabel} {maxLength}: {value.length} / {maxLength} ) }
{hint &&

{hint}

} { attach && ( <>

) } ``` --- # Inline confirmation morph > An action unfolds into an inline question, then reports a local or host-managed result with an undo event. - Kind: ui · Category: Actions · Interactivity: script - Install: `npx shadcn@latest add @haze/confirm-morph` - File: `src/components/haze/ui/confirm-morph.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/confirm-morph ## Use when - Archiving or removing a local item needs a clear second step - A host action can report pending, completion and failure through callbacks ## Avoid when - Use dialog when consequences need a longer explanation - Use hold-to-confirm when the intended confirmation is a deliberate hold ## Alternatives - [hold-to-confirm](https://hazeui.com/ui/hold-to-confirm.md) - [dialog](https://hazeui.com/ui/dialog.md) - [stateful-button](https://hazeui.com/ui/stateful-button.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique caller-supplied prefix for this component and its related elements. | | label | `string` | "Archive draft" | no | Resting action label. | | prompt | `string` | "Archive this draft?" | no | Inline confirmation question. | | confirmLabel | `string` | "Archive" | no | Text on the explicit confirmation button. | | successLabel | `string` | "Draft archived" | no | Local result text after confirmation. | | pendingLabel | `string` | "Archiving…" | no | Busy text shown when the host calls pending. | | undoLabel | `string` | "Undo" | no | Result action that dispatches haze:undo. | | form | `string` | | no | Optional external form ID; confirm uses native submission instead of the local result. | | name | `string` | id | no | Name submitted by the confirm button. | | value | `string` | "confirmed" | no | Value submitted by the confirm button. | | class | `string` | | no | Additional classes for the component root. | ## Accessibility - Native details exposes the second confirmation step with no script; a form prop enables ordinary submission. - Enhanced opening focuses Confirm and rejects activation during the first 300 ms to guard against accidental double presses. - haze:confirm provides pending, complete and fail callbacks; the host implements the real operation and haze:undo reversal. - Key Enter, Space: Open the question or activate its focused answer. - Key Escape: Cancel the open question and restore focus to the action. ## Agent prompts ### Install and use Install the Haze UI component "Inline confirmation morph" with `npx shadcn@latest add @haze/confirm-morph`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ConfirmMorph from "@/components/haze/ui/confirm-morph.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/confirm-morph.md ### Customize with real content Adapt the Haze confirm-morph ui for our product. Replace the demo values of these props with our real content: id, label, prompt, confirmLabel, successLabel, pendingLabel, undoLabel, form, name, value, class. Keep the layout, the heading level rules and these accessibility details: Native details exposes the second confirmation step with no script; a form prop enables ordinary submission. Enhanced opening focuses Confirm and rejects activation during the first 300 ms to guard against accidental double presses. haze:confirm provides pending, complete and fail callbacks; the host implements the real operation and haze:undo reversal. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using confirm-morph, check it fits: use it when archiving or removing a local item needs a clear second step; a host action can report pending, completion and failure through callbacks. Avoid it when use dialog when consequences need a longer explanation; use hold-to-confirm when the intended confirmation is a deliberate hold. Alternatives: @haze/hold-to-confirm, @haze/dialog, @haze/stateful-button. ## Example requests that should lead here - Add an inline archive confirmation with a pending callback and an Undo event. ## Source ```astro --- import { Check, LoaderCircle } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id: string; label?: string; prompt?: string; confirmLabel?: string; successLabel?: string; pendingLabel?: string; undoLabel?: string; form?: string; name?: string; value?: string; class?: string; } const { id, label = "Archive draft", prompt = "Archive this draft?", confirmLabel = "Archive", successLabel = "Draft archived", pendingLabel = "Archiving…", undoLabel = "Undo", form, name = id, value = "confirmed", class: className } = Astro.props; const key = "inline-flex h-6 shrink-0 cursor-pointer items-center justify-center rounded-md px-2.5 text-[0.8125rem]/5 font-medium whitespace-nowrap transition-[background-color,color,scale] duration-150 ease-snappy active:scale-[0.97] active:duration-75 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring"; const face = "[[data-haze-confirm-morph][data-enhanced]_&]:absolute [[data-haze-confirm-morph][data-enhanced]_&]:top-0 [[data-haze-confirm-morph][data-enhanced]_&]:left-0 [[data-haze-confirm-morph][data-enhanced]_&]:w-max motion-safe:[[data-haze-confirm-morph][data-enhanced]_&]:transition-[opacity,translate] motion-safe:[[data-haze-confirm-morph][data-enhanced]_&]:duration-200 motion-safe:[[data-haze-confirm-morph][data-enhanced]_&]:ease-snappy"; ---
{label}
{prompt}
``` --- # Confirm Popover > An anchored confirmation card with a required phrase, fill feedback, asynchronous progress, and retry. - Kind: ui · Category: Overlays · Interactivity: script - Install: `npx shadcn@latest add @haze/confirm-popover` - File: `src/components/haze/ui/confirm-popover.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/button, @haze/input, @haze/popover, @haze/utils - Docs page: https://hazeui.com/ui/confirm-popover ## Use when - A settings row needs a local confirmation with a clear consequence. - Typing a resource name or phrase provides deliberate approval. ## Avoid when - The action has several dependent steps. Use dialog. ## Alternatives - [alert-dialog](https://hazeui.com/ui/alert-dialog.md) - [hold-to-confirm](https://hazeui.com/ui/hold-to-confirm.md) - [popover](https://hazeui.com/ui/popover.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique popover ID and prefix for its labels. | | label | `string` | | no | Trigger action text. | | title | `string` | | no | Confirmation question. | | description | `string` | | no | Consequence presented before approval. | | phrase | `string` | | no | Exact phrase required for confirmation. Empty removes the phrase field. | | action | `string` | | no | Optional native POST destination. Otherwise use haze:confirm. | | class | `string` | | no | Additional classes on the component wrapper. | ## Accessibility - The alert dialog is labelled by its title and consequence. Native pattern validation and an aria-disabled button guard the required phrase. - Set action for native POST submission or handle the cancelable haze:confirm event and register asynchronous work with detail.waitUntil. Rejections expose a retry state. - Key Enter / Space: Open the confirmation or activate its buttons. - Key Escape: Close the native popover and return to its trigger. ## Agent prompts ### Install and use Install the Haze UI component "Confirm Popover" with `npx shadcn@latest add @haze/confirm-popover`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ConfirmPopover from "@/components/haze/ui/confirm-popover.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/confirm-popover.md ### Customize with real content Adapt the Haze confirm-popover ui for our product. Replace the demo values of these props with our real content: id, label, title, description, phrase, action, class. Keep the layout, the heading level rules and these accessibility details: The alert dialog is labelled by its title and consequence. Native pattern validation and an aria-disabled button guard the required phrase. Set action for native POST submission or handle the cancelable haze:confirm event and register asynchronous work with detail.waitUntil. Rejections expose a retry state. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using confirm-popover, check it fits: use it when a settings row needs a local confirmation with a clear consequence.; typing a resource name or phrase provides deliberate approval.. Avoid it when the action has several dependent steps. use dialog.. Alternatives: @haze/alert-dialog, @haze/hold-to-confirm, @haze/popover. ## Example requests that should lead here - Ask people to type DELETE before removing a draft, and show asynchronous success or retry. ## Source ```astro --- import { Check, LoaderCircle } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Popover from "./popover.astro"; import Button from "./button.astro"; import Input from "./input.astro"; interface Props { id: string; label?: string; title?: string; description?: string; phrase?: string; action?: string; class?: string; } const { id, label = "Delete draft", title = "Delete this draft?", description = "The unpublished draft and its review notes will be removed.", phrase = "DELETE", action, class: className } = Astro.props; ---

{title}

{description}

{phrase && } {phrase && }

``` --- # Context Menu > Opens a set of link actions from a right-click, a keyboard shortcut, or a visible button. - Kind: ui · Category: Overlays · Interactivity: script - Install: `npx shadcn@latest add @haze/context-menu` - File: `src/components/haze/ui/context-menu.astro` - npm dependencies: none - Registry dependencies: @haze/dropdown-menu, @haze/utils - Docs page: https://hazeui.com/ui/context-menu ## Use when - A file, card, or list item needs contextual navigation shortcuts. - The same actions should be discoverable by touch and keyboard. ## Avoid when - A primary action needs to stay prominent on the item itself. ## Alternatives - [dropdown-menu](https://hazeui.com/ui/dropdown-menu.md) - [popover](https://hazeui.com/ui/popover.md) - [command-menu](https://hazeui.com/ui/command-menu.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique popover ID. | | items | `MenuItem[]` | | no | Links with labels and optional icons, hints, and grouping. An item with items (and no href) becomes a one-level submenu. | | label | `string` | Item actions | no | Accessible name of the target region. | | menuLabel | `string` | Actions | no | Label of the visible menu button. | | class | `string` | | no | Classes for the target and menu wrapper. | ## Accessibility - The visible menu button opens the same links even when scripting is disabled. - Escape from a context-opened popup returns focus to the target. - Submenus work as in the dropdown menu: the trigger has aria-haspopup="menu" and aria-expanded, and without scripting the submenu links list inline. - Key Shift+F10: Open the menu while the target is focused. - Key ↑ / ↓: Move between links in the menu. - Key Home / End: Focus the first or last link. - Key → / Enter / Space: Open a submenu and focus its first link. - Key ← / Escape: Close a submenu and return to its item. - Key Escape: Dismiss the menu. ## Agent prompts ### Install and use Install the Haze UI component "Context Menu" with `npx shadcn@latest add @haze/context-menu`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ContextMenu from "@/components/haze/ui/context-menu.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/context-menu.md ### Customize with real content Adapt the Haze context-menu ui for our product. Replace the demo values of these props with our real content: id, items, label, menuLabel, class. Keep the layout, the heading level rules and these accessibility details: The visible menu button opens the same links even when scripting is disabled. Escape from a context-opened popup returns focus to the target. Submenus work as in the dropdown menu: the trigger has aria-haspopup="menu" and aria-expanded, and without scripting the submenu links list inline. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using context-menu, check it fits: use it when a file, card, or list item needs contextual navigation shortcuts.; the same actions should be discoverable by touch and keyboard.. Avoid it when a primary action needs to stay prominent on the item itself.. Alternatives: @haze/dropdown-menu, @haze/popover, @haze/command-menu. ## Example requests that should lead here - Add a context menu to a project-folder card. - Expose secondary links for a saved document by right-click and a visible action button. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; import DropdownMenu from "./dropdown-menu.astro"; interface MenuItem { label: string; href?: string; hint?: string; destructive?: boolean; separatorBefore?: boolean; heading?: string; icon?: (props: Record) => unknown; /** Makes the item a submenu trigger. One level. */ items?: { label: string; href: string; hint?: string; destructive?: boolean; separatorBefore?: boolean; icon?: (props: Record) => unknown }[]; } interface Props { id: string; items?: MenuItem[]; label?: string; menuLabel?: string; class?: string; } const { id, items = [{ label: "View overview", href: "#overview" }], label = "Item actions", menuLabel = "Actions", class: className, } = Astro.props; ---

Untitled item

``` --- # Cookie Consent > Choose required-only, all optional, or custom cookie preferences, save locally, and reopen the panel. - Kind: ui · Category: Feedback · Interactivity: script - Install: `npx shadcn@latest add @haze/cookie-consent` - File: `src/components/haze/ui/cookie-consent.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/button, @haze/checkbox, @haze/utils - Docs page: https://hazeui.com/ui/cookie-consent ## Use when - A site needs explicit settings for analytics and marketing storage. - Visitors should be able to revisit their previous choices. ## Avoid when - The application needs a remote consent history. Add server persistence to the consent-change event. ## Alternatives - [dialog](https://hazeui.com/ui/dialog.md) - [checkbox-group](https://hazeui.com/ui/checkbox-group.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Prefix for category input IDs. | | storageKey | `string` | | no | Versioned local storage key. Defaults to haze-consent. | | text | `string` | | no | Explanation of the available storage categories. | | privacyHref | `string` | | no | Link to the site's privacy policy. | | class | `string` | | no | Additional classes on the component wrapper. | ## Accessibility - Analytics and marketing begin unchecked. Required cookies are labelled and locked. Saved preferences are versioned and validated before reuse. - The host receives haze:consent-change and controls any associated services. Reopening and saving keep keyboard focus on the visible controls. - Key Space: Toggle an optional category or open preference details. - Key Enter: Save the choice using a focused button. ## Agent prompts ### Install and use Install the Haze UI component "Cookie Consent" with `npx shadcn@latest add @haze/cookie-consent`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CookieConsent from "@/components/haze/ui/cookie-consent.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/cookie-consent.md ### Customize with real content Adapt the Haze cookie-consent ui for our product. Replace the demo values of these props with our real content: id, storageKey, text, privacyHref, class. Keep the layout, the heading level rules and these accessibility details: Analytics and marketing begin unchecked. Required cookies are labelled and locked. Saved preferences are versioned and validated before reuse. The host receives haze:consent-change and controls any associated services. Reopening and saving keep keyboard focus on the visible controls. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using cookie-consent, check it fits: use it when a site needs explicit settings for analytics and marketing storage.; visitors should be able to revisit their previous choices.. Avoid it when the application needs a remote consent history. add server persistence to the consent-change event.. Alternatives: @haze/dialog, @haze/checkbox-group. ## Example requests that should lead here - Let visitors save required-only cookie settings and reopen preferences later. ## Source ```astro --- import { ChevronDown } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Button from "./button.astro"; import Checkbox from "./checkbox.astro"; interface Props { id: string; storageKey?: string; text?: string; privacyHref?: string; class?: string; } const { id, storageKey = "haze-consent", text = "Choose which optional cookies you allow. Required cookies keep your session working.", privacyHref = "/privacy", class: className } = Astro.props; ---

Your cookie choices

{text} Privacy policy

Manage preferences

``` --- # Copy Button > Copies text to the clipboard and confirms success with an icon and a live message. - Kind: ui · Category: Actions · Interactivity: script - Install: `npx shadcn@latest add @haze/copy-button` - File: `src/components/haze/ui/copy-button.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/button, @haze/utils - Docs page: https://hazeui.com/ui/copy-button ## Use when - Users need to copy a share URL, command, or reference. - The action needs immediate, accessible feedback. ## Avoid when - The operation should open a share sheet with multiple destinations. ## Alternatives - [snippet](https://hazeui.com/ui/snippet.md) - [code-block](https://hazeui.com/ui/code-block.md) - [stateful-button](https://hazeui.com/ui/stateful-button.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | text | `string` | | yes | Exact text written to the clipboard. | | label | `string` | Copy | no | Visible button label. | | copiedMessage | `string` | | no | Status announced on success. | | showText | `boolean` | false | no | Always show the source text. | | class | `string` | | no | Classes for the surrounding group. | ## Accessibility - A live region confirms the write while the button retains focus. - The text becomes selectable when clipboard access is unavailable. - Key Enter / Space: Copy the text from the focused button. ## Agent prompts ### Install and use Install the Haze UI component "Copy Button" with `npx shadcn@latest add @haze/copy-button`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CopyButton from "@/components/haze/ui/copy-button.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/copy-button.md ### Customize with real content Adapt the Haze copy-button ui for our product. Replace the demo values of these props with our real content: text, label, copiedMessage, showText, class. Keep the layout, the heading level rules and these accessibility details: A live region confirms the write while the button retains focus. The text becomes selectable when clipboard access is unavailable. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using copy-button, check it fits: use it when users need to copy a share url, command, or reference.; the action needs immediate, accessible feedback.. Avoid it when the operation should open a share sheet with multiple destinations.. Alternatives: @haze/snippet, @haze/code-block, @haze/stateful-button. ## Example requests that should lead here - Add a button to copy a public share URL. - Give a generated reference number a clipboard shortcut. ## Source ```astro --- import { Check, Clipboard, CircleAlert } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Button from "./button.astro"; interface Props { text: string; label?: string; copiedMessage?: string; showText?: boolean; class?: string; } const { text, label = "Copy", copiedMessage = "Copied to clipboard.", showText = false, class: className } = Astro.props; ---
{!showText && }
``` --- # Countdown > A fixed UTC deadline with rolling digits, a compact variant and a completion message. - Kind: ui · Category: Feedback · Interactivity: script - Install: `npx shadcn@latest add @haze/countdown` - File: `src/components/haze/ui/countdown.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/countdown ## Use when - A launch or event starts at the same instant for every viewer. - An announcement changes state when registration closes. ## Avoid when - Show a clock counting up or a duration with no known end. - Use progress to track completed work. ## Alternatives - [progress](https://hazeui.com/ui/progress.md) - [animated-number](https://hazeui.com/ui/animated-number.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | target | `Date \| number \| string` | | yes | Deadline as a Date, epoch milliseconds or ISO date/time. A missing offset means UTC. | | label | `string` | Time remaining | no | Visible name of the timer. | | completeLabel | `string` | Live now | no | Replaces the clock at the deadline. | | units | `('days' \| 'hours' \| 'minutes' \| 'seconds')[]` | | no | Shown largest first. The largest selected unit includes omitted larger units. | | variant | `'display' \| 'compact'` | display | no | Segmented digit tiles or a compact inline readout. | | class | `string` | | no | Classes applied to the timer wrapper. | ## Accessibility - A readable UTC deadline is available before the clock enhances. - The timer exposes remaining time on demand and announces completion once. Only changed digits move when motion is enabled. ## Agent prompts ### Install and use Install the Haze UI component "Countdown" with `npx shadcn@latest add @haze/countdown`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Countdown from "@/components/haze/ui/countdown.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/countdown.md ### Customize with real content Adapt the Haze countdown ui for our product. Replace the demo values of these props with our real content: target, label, completeLabel, units, variant, class. Keep the layout, the heading level rules and these accessibility details: A readable UTC deadline is available before the clock enhances. The timer exposes remaining time on demand and announces completion once. Only changed digits move when motion is enabled. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using countdown, check it fits: use it when a launch or event starts at the same instant for every viewer.; an announcement changes state when registration closes.. Avoid it when show a clock counting up or a duration with no known end.; use progress to track completed work.. Alternatives: @haze/progress, @haze/animated-number. ## Example requests that should lead here - Count down to the registration deadline in hours and minutes, then show that registration is closed. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; type Unit = "days" | "hours" | "minutes" | "seconds"; interface Props { target: Date | number | string; label?: string; completeLabel?: string; units?: Unit[]; variant?: "display" | "compact"; class?: string; } const { target, label = "Time remaining", completeLabel = "Live now", units, variant = "display", class: className } = Astro.props; const sizes: Record = { days: 86400000, hours: 3600000, minutes: 60000, seconds: 1000 }; const order = Object.keys(sizes) as Unit[]; const requested = order.filter((unit) => units?.includes(unit)); const shown = requested.length ? requested : order; const compact = variant === "compact"; const short: Record = { days: "d", hours: "h", minutes: "m", seconds: "s" }; let timestamp = target instanceof Date ? target.getTime() : typeof target === "number" ? target : NaN; if (typeof target === "string") { const iso = target.trim(); if (/^\d{4}-\d{2}-\d{2}$/.test(iso)) timestamp = Date.parse(iso + "T00:00:00Z"); else if (/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?$/i.test(iso)) { timestamp = Date.parse(/(?:Z|[+-]\d{2}:?\d{2})$/i.test(iso) ? iso : iso + "Z"); } } const deadline = new Date(timestamp); const valid = Number.isFinite(deadline.getTime()); const formatted = valid ? new Intl.DateTimeFormat("en", { year: "numeric", month: "short", day: "numeric", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZone: "UTC", timeZoneName: "short", }).format(deadline) : ""; ---

{label}

{valid ? ( <> ) :

Date unavailable

}
``` --- # Course curriculum > A course's modules as disclosures with their lessons, durations and done, current or locked states, under an overall progress bar. - Kind: ui · Category: Navigation · Interactivity: native - Install: `npx shadcn@latest add @haze/course-curriculum` - File: `src/components/haze/ui/course-curriculum.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/progress, @haze/utils - Docs page: https://hazeui.com/ui/course-curriculum ## Use when - A course page or lesson player lists every lesson and the learner's progress - A sales page shows what a course covers, module by module ## Avoid when - Steps must be done in one sitting in a fixed order. Use stepper. - The list is a page's own headings. Use table-of-contents. ## Alternatives - [accordion](https://hazeui.com/ui/accordion.md) - [stepper](https://hazeui.com/ui/stepper.md) - [table-of-contents](https://hazeui.com/ui/table-of-contents.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | title | `string` | "Prompting for small business" | no | Visible title, usually the course name. | | modules | `{ title: string; lessons: { title: string; duration?: string; state?: "done" \| "current" \| "open" \| "locked"; href?: string }[] }[]` | | no | Modules in order with their lessons. | | stateLabels | `Partial>` | | no | Words read for each lesson state. | | headingLevel | `2 \| 3 \| 4` | 3 | no | Level of the title. | | class | `string` | | no | Additional classes on the panel. | ## Accessibility - Modules are native disclosures; the one holding the current lesson starts open. - Every lesson's state is read after its title, and the current lesson is marked with aria-current. - Key Enter or Space: Open or close a module. - Key Tab: Move between lessons. ## Agent prompts ### Install and use Install the Haze UI component "Course curriculum" with `npx shadcn@latest add @haze/course-curriculum`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CourseCurriculum from "@/components/haze/ui/course-curriculum.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/course-curriculum.md ### Customize with real content Adapt the Haze course-curriculum ui for our product. Replace the demo values of these props with our real content: title, modules, stateLabels, headingLevel, class. Keep the layout, the heading level rules and these accessibility details: Modules are native disclosures; the one holding the current lesson starts open. Every lesson's state is read after its title, and the current lesson is marked with aria-current. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using course-curriculum, check it fits: use it when a course page or lesson player lists every lesson and the learner's progress; a sales page shows what a course covers, module by module. Avoid it when steps must be done in one sitting in a fixed order. use stepper.; the list is a page's own headings. use table-of-contents.. Alternatives: @haze/accordion, @haze/stepper, @haze/table-of-contents. ## Example requests that should lead here - Add the course outline with three modules, finished lessons checked and later lessons locked. ## Source ```astro --- import { ChevronDown, CircleCheck, CirclePlay, Lock } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Progress from "./progress.astro"; type LessonState = "done" | "current" | "open" | "locked"; interface Lesson { title: string; /** Length as it should read, such as "8 min". */ duration?: string; state?: LessonState; href?: string; } interface Module { title: string; lessons: Lesson[]; } interface Props { /** Visible title, such as the course name. */ title?: string; modules?: Module[]; /** Words for each lesson state, read after the title. */ stateLabels?: Partial>; headingLevel?: 2 | 3 | 4; class?: string; } const { title = "Prompting for small business", modules = [ { title: "Getting started", lessons: [ { title: "What an assistant can and cannot do", duration: "6 min", state: "done", href: "#l1" }, { title: "Your first useful prompt", duration: "9 min", state: "done", href: "#l2" }, { title: "Giving it your price list and FAQ", duration: "11 min", state: "done", href: "#l3" }, ], }, { title: "Writing with it every day", lessons: [ { title: "Replies to customer emails", duration: "8 min", state: "done", href: "#l4" }, { title: "Offers and quotes in your voice", duration: "12 min", state: "current", href: "#l5" }, { title: "Checking facts before you send", duration: "7 min", state: "open", href: "#l6" }, ], }, { title: "Automating the busywork", lessons: [ { title: "Sorting the inbox", duration: "10 min", state: "locked" }, { title: "Weekly reports from a spreadsheet", duration: "14 min", state: "locked" }, ], }, ], stateLabels = {}, headingLevel = 3, class: className, } = Astro.props; const H = `h${headingLevel}` as "h3"; const labels: Record = { done: "completed", current: "in progress", open: "not started", locked: "locked", ...stateLabels }; const all = modules.flatMap((m) => m.lessons); const done = all.filter((l) => l.state === "done").length; ---
{title}

{done} of {all.length} lessons done

{ modules.map((mod, i) => { const modDone = mod.lessons.filter((l) => l.state === "done").length; const active = mod.lessons.some((l) => l.state === "current"); return (
{String(i + 1).padStart(2, "0")} {mod.title} {modDone}/{mod.lessons.length}
    {mod.lessons.map((lesson) => { const state = lesson.state ?? "open"; const Icon = state === "done" ? CircleCheck : state === "locked" ? Lock : CirclePlay; const tone = state === "done" ? "text-success" : state === "current" ? "text-foreground" : "text-muted-foreground"; const inner = ( <>
); }) }
``` --- # Credit card > A bank-card face at the 1.586 ID-1 ratio with masked number, holder, expiry, network name and a frozen or expired tag. - Kind: ui · Category: Data display · Interactivity: none - Install: `npx shadcn@latest add @haze/credit-card` - File: `src/components/haze/ui/credit-card.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/credit-card ## Use when - A wallet or billing page lists the cards on file and each needs a recognizable face. - The card status, frozen or expired, must be visible without opening a menu. - A saved card is confirmed after checkout with only the last four digits. ## Avoid when - The customer types a new card number; use payment-card-input. - A card must turn over to show a back face; use card-flip. - The content is generic, not a payment card; use card. ## Alternatives - [payment-card-input](https://hazeui.com/ui/payment-card-input.md) - [card-flip](https://hazeui.com/ui/card-flip.md) - [card](https://hazeui.com/ui/card.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | network | `string` | Visa | no | Network name rendered as text. It is never drawn as a logo. | | last4 | `string` | 4242 | no | Last four digits. The rest of the number is always masked. | | holder | `string` | Ingrid Solheim | no | Name on the card. | | expiry | `string` | 08/28 | no | Expiry date as MM/YY. | | label | `string` | Business card | no | Name the owner gave the card. | | status | `"active" \| "frozen" \| "expired"` | active | no | Shown as a tag with an icon and text. | | statusLabel | `string` | | no | Replaces the default status word, for translation. | | chip | `boolean` | true | no | Draws the small chip mark. | | endingLabel | `string` | Card ending in | no | Screen reader words read before the last four digits. | | expiryLabel | `string` | Expires | no | Word before the expiry date. | | class | `string` | | no | Classes for the card, such as a max width. | ## Accessibility - The masked dots are hidden from screen readers, which hear 'Card ending in 4242' instead. - Status is a word plus an icon, so frozen and expired never depend on color. - Both surfaces use the theme's foreground pairs, so text keeps its contrast in light and dark. - The face is not interactive. Put a button or link beside it for actions such as freezing. ## Agent prompts ### Install and use Install the Haze UI component "Credit card" with `npx shadcn@latest add @haze/credit-card`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CreditCard from "@/components/haze/ui/credit-card.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/credit-card.md ### Customize with real content Adapt the Haze credit-card ui for our product. Replace the demo values of these props with our real content: network, last4, holder, expiry, label, status, statusLabel, chip, endingLabel, expiryLabel, class. Keep the layout, the heading level rules and these accessibility details: The masked dots are hidden from screen readers, which hear 'Card ending in 4242' instead. Status is a word plus an icon, so frozen and expired never depend on color. Both surfaces use the theme's foreground pairs, so text keeps its contrast in light and dark. The face is not interactive. Put a button or link beside it for actions such as freezing. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using credit-card, check it fits: use it when a wallet or billing page lists the cards on file and each needs a recognizable face.; the card status, frozen or expired, must be visible without opening a menu.; a saved card is confirmed after checkout with only the last four digits.. Avoid it when the customer types a new card number; use payment-card-input.; a card must turn over to show a back face; use card-flip.; the content is generic, not a payment card; use card.. Alternatives: @haze/payment-card-input, @haze/card-flip, @haze/card. ## Example requests that should lead here - Show my saved cards on the billing page, one of them frozen. - Add a business card to the wallet summary with the last four digits. - List expired cards with an Expired tag next to a Replace button. ## Source ```astro --- import { Check, CircleAlert, Snowflake } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; type Status = "active" | "frozen" | "expired"; interface Props { /** Card network written as text, such as "Visa". Never drawn as a logo. */ network?: string; /** Last four digits. Only these are ever shown. */ last4?: string; holder?: string; /** Expiry as MM/YY. */ expiry?: string; /** Name of the card, such as "Business card". */ label?: string; status?: Status; /** Text next to the status icon. Defaults to Active, Frozen or Expired. */ statusLabel?: string; /** Draws the small chip mark. */ chip?: boolean; /** Screen reader prefix for the masked number. */ endingLabel?: string; expiryLabel?: string; class?: string; } const { network = "Visa", last4 = "4242", holder = "Ingrid Solheim", expiry = "08/28", label = "Business card", status = "active", statusLabel, chip = true, endingLabel = "Card ending in", expiryLabel = "Expires", class: className, } = Astro.props; const frozen = status === "frozen"; const statusText: Record = { active: "Active", frozen: "Frozen", expired: "Expired" }; const StatusIcon = { active: Check, frozen: Snowflake, expired: CircleAlert }[status]; const digits = last4.replace(/\D/g, "").slice(-4); const muted = "text-muted-foreground"; ---

{label}

{ chip && ( ) }

{endingLabel} {digits}

{holder}

{expiryLabel} {expiry}

{network}

``` --- # Currency Transfer > A live international transfer progress card with recipient header, conversion summary, 4-step timeline, and copyable reference ID. - Kind: ui · Category: Data display · Interactivity: script - Install: `npx shadcn@latest add @haze/currency-transfer` - File: `src/components/haze/ui/currency-transfer.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/currency-transfer ## Use when - Users track an active cross-border payout through payment, conversion, dispatch, and arrival milestones. - Locked exchange rate, recipient bank details, and transaction reference need to stay visible on a compact vertical card. ## Avoid when - Users need to enter an arbitrary amount and choose currencies from scratch. Use price-input or a form block instead. - Multiple historical payouts should be compared in rows. Use table. ## Alternatives - [price-input](https://hazeui.com/ui/price-input.md) - [card](https://hazeui.com/ui/card.md) - [timeline](https://hazeui.com/ui/timeline.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | recipientName | `string` | "Lena Fischer" | no | Full name of the payout recipient. | | recipientBank | `string` | "Deutsche Bank ··7823" | no | Destination bank name and masked account suffix. | | recipientInitials | `string` | | no | Optional avatar initials; derived from recipientName when omitted. | | sentAmount | `number` | 500 | no | Amount sent in the source currency. | | sourceCurrency | `string` | "USD" | no | ISO 4217 currency code for the sent amount. | | receivedAmount | `number` | 460 | no | Converted amount delivered to the recipient. | | targetCurrency | `string` | "EUR" | no | ISO 4217 currency code for the received amount. | | transactionId | `string` | "TXN-DAB3UL494" | no | Copyable transaction reference code shown in the card footer. | | rateLockedAt | `string` | "Rate locked 10:45 AM" | no | Timestamp note showing when the conversion rate was locked. | | statusLabel | `string` | "In progress" | no | Badge label shown while transfer milestones are pending. | | completedLabel | `string` | "Completed" | no | Badge label shown once every step completes. | | initialStep | `number` | 1 | no | Zero-based active step index on initial render. | | steps | `TransferStep[]` | | no | Ordered transfer milestones with title and supporting detail. | | headingLevel | `2 \| 3 \| 4` | 3 | no | Heading level for the recipient name. | | class | `string` | | no | Additional classes on the outer card. | ## Accessibility - Step transitions and transaction ID copy feedback are announced via an aria-live polite status region. - The spinning progress indicator respects prefers-reduced-motion via motion-safe:animate-spin. - Without JavaScript, all four transfer steps, conversion totals, and the transaction reference render legibly. - Key Tab then Enter or Space: Step through the transfer milestones, replay progress, or copy the transaction ID. ## Agent prompts ### Install and use Install the Haze UI component "Currency Transfer" with `npx shadcn@latest add @haze/currency-transfer`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CurrencyTransfer from "@/components/haze/ui/currency-transfer.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/currency-transfer.md ### Customize with real content Adapt the Haze currency-transfer ui for our product. Replace the demo values of these props with our real content: recipientName, recipientBank, recipientInitials, sentAmount, sourceCurrency, receivedAmount, targetCurrency, transactionId, rateLockedAt, statusLabel, completedLabel, initialStep, steps, headingLevel, class. Keep the layout, the heading level rules and these accessibility details: Step transitions and transaction ID copy feedback are announced via an aria-live polite status region. The spinning progress indicator respects prefers-reduced-motion via motion-safe:animate-spin. Without JavaScript, all four transfer steps, conversion totals, and the transaction reference render legibly. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using currency-transfer, check it fits: use it when users track an active cross-border payout through payment, conversion, dispatch, and arrival milestones.; locked exchange rate, recipient bank details, and transaction reference need to stay visible on a compact vertical card.. Avoid it when users need to enter an arbitrary amount and choose currencies from scratch. use price-input or a form block instead.; multiple historical payouts should be compared in rows. use table.. Alternatives: @haze/price-input, @haze/card, @haze/timeline. ## Example requests that should lead here - Create a live USD to EUR currency transfer status card with a 4-step vertical timeline and copyable transaction reference. - Show an international wire progress card for Lena Fischer with locked rate timestamp and step-by-step arrival state. ## Source ```astro --- import { ArrowRight, Check, Copy, LoaderCircle, RotateCcw } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface TransferStep { title: string; detail: string; } interface Props { recipientName?: string; recipientBank?: string; recipientInitials?: string; sentAmount?: number; sourceCurrency?: string; receivedAmount?: number; targetCurrency?: string; transactionId?: string; rateLockedAt?: string; statusLabel?: string; completedLabel?: string; initialStep?: number; steps?: TransferStep[]; headingLevel?: 2 | 3 | 4; class?: string; } const { recipientName = "Lena Fischer", recipientBank = "Deutsche Bank ··7823", recipientInitials, sentAmount = 500, sourceCurrency = "USD", receivedAmount = 460, targetCurrency = "EUR", transactionId = "TXN-DAB3UL494", rateLockedAt = "Rate locked 10:45 AM", statusLabel = "In progress", completedLabel = "Completed", initialStep = 1, steps = [ { title: "Payment received", detail: "From Chase ··4589" }, { title: "Converted to EUR", detail: "1 USD = 0.9200 EUR" }, { title: "Sent to Deutsche Bank", detail: "Deutsche Bank ··7823" }, { title: "Arriving", detail: "Usually within a minute" }, ], headingLevel = 3, class: className, } = Astro.props; const Heading = ({ 2: "h2", 3: "h3", 4: "h4" } as const)[headingLevel]; const computedInitials = recipientInitials ?? recipientName .trim() .split(/\s+/) .slice(0, 2) .map((part) => part[0]?.toUpperCase() ?? "") .join(""); const safeSent = Number.isFinite(sentAmount) && sentAmount >= 0 ? sentAmount : 0; const safeReceived = Number.isFinite(receivedAmount) && receivedAmount >= 0 ? receivedAmount : 0; const clampedStep = Math.max(0, Math.min(steps.length, Math.floor(initialStep))); const isInitiallyComplete = clampedStep >= steps.length; const heroMoney = new Intl.NumberFormat("en-US", { style: "currency", currency: sourceCurrency, minimumFractionDigits: 2, maximumFractionDigits: 2, }).format(safeSent); const numFmt = new Intl.NumberFormat("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2, }); const conversionSubtitle = `${numFmt.format(safeSent)} ${sourceCurrency} sent · ${numFmt.format(safeReceived)} ${targetCurrency} received`; ---
{recipientName}

{recipientBank}

{isInitiallyComplete ? completedLabel : statusLabel}

{heroMoney}

{conversionSubtitle}

    {steps.map((step, index) => { const state = index < clampedStep ? "done" : index === clampedStep ? "active" : "pending"; return (
  1. {step.title}

    {step.detail}

  2. ); })}
{rateLockedAt}

``` --- # Data Grid > Edit a native table with keyboard movement, drag or Shift ranges, clipboard paste, fill-down, undo, and redo. - Kind: ui · Category: Data display · Interactivity: script - Install: `npx shadcn@latest add @haze/data-grid` - File: `src/components/haze/ui/data-grid.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/button, @haze/sortable-data-table, @haze/utils - Docs page: https://hazeui.com/ui/data-grid ## Use when - People edit a small to medium budget or inventory in place. - Copying rectangular values between the grid and a spreadsheet speeds up entry. ## Avoid when - The dataset needs server paging or virtualization. Use a data-source integration around a paged table. ## Alternatives - [sortable-data-table](https://hazeui.com/ui/sortable-data-table.md) - [inline-edit](https://hazeui.com/ui/inline-edit.md) - [table](https://hazeui.com/ui/table.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique table ID and keyboard instructions prefix. | | caption | `string` | | no | Visible name for the editable dataset. | | columns | `Column[]` | | no | Column keys, labels, numeric flags and optional editable false. | | rows | `Record[]` | | no | Initial values. The browser dispatches changes for the host to persist. | | class | `string` | | no | Additional classes on the component wrapper. | ## Accessibility - Only one data cell enters the tab order. Arrow keys move through cells, Shift extends a rectangular range, and Enter opens a labelled input. - Numeric cells reject empty and nonfinite edits. All edits emit haze:grid-change for application persistence. Static markup exposes the full native table. - Key Arrows / Home / End: Move the active cell. Hold Shift to extend the selected range. - Key Enter / F2 / Escape: Edit the cell, commit, or cancel. - Key Control / Command C, V, Z: Copy, paste or undo. Shift Z redoes. ## Agent prompts ### Install and use Install the Haze UI component "Data Grid" with `npx shadcn@latest add @haze/data-grid`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import DataGrid from "@/components/haze/ui/data-grid.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/data-grid.md ### Customize with real content Adapt the Haze data-grid ui for our product. Replace the demo values of these props with our real content: id, caption, columns, rows, class. Keep the layout, the heading level rules and these accessibility details: Only one data cell enters the tab order. Arrow keys move through cells, Shift extends a rectangular range, and Enter opens a labelled input. Numeric cells reject empty and nonfinite edits. All edits emit haze:grid-change for application persistence. Static markup exposes the full native table. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using data-grid, check it fits: use it when people edit a small to medium budget or inventory in place.; copying rectangular values between the grid and a spreadsheet speeds up entry.. Avoid it when the dataset needs server paging or virtualization. use a data-source integration around a paged table.. Alternatives: @haze/sortable-data-table, @haze/inline-edit, @haze/table. ## Example requests that should lead here - Create an editable release budget with range paste, fill-down and undo. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; import { Check, Clipboard } from "@lucide/astro"; import SortableDataTable from "./sortable-data-table.astro"; import Button from "./button.astro"; interface Props { id: string; caption?: string; columns?: { key: string; label: string; numeric?: boolean; editable?: boolean }[]; rows?: Record[]; class?: string; } const { id, caption = "Release budget", class: className, columns = [{ key: "item", label: "Item" }, { key: "planned", label: "Planned", numeric: true }, { key: "actual", label: "Actual", numeric: true }], rows = [{ item: "Design", planned: 2400, actual: 2100 }, { item: "Development", planned: 5200, actual: 4800 }, { item: "Review", planned: 1600, actual: 1400 }], } = Astro.props; ---

Use arrows to move, Shift to select a range, Enter to edit, and Control or Command Z to undo.

Editing is enabled when scripts are available.

``` --- # Date picker > A compact native date field with a keyboard-navigable month grid in a popover. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/date-picker` - File: `src/components/haze/ui/date-picker.astro` - npm dependencies: none - Registry dependencies: @haze/calendar - Docs page: https://hazeui.com/ui/date-picker ## Use when - A form needs a single date in less space than an inline calendar. - People may want to browse adjacent days before choosing a date. ## Avoid when - The user needs to set both ends of a date range. ## Alternatives - [calendar](https://hazeui.com/ui/calendar.md) - [date-range-picker](https://hazeui.com/ui/date-range-picker.md) - [time-picker](https://hazeui.com/ui/time-picker.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique field and popover ID prefix. | | name | `string` | id | no | Submitted field name. | | label | `string` | Date | no | Visible native field label. | | value | `string` | | no | Initial date as YYYY-MM-DD. | | min | `string` | | no | Earliest selectable date as YYYY-MM-DD. | | max | `string` | | no | Latest selectable date as YYYY-MM-DD. | | required | `boolean` | | no | Requires a date for form submission. | | disabled | `boolean` | | no | Disables the field and its custom picker. | | form | `string` | | no | ID of an external form. | | locale | `string` | en | no | Locale used for the month grid. | | weekStart | `0 \| 1` | 1 | no | Shows Sunday or Monday first. | | openLabel | `string` | Open calendar | no | Accessible name for the calendar trigger and panel. | | class | `string` | | no | Classes on the outer wrapper. | ## Accessibility - The native date field remains usable with scripting disabled. - Opening from the button or the keyboard moves focus into the month grid; clicking the field opens it and keeps focus in the field for typing. Focus returns after choosing a date or pressing Escape. - The browser's own date popup never opens on top of the calendar. - Key Arrow keys: Move by a day or a week inside the open grid. - Key Enter / Space: Choose the focused day. - Key Escape: Close the calendar without changing the field. - Key Space, F4 or Alt + Down in the field: Open the calendar. ## Agent prompts ### Install and use Install the Haze UI component "Date picker" with `npx shadcn@latest add @haze/date-picker`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import DatePicker from "@/components/haze/ui/date-picker.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/date-picker.md ### Customize with real content Adapt the Haze date-picker ui for our product. Replace the demo values of these props with our real content: id, name, label, value, min, max, required, disabled, form, locale, weekStart, openLabel, class. Keep the layout, the heading level rules and these accessibility details: The native date field remains usable with scripting disabled. Opening from the button or the keyboard moves focus into the month grid; clicking the field opens it and keeps focus in the field for typing. Focus returns after choosing a date or pressing Escape. The browser's own date popup never opens on top of the calendar. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using date-picker, check it fits: use it when a form needs a single date in less space than an inline calendar.; people may want to browse adjacent days before choosing a date.. Avoid it when the user needs to set both ends of a date range.. Alternatives: @haze/calendar, @haze/date-range-picker, @haze/time-picker. ## Example requests that should lead here - Add a delivery date field that opens a month picker and allows only dates in the booking window. ## Source ```astro --- import Calendar from "./calendar.astro"; interface Props { id: string; name?: string; label?: string; value?: string; min?: string; max?: string; required?: boolean; disabled?: boolean; form?: string; locale?: string; weekStart?: 0 | 1; openLabel?: string; class?: string; [key: string]: unknown; } const { id, ...props } = Astro.props; --- ``` --- # Date range picker > Two native date controls with a shared label and validation for an end date earlier than the start. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/date-range-picker` - File: `src/components/haze/ui/date-range-picker.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/button, @haze/input, @haze/utils - Docs page: https://hazeui.com/ui/date-range-picker ## Use when - A report or export collects a start date and an end date - Native date pickers suit the device and locale ## Avoid when - Only one date is needed. Use input with type date. - Customers need a visual overview of unavailable dates throughout a calendar. ## Alternatives - [input](https://hazeui.com/ui/input.md) - [field](https://hazeui.com/ui/field.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique prefix for both field IDs and the validation message. | | label | `string` | "Date range" | no | Legend for the pair. | | start | `string` | | no | Initial start date in YYYY-MM-DD format. | | end | `string` | | no | Initial end date in YYYY-MM-DD format. | | startName | `string` | id + -start | no | Submitted name for the start date. | | endName | `string` | id + -end | no | Submitted name for the end date. | | startLabel | `string` | "Start" | no | Start field label. | | endLabel | `string` | "End" | no | End field label. | | min | `string` | | no | Earliest date for either field. | | max | `string` | | no | Latest date for either field. | | required | `boolean` | | no | Requires both dates. | | disabled | `boolean` | | no | Disables both fields. | | orderError | `string` | "Choose an end date on or after the start date." | no | Validation text for a reversed range. | | startAttributes | `Record` | | no | Additional attributes for the start input. | | endAttributes | `Record` | | no | Additional attributes for the end input. | | class | `string` | | no | Additional classes on the fieldset. | ## Accessibility - The fieldset legend and each input label describe the two levels of the control. - The browser controls how each date picker opens and displays dates. - Validate the date order on the server as well. Without JavaScript both fields still submit. - Key Tab: Move between the date fields and their native controls. ## Agent prompts ### Install and use Install the Haze UI component "Date range picker" with `npx shadcn@latest add @haze/date-range-picker`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import DateRangePicker from "@/components/haze/ui/date-range-picker.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/date-range-picker.md ### Customize with real content Adapt the Haze date-range-picker ui for our product. Replace the demo values of these props with our real content: id, label, start, end, startName, endName, startLabel, endLabel, min, max, required, disabled, orderError, startAttributes, endAttributes, class. Keep the layout, the heading level rules and these accessibility details: The fieldset legend and each input label describe the two levels of the control. The browser controls how each date picker opens and displays dates. Validate the date order on the server as well. Without JavaScript both fields still submit. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using date-range-picker, check it fits: use it when a report or export collects a start date and an end date; native date pickers suit the device and locale. Avoid it when only one date is needed. use input with type date.; customers need a visual overview of unavailable dates throughout a calendar.. Alternatives: @haze/input, @haze/field. ## Example requests that should lead here - Add a reporting period picker that submits from and through dates and flags reversed ranges. ## Source ```astro --- import { CalendarRange, ChevronLeft, ChevronRight } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Button from "./button.astro"; import Input from "./input.astro"; interface Props { id: string; label?: string; start?: string; end?: string; startName?: string; endName?: string; startLabel?: string; endLabel?: string; min?: string; max?: string; required?: boolean; disabled?: boolean; locale?: string; weekStart?: 0 | 1; orderError?: string; startAttributes?: Record; endAttributes?: Record; class?: string; } const { id, label = "Date range", start, end, startName = `${id}-start`, endName = `${id}-end`, startLabel = "Start", endLabel = "End", min, max, required, disabled, locale = "en", weekStart = 1, orderError = "Choose an end date on or after the start date.", startAttributes, endAttributes, class: className, } = Astro.props; const { "aria-describedby": endDescription, ...endRest } = endAttributes ?? {}; const endDescribedBy = [endDescription, `${id}-order`].filter(Boolean).join(" "); const panelId = `${id}-range-popover`; ---
{label}

``` --- # Datetime picker > Combined date and time selector in an anchored popover with preset time slots, timezone label, and native input fallback. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/datetime-picker` - File: `src/components/haze/ui/datetime-picker.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/datetime-picker ## Use when - Scheduling releases, webhooks, or calendar events to a specific date and time - Forms needing combined timestamp entry with clear timezone context ## Avoid when - Only a calendar day is required; use date-picker - Only a clock time is required; use time-picker ## Alternatives - [date-picker](https://hazeui.com/ui/date-picker.md) - [time-picker](https://hazeui.com/ui/time-picker.md) - [date-range-picker](https://hazeui.com/ui/date-range-picker.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique DOM id backing the underlying datetime-local input. | | label | `string` | "Publish date and time" | no | Visible field label. | | value | `string` | "2026-11-21T14:30" | no | ISO local datetime string YYYY-MM-DDTHH:MM. | | timezone | `string` | "UTC" | no | Short timezone indicator shown next to the label. | ## Accessibility - Falls back cleanly to native when popover APIs are unavailable. - Trigger button opens the anchored popover and restores focus cleanly when Done is pressed. - Key Escape: Dismisses the datetime popover and returns focus to the trigger. ## Agent prompts ### Install and use Install the Haze UI component "Datetime picker" with `npx shadcn@latest add @haze/datetime-picker`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import DatetimePicker from "@/components/haze/ui/datetime-picker.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/datetime-picker.md ### Customize with real content Adapt the Haze datetime-picker ui for our product. Replace the demo values of these props with our real content: id, label, value, timezone. Keep the layout, the heading level rules and these accessibility details: Falls back cleanly to native when popover APIs are unavailable. Trigger button opens the anchored popover and restores focus cleanly when Done is pressed. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using datetime-picker, check it fits: use it when scheduling releases, webhooks, or calendar events to a specific date and time; forms needing combined timestamp entry with clear timezone context. Avoid it when only a calendar day is required; use date-picker; only a clock time is required; use time-picker. Alternatives: @haze/date-picker, @haze/time-picker, @haze/date-range-picker. ## Example requests that should lead here - Add a datetime picker for scheduling an announcement publish timestamp in UTC ## Source ```astro --- import { CalendarClock, ChevronLeft, ChevronRight, Clock } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id: string; name?: string; label?: string; value?: string; timezone?: string; locale?: string; weekStart?: 0 | 1; required?: boolean; disabled?: boolean; class?: string; [key: string]: unknown; } const { id, name = id, label = "Publish date and time", value = "2026-11-21T14:30", timezone = "UTC", locale = "en", weekStart = 1, required = false, disabled = false, class: className, ...rest } = Astro.props; const [initDate = "2026-11-21", initTime = "14:30"] = value.split("T"); const [initHour = "14", initMinute = "30"] = initTime.split(":"); const hours = Array.from({ length: 24 }, (_, i) => String(i).padStart(2, "0")); const minutes = Array.from({ length: 12 }, (_, i) => String(i * 5).padStart(2, "0")); ---
{timezone && {timezone}}

{initTime}

Hour

{ hours.map((h) => ( )) }

Minute

{ minutes.map((m) => ( )) }
``` --- # Description list > Structured semantic
key-value metadata grid for account details, invoices, and API resource properties. - Kind: ui · Category: Data display · Interactivity: script - Install: `npx shadcn@latest add @haze/description-list` - File: `src/components/haze/ui/description-list.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/description-list ## Use when - Displaying account identifiers, billing metadata, or deployment properties - Inspector drawers and detail views alongside tables ## Avoid when - Tabular multi-row collections belong in table - Single KPI figures belong in stat ## Alternatives - [table](https://hazeui.com/ui/table.md) - [stat](https://hazeui.com/ui/stat.md) - [item](https://hazeui.com/ui/item.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | title | `string` | "Workspace details" | no | Header title. | | description | `string` | | no | Optional subtitle under the heading. | | items | `DetailItem[]` | | no | Key-value pairs with optional monospace, semantic tone, and copy button. | | columns | `1 \| 2 \| 3` | 2 | no | Responsive grid columns above small viewports. | ## Accessibility - Uses semantic HTML
,
, and
landmarks so screen readers pair every value with its label. - Copy buttons announce clipboard confirmation through a polite live status region. ## Agent prompts ### Install and use Install the Haze UI component "Description list" with `npx shadcn@latest add @haze/description-list`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import DescriptionList from "@/components/haze/ui/description-list.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/description-list.md ### Customize with real content Adapt the Haze description-list ui for our product. Replace the demo values of these props with our real content: title, description, items, columns. Keep the layout, the heading level rules and these accessibility details: Uses semantic HTML
,
, and
landmarks so screen readers pair every value with its label. Copy buttons announce clipboard confirmation through a polite live status region. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using description-list, check it fits: use it when displaying account identifiers, billing metadata, or deployment properties; inspector drawers and detail views alongside tables. Avoid it when tabular multi-row collections belong in table; single kpi figures belong in stat. Alternatives: @haze/table, @haze/stat, @haze/item. ## Example requests that should lead here - Add a two-column description list displaying workspace ID, region, and plan tier ## Source ```astro --- import { Check, Copy } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface DetailItem { label: string; value: string; mono?: boolean; copyable?: boolean; tone?: "default" | "success" | "warning" | "destructive"; } interface Props { title?: string; description?: string; items?: DetailItem[]; columns?: 1 | 2 | 3; headingLevel?: 2 | 3 | 4; class?: string; } const { title = "Workspace details", description = "Configuration and billing identifiers.", items = [ { label: "Organization", value: "Tidewell Studio" }, { label: "Workspace ID", value: "ws_9f82c10a", mono: true, copyable: true }, { label: "Plan tier", value: "Scale · Active", tone: "success" }, { label: "Region", value: "eu-central-1", mono: true }, ], columns = 2, headingLevel = 3, class: className, } = Astro.props; const Heading = ({ 2: "h2", 3: "h3", 4: "h4" } as const)[headingLevel]; const gridCols = { 1: "grid-cols-1", 2: "grid-cols-1 sm:grid-cols-2", 3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3", }[columns]; const tones = { default: "text-foreground", success: "text-success", warning: "text-warning", destructive: "text-destructive", }; ---
{ (title || description) && (
{title && {title}} {description &&

{description}

}
) }
{ items.map((item) => (
{item.label}
{item.value} {item.copyable && ( )}
)) }
``` --- # Dialog stack > Native modal for a short multi-step flow; finished steps peek behind the current one. All steps list in order without script. - Kind: ui · Category: Overlays · Interactivity: script - Install: `npx shadcn@latest add @haze/dialog-stack` - File: `src/components/haze/ui/dialog-stack.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/button, @haze/utils - Docs page: https://hazeui.com/ui/dialog-stack ## Use when - A two to four step flow such as invite, choose a role, review, where the user should see progress behind the panel - A short setup wizard that must not leave the current page - Steps that share one trigger and one outcome, with Back and Next between them ## Avoid when - A single decision or short form needs only dialog. - A long flow with many fields deserves its own page; use stepper for in-page progress. - Side-anchored detail panels fit drawer better than a centered modal. ## Alternatives - [dialog](https://hazeui.com/ui/dialog.md) - [drawer](https://hazeui.com/ui/drawer.md) - [stepper](https://hazeui.com/ui/stepper.md) - [alert-dialog](https://hazeui.com/ui/alert-dialog.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique on the page. Buttons target it with commandfor=""; step ids derive from it. | | steps | `{ title: string; description: string; body?: string }[]` | three-step invite flow | no | One entry per step. Each gets its own heading and description. | | trigger | `boolean` | true | no | Set to false when the opening button lives elsewhere. | | triggerLabel | `string` | "Invite teammates" | no | Trigger button text. | | triggerVariant | `"primary" \| "secondary" \| "outline" \| "ghost"` | "outline" | no | Trigger button style. | | stepLabel | `string` | "Step" | no | First word of the counter text, "Step 2 of 3". Translate it. | | ofLabel | `string` | "of" | no | Middle word of the counter text. Translate it. | | backLabel | `string` | "Back" | no | Back button text. | | nextLabel | `string` | "Next" | no | Next button text. | | doneLabel | `string` | "Done" | no | Final button text; closes the dialog. | | closeLabel | `string` | "Close" | no | Accessible name of the close icon button. | | headingLevel | `2 \| 3 \| 4 \| 5 \| 6` | 2 | no | Heading level of each step title. | | class | `string` | | no | Extra classes on the dialog. | ## Accessibility - showModal() semantics: the page behind is inert, focus stays inside and returns to the trigger on close. - The dialog's aria-labelledby and aria-describedby follow the current step. Earlier and later steps are inert, so assistive tech and Tab only reach the current panel. - Moving Back or Next puts focus on the new step's heading; the "Step 2 of 3" counter is plain text above it. - Without script every step shows as a section in one scrollable dialog with a single Done button, and Back and Next stay hidden. - Opening uses command and commandfor (Chrome 135, Firefox 144, Safari 26.2); the small shared script covers older browsers. Panels slide over 300 ms; reduced-motion users get none. - Key Enter / Space: Open the dialog from the trigger; press Back, Next or Done - Key Tab / Shift+Tab: Move between the current step's controls; focus stays inside the dialog - Key Escape: Close the whole stack and return focus to the trigger ## Agent prompts ### Install and use Install the Haze UI component "Dialog stack" with `npx shadcn@latest add @haze/dialog-stack`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import DialogStack from "@/components/haze/ui/dialog-stack.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/dialog-stack.md ### Customize with real content Adapt the Haze dialog-stack ui for our product. Replace the demo values of these props with our real content: id, steps, trigger, triggerLabel, triggerVariant, stepLabel, ofLabel, backLabel, nextLabel, doneLabel, closeLabel, headingLevel, class. Keep the layout, the heading level rules and these accessibility details: showModal() semantics: the page behind is inert, focus stays inside and returns to the trigger on close. The dialog's aria-labelledby and aria-describedby follow the current step. Earlier and later steps are inert, so assistive tech and Tab only reach the current panel. Moving Back or Next puts focus on the new step's heading; the "Step 2 of 3" counter is plain text above it. Without script every step shows as a section in one scrollable dialog with a single Done button, and Back and Next stay hidden. Opening uses command and commandfor (Chrome 135, Firefox 144, Safari 26.2); the small shared script covers older browsers. Panels slide over 300 ms; reduced-motion users get none. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using dialog-stack, check it fits: use it when a two to four step flow such as invite, choose a role, review, where the user should see progress behind the panel; a short setup wizard that must not leave the current page; steps that share one trigger and one outcome, with back and next between them. Avoid it when a single decision or short form needs only dialog.; a long flow with many fields deserves its own page; use stepper for in-page progress.; side-anchored detail panels fit drawer better than a centered modal.. Alternatives: @haze/dialog, @haze/drawer, @haze/stepper, @haze/alert-dialog. ## Example requests that should lead here - Add a three-step dialog to invite teammates, choose their role and review - Build a short onboarding flow in a modal where earlier steps stay visible behind ## Source ```astro --- import { X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Button from "./button.astro"; interface Step { title: string; description: string; body?: string; } interface Props { /** Unique on the page. Any button with `command="show-modal" commandfor=""` opens the stack. */ id: string; steps?: Step[]; /** Set to false when the opening button lives somewhere else on the page. */ trigger?: boolean; triggerLabel?: string; triggerVariant?: "primary" | "secondary" | "outline" | "ghost"; /** Words around the step counter: "Step 2 of 3". Translate both. */ stepLabel?: string; ofLabel?: string; backLabel?: string; nextLabel?: string; doneLabel?: string; closeLabel?: string; headingLevel?: 2 | 3 | 4 | 5 | 6; class?: string; } const { id, steps = [ { title: "Invite teammates", description: "Add the people who should join the Bramble Studio workspace.", body: "Paste up to ten email addresses, separated by commas. Nobody gets an email until you finish the last step.", }, { title: "Choose a role", description: "Pick what the new people can do once they join.", body: "Editors can change projects and invite others. Viewers can read and comment. You can change a role later in Settings.", }, { title: "Review and send", description: "Check the details before the invitations go out.", body: "Three invitations will be sent today as Editor. Each link works for seven days and can be revoked from the Members page.", }, ], trigger = true, triggerLabel = "Invite teammates", triggerVariant = "outline", stepLabel = "Step", ofLabel = "of", backLabel = "Back", nextLabel = "Next", doneLabel = "Done", closeLabel = "Close", headingLevel = 2, class: className, } = Astro.props; const Heading = `h${headingLevel}` as const; const last = steps.length - 1; --- { trigger && ( ) }
{ steps.map((step, index) => (

{stepLabel} {index + 1} {ofLabel} {steps.length}

{step.title}

{step.description}

{step.body &&

{step.body}

}
{index > 0 && ( )} {index < last && ( )} {index === last && (
)}
0 && "hidden [[data-enhanced]_&]:block")}>
)) }
``` --- # Dialog > Native modal with a title, description, body, and footer actions. - Kind: ui · Category: Overlays · Interactivity: script - Install: `npx shadcn@latest add @haze/dialog` - File: `src/components/haze/ui/dialog.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/button, @haze/utils - Docs page: https://hazeui.com/ui/dialog ## Use when - A short task that needs the user's full attention, such as inviting a teammate - Collecting a short decision or additional context before continuing - A form with one to four fields that does not deserve its own page ## Avoid when - Long or multi-step flows need their own page. - Status messages that need no decision; use alert - A destructive confirmation needs an explicit choice. Use alert-dialog. ## Alternatives - [popover](https://hazeui.com/ui/popover.md) - [alert](https://hazeui.com/ui/alert.md) - [alert-dialog](https://hazeui.com/ui/alert-dialog.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique on the page. Buttons target it with commandfor="". | | title | `string` | | yes | Heading; also the dialog's accessible name. | | description | `string` | | no | One or two sentences under the title. | | trigger | `boolean` | true | no | Set to false when the opening button lives elsewhere. | | triggerLabel | `string` | "Open dialog" | no | Trigger text when the trigger slot is not used. | | triggerVariant | `"primary" \| "secondary" \| "outline" \| "ghost"` | "outline" | no | Trigger button style. | | size | `"sm" \| "md" \| "lg"` | "md" | no | Maximum width: 24, 28 or 42 rem. | | closeLabel | `string` | "Close" | no | Accessible name of the close button; translate it. | | role | `"dialog" \| "alertdialog"` | "dialog" | no | Alert dialogs omit the close icon and require a closing action or Escape. | | headingLevel | `2 \| 3 \| 4 \| 5 \| 6` | 2 | no | Heading level for the dialog title. | | class | `string` | | no | Extra classes on the dialog. | | default slot | `slot` | | no | Body content. | | footer slot | `slot` | | no | Action buttons. Close with command="close" commandfor="" or a form with method="dialog". | | trigger slot | `slot` | | no | Custom trigger content. | ## Accessibility - showModal() semantics: the page behind is inert, focus moves into the dialog and returns to the trigger on close. - Opening uses the command and commandfor attributes (Chrome 135, Firefox 144, Safari 26.2). The small script covers older browsers; without both, the trigger does nothing. - The dialog fades and scales in over 200 ms and out again, and its backdrop fades with it; reduced-motion users get no animation. - The title is linked with aria-labelledby and the description with aria-describedby. - Put the least destructive action first in the DOM so it receives initial focus. - Key Enter / Space: Open the dialog from the trigger - Key Tab / Shift+Tab: Move between controls; focus stays inside the dialog - Key Escape: Close the dialog and return focus to the trigger ## Agent prompts ### Install and use Install the Haze UI component "Dialog" with `npx shadcn@latest add @haze/dialog`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Dialog from "@/components/haze/ui/dialog.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/dialog.md ### Customize with real content Adapt the Haze dialog ui for our product. Replace the demo values of these props with our real content: id, title, description, trigger, triggerLabel, triggerVariant, size, closeLabel, role, headingLevel, class, default slot, footer slot, trigger slot. Keep the layout, the heading level rules and these accessibility details: showModal() semantics: the page behind is inert, focus moves into the dialog and returns to the trigger on close. Opening uses the command and commandfor attributes (Chrome 135, Firefox 144, Safari 26.2). The small script covers older browsers; without both, the trigger does nothing. The dialog fades and scales in over 200 ms and out again, and its backdrop fades with it; reduced-motion users get no animation. The title is linked with aria-labelledby and the description with aria-describedby. Put the least destructive action first in the DOM so it receives initial focus. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using dialog, check it fits: use it when a short task that needs the user's full attention, such as inviting a teammate; collecting a short decision or additional context before continuing; a form with one to four fields that does not deserve its own page. Avoid it when long or multi-step flows need their own page.; status messages that need no decision; use alert; a destructive confirmation needs an explicit choice. use alert-dialog.. Alternatives: @haze/popover, @haze/alert, @haze/alert-dialog. ## Example requests that should lead here - Add an invite dialog with an email field and Cancel and Send buttons - Ask for confirmation in a dialog before deleting a project ## Source ```astro --- import { X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Button from "./button.astro"; interface Props { /** Unique on the page. Any button with `command="show-modal" commandfor=""` opens this dialog. */ id: string; title: string; description?: string; /** Set to false when the opening button lives somewhere else on the page. */ trigger?: boolean; /** Visible trigger text. The "trigger" slot replaces it. */ triggerLabel?: string; triggerVariant?: "primary" | "secondary" | "outline" | "ghost"; size?: "sm" | "md" | "lg"; closeLabel?: string; role?: "dialog" | "alertdialog"; headingLevel?: 2 | 3 | 4 | 5 | 6; class?: string; } const { id, title, description, trigger = true, triggerLabel = "Open dialog", triggerVariant = "outline", size = "md", closeLabel = "Close", role = "dialog", headingLevel = 2, class: className, } = Astro.props; const sizes = { sm: "max-w-sm", md: "max-w-md", lg: "max-w-2xl" }; const confirmation = role === "alertdialog"; const Heading = `h${headingLevel}` as const; --- { trigger && ( ) }
{title} {description &&

{description}

}
{ Astro.slots.has("footer") && (
) } {!confirmation &&
}
``` --- # Diff viewer > Unified and side-by-side code diff viewer with addition/deletion counts and monospace line numbers. - Kind: ui · Category: Data display · Interactivity: script - Install: `npx shadcn@latest add @haze/diff-viewer` - File: `src/components/haze/ui/diff-viewer.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/diff-viewer ## Use when - Reviewing config updates, release diffs, or AI-proposed file changes - Inspecting before-and-after code patches inside drawers or PR views ## Avoid when - Read-only static snippets need no diff markers; use code-block - Visual before/after image comparison belongs in compare-slider ## Alternatives - [code-block](https://hazeui.com/ui/code-block.md) - [compare-slider](https://hazeui.com/ui/compare-slider.md) - [json-viewer](https://hazeui.com/ui/json-viewer.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique DOM id for the diff viewer. | | filename | `string` | "haze.config.ts" | no | File path shown in the header bar. | | lines | `DiffLine[]` | | no | Diff hunks with type (context, add, del), line numbers, and content. | | view | `"unified" \| "split"` | "unified" | no | Initial unified or side-by-side layout. | ## Accessibility - Explicit '+' and '-' markers accompany color fills so additions and deletions never depend on hue alone. - Decorative line numbers carry select-none so copying code text skips line gutters. ## Agent prompts ### Install and use Install the Haze UI component "Diff viewer" with `npx shadcn@latest add @haze/diff-viewer`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import DiffViewer from "@/components/haze/ui/diff-viewer.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/diff-viewer.md ### Customize with real content Adapt the Haze diff-viewer ui for our product. Replace the demo values of these props with our real content: id, filename, lines, view. Keep the layout, the heading level rules and these accessibility details: Explicit '+' and '-' markers accompany color fills so additions and deletions never depend on hue alone. Decorative line numbers carry select-none so copying code text skips line gutters. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using diff-viewer, check it fits: use it when reviewing config updates, release diffs, or ai-proposed file changes; inspecting before-and-after code patches inside drawers or pr views. Avoid it when read-only static snippets need no diff markers; use code-block; visual before/after image comparison belongs in compare-slider. Alternatives: @haze/code-block, @haze/compare-slider, @haze/json-viewer. ## Example requests that should lead here - Add a Unified / Split diff viewer showing opaque token updates in haze.tokens.json ## Source ```astro --- import { FileDiff } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface DiffLine { type: "context" | "add" | "del"; oldLine?: number; newLine?: number; content: string; } interface Props { id: string; filename?: string; lines?: DiffLine[]; view?: "unified" | "split"; class?: string; } const { id, filename = "haze.config.ts", view = "unified", lines = [ { type: "context", oldLine: 12, newLine: 12, content: 'radius: "0.4rem",' }, { type: "del", oldLine: 13, content: 'borders: "translucent",' }, { type: "add", newLine: 13, content: 'borders: "opaque",' }, { type: "add", newLine: 14, content: 'lightTheme: true,' }, { type: "context", oldLine: 14, newLine: 15, content: 'icons: "@lucide/astro",' }, ], class: className, } = Astro.props; const additions = lines.filter((l) => l.type === "add").length; const deletions = lines.filter((l) => l.type === "del").length; const leftLines = lines.filter((l) => l.type !== "add"); const rightLines = lines.filter((l) => l.type !== "del"); ---
``` --- # Direction > Sets native writing direction and an optional language for a group of localized content. - Kind: ui · Category: Layout and media · Interactivity: native - Install: `npx shadcn@latest add @haze/direction` - File: `src/components/haze/ui/direction.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/direction ## Use when - A localized view needs right-to-left layout. - One part of a page has a different writing direction from its surroundings. ## Avoid when - The entire page uses one direction and can set it on the HTML element. ## Alternatives - [separator](https://hazeui.com/ui/separator.md) - [scroll-area](https://hazeui.com/ui/scroll-area.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | dir | `"ltr" \| "rtl" \| "auto"` | auto | no | Writing direction for the content. | | lang | `string` | | no | Optional BCP 47 language tag. | | class | `string` | | no | Classes for the content wrapper. | ## Accessibility - The native lang attribute allows assistive technology to choose the appropriate pronunciation. - Use logical spacing and alignment in slotted content. ## Agent prompts ### Install and use Install the Haze UI component "Direction" with `npx shadcn@latest add @haze/direction`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Direction from "@/components/haze/ui/direction.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/direction.md ### Customize with real content Adapt the Haze direction ui for our product. Replace the demo values of these props with our real content: dir, lang, class. Keep the layout, the heading level rules and these accessibility details: The native lang attribute allows assistive technology to choose the appropriate pronunciation. Use logical spacing and alignment in slotted content. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using direction, check it fits: use it when a localized view needs right-to-left layout.; one part of a page has a different writing direction from its surroundings.. Avoid it when the entire page uses one direction and can set it on the html element.. Alternatives: @haze/separator, @haze/scroll-area. ## Example requests that should lead here - Use right-to-left layout for Arabic messages. - Set Hebrew as the language of a small translated summary. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Props { dir?: "ltr" | "rtl" | "auto"; lang?: string; class?: string; } const { dir = "auto", lang, class: className } = Astro.props; ---
``` --- # Donut Chart > Displays the shares of a total as a ring and links its segments to an interactive legend. - Kind: ui · Category: Data display · Interactivity: script - Install: `npx shadcn@latest add @haze/donut-chart` - File: `src/components/haze/ui/donut-chart.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/donut-chart ## Use when - Several named categories make up a single total. - Users need the proportions plus exact values for each category. ## Avoid when - Compare a long list of categories with very similar values. ## Alternatives - [bar-list](https://hazeui.com/ui/bar-list.md) - [stat](https://hazeui.com/ui/stat.md) - [sparkline](https://hazeui.com/ui/sparkline.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | label | `string` | Requests by channel | no | Description of the measured total. | | totalLabel | `string` | Total | no | Label beneath the default center value. | | segments | `Segment[]` | | no | Named nonnegative values with an optional theme tone. | | unit | `string` | | no | Optional suffix for values. | | emptyLabel | `string` | | no | Message shown when no valid segments exist. | | class | `string` | | no | Classes for the chart panel. | ## Accessibility - The legend contains a visible count and share for every segment. - The buttons report selection without relying on ring color. - Key Tab: Move between legend buttons. - Key Enter / Space: Inspect the focused segment or return to the total. ## Agent prompts ### Install and use Install the Haze UI component "Donut Chart" with `npx shadcn@latest add @haze/donut-chart`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import DonutChart from "@/components/haze/ui/donut-chart.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/donut-chart.md ### Customize with real content Adapt the Haze donut-chart ui for our product. Replace the demo values of these props with our real content: label, totalLabel, segments, unit, emptyLabel, class. Keep the layout, the heading level rules and these accessibility details: The legend contains a visible count and share for every segment. The buttons report selection without relying on ring color. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using donut-chart, check it fits: use it when several named categories make up a single total.; users need the proportions plus exact values for each category.. Avoid it when compare a long list of categories with very similar values.. Alternatives: @haze/bar-list, @haze/stat, @haze/sparkline. ## Example requests that should lead here - Show the proportion of requests from direct traffic, search, and referral. - Add a plan distribution chart with selectable legend entries. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; type Tone = "brand" | "success" | "warning" | "destructive" | "neutral"; interface Segment { label: string; value: number; tone?: Tone } interface Props { label?: string; totalLabel?: string; segments?: Segment[]; unit?: string; emptyLabel?: string; class?: string; } const { label = "Requests by channel", totalLabel = "Total", unit = "", emptyLabel = "No requests in this period.", class: className, segments = [ { label: "Direct", value: 842, tone: "brand" }, { label: "Search", value: 385, tone: "success" }, { label: "Referral", value: 197, tone: "warning" }, ], } = Astro.props; const colors = { brand: "stroke-brand bg-brand", success: "stroke-success bg-success", warning: "stroke-warning bg-warning", destructive: "stroke-destructive bg-destructive", neutral: "stroke-muted-foreground bg-muted-foreground", }; const tones: Tone[] = ["brand", "success", "warning", "destructive", "neutral"]; const visible = segments.filter(({ value }) => Number.isFinite(value) && value >= 0); const largest = visible.reduce((max, { value }) => Math.max(max, value), 0); const scaledTotal = largest ? visible.reduce((total, { value }) => total + (value / largest), 0) : 0; const total = scaledTotal * largest; const formatter = new Intl.NumberFormat("en", { maximumFractionDigits: 2 }); const formatted = (value: number) => unit ? `${formatter.format(value)} ${unit}` : formatter.format(value); let offset = 0; const arcs = visible.map((segment, index) => { const percent = largest ? (segment.value / largest) / scaledTotal * 100 : 0; const gap = percent === 100 ? 0 : Math.min(1.25, percent / 5); const arc = { ...segment, index, start: offset + gap / 2, length: percent - gap, percent, tone: segment.tone ?? tones[index % tones.length] }; offset += percent; return arc; }); ---
{label}
{arcs.length ? (
{formatted(total)} {totalLabel}
    {arcs.map(({ label: name, value, percent, tone, index }) => (
  • ))}
) :

{emptyLabel}

}
``` --- # Drawer > Modal panel that slides in from the right, left or bottom edge, with a header, scrolling body and footer, and swipe to dismiss. - Kind: ui · Category: Overlays · Interactivity: script - Install: `npx shadcn@latest add @haze/drawer` - File: `src/components/haze/ui/drawer.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/button, @haze/utils - Docs page: https://hazeui.com/ui/drawer ## Use when - Details of a list row, such as an issue or an order, without leaving the list - Filters or settings with more fields than fit in a popover - A bottom sheet of actions on small screens ## Avoid when - A short yes-or-no confirmation; use dialog - The site's main mobile menu when it only holds links; a popover is lighter - Content people need to see next to the page; a modal drawer blocks the page behind it ## Alternatives - [dialog](https://hazeui.com/ui/dialog.md) - [popover](https://hazeui.com/ui/popover.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique on the page. Buttons target it with commandfor="". | | title | `string` | | yes | Heading; also the drawer's accessible name. | | description | `string` | | no | One line under the title. | | side | `"right" \| "left" \| "bottom"` | "right" | no | Screen edge the panel is attached to. | | trigger | `boolean` | true | no | Set to false when the opening button lives elsewhere. | | triggerLabel | `string` | "Open panel" | no | Trigger text when the trigger slot is not used. | | triggerVariant | `"primary" \| "secondary" \| "outline" \| "ghost"` | "outline" | no | Trigger button style. | | closeLabel | `string` | "Close" | no | Accessible name of the close button; translate it. | | class | `string` | | no | Extra classes on the panel, for example a wider width. | | default slot | `slot` | | no | Body content; it scrolls when it is taller than the panel. | | footer slot | `slot` | | no | Action buttons pinned to the bottom. | | trigger slot | `slot` | | no | Custom trigger content. | ## Accessibility - The panel slides in from its edge over 300 ms and slides out again, and its backdrop fades with it; reduced-motion users get no animation. - Dragging the header toward the edge the panel came from (down for bottom, right for right, left for left) closes it: past 30 % of its size or faster than 0.5 px/ms it dismisses, otherwise it springs back over 200 ms. Reduced-motion users get no follow animation but the same threshold. The swipe is an extra; Escape, the close button and a backdrop click always work. - It is a modal : while it is open the rest of the page cannot be reached by pointer, keyboard or screen reader. - Side panels leave at least 48 px of the page visible, so a tap on the backdrop can always close them. - Only the body scrolls; the title and the footer actions stay in view. - Key Enter / Space: Open the drawer from the trigger - Key Tab / Shift+Tab: Move between controls inside the drawer - Key Escape: Close the drawer and return focus to the trigger ## Agent prompts ### Install and use Install the Haze UI component "Drawer" with `npx shadcn@latest add @haze/drawer`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Drawer from "@/components/haze/ui/drawer.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/drawer.md ### Customize with real content Adapt the Haze drawer ui for our product. Replace the demo values of these props with our real content: id, title, description, side, trigger, triggerLabel, triggerVariant, closeLabel, class, default slot, footer slot, trigger slot. Keep the layout, the heading level rules and these accessibility details: The panel slides in from its edge over 300 ms and slides out again, and its backdrop fades with it; reduced-motion users get no animation. Dragging the header toward the edge the panel came from (down for bottom, right for right, left for left) closes it: past 30 % of its size or faster than 0.5 px/ms it dismisses, otherwise it springs back over 200 ms. Reduced-motion users get no follow animation but the same threshold. The swipe is an extra; Escape, the close button and a backdrop click always work. It is a modal : while it is open the rest of the page cannot be reached by pointer, keyboard or screen reader. Side panels leave at least 48 px of the page visible, so a tap on the backdrop can always close them. Only the body scrolls; the title and the footer actions stay in view. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using drawer, check it fits: use it when details of a list row, such as an issue or an order, without leaving the list; filters or settings with more fields than fit in a popover; a bottom sheet of actions on small screens. Avoid it when a short yes-or-no confirmation; use dialog; the site's main mobile menu when it only holds links; a popover is lighter; content people need to see next to the page; a modal drawer blocks the page behind it. Alternatives: @haze/dialog, @haze/popover. ## Example requests that should lead here - Open issue details in a drawer from the right when a row is clicked - Move the product filters into a bottom drawer on mobile ## Source ```astro --- import { X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Button from "./button.astro"; interface Props { /** Unique on the page. Any button with `command="show-modal" commandfor=""` opens this drawer. */ id: string; title: string; description?: string; /** The screen edge the panel is attached to. */ side?: "right" | "left" | "bottom"; /** Set to false when the opening button lives somewhere else on the page. */ trigger?: boolean; /** Visible trigger text. The "trigger" slot replaces it. */ triggerLabel?: string; triggerVariant?: "primary" | "secondary" | "outline" | "ghost"; closeLabel?: string; class?: string; } const { id, title, description, side = "right", trigger = true, triggerLabel = "Open panel", triggerVariant = "outline", closeLabel = "Close", class: className, } = Astro.props; // The auto margin on one side pushes the modal dialog against the opposite screen edge. const sides = { right: "my-0 ml-auto mr-0 h-dvh max-h-dvh w-[min(24rem,calc(100vw-3rem))] translate-x-full border-l open:translate-x-[var(--haze-drag,0px)] starting:open:translate-x-full", left: "my-0 ml-0 mr-auto h-dvh max-h-dvh w-[min(24rem,calc(100vw-3rem))] -translate-x-full border-r open:translate-x-[var(--haze-drag,0px)] starting:open:-translate-x-full", bottom: "mx-0 mb-0 mt-auto max-h-[85dvh] w-full max-w-none translate-y-full rounded-t-2xl border-t open:translate-y-[var(--haze-drag,0px)] starting:open:translate-y-full", }; --- { trigger && ( ) }
{side === "bottom" && }

{title}

{description &&

{description}

}
{ Astro.slots.has("footer") && (
) }
``` --- # Dropdown menu > Button that opens a short list of links, with group headings, leading icons, trailing hints, a destructive style and one level of submenus. - Kind: ui · Category: Overlays · Interactivity: script - Install: `npx shadcn@latest add @haze/dropdown-menu` - File: `src/components/haze/ui/dropdown-menu.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/button, @haze/utils - Docs page: https://hazeui.com/ui/dropdown-menu ## Use when - An account or workspace menu in a navbar - Three to eight secondary destinations behind one button - A "more" button at the end of a table row or card ## Avoid when - Choosing a form value; use select - Only two actions, which fit as visible buttons - Panels with inputs or rich content; use popover ## Alternatives - [popover](https://hazeui.com/ui/popover.md) - [button](https://hazeui.com/ui/button.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique on the page. Links the trigger to the menu and names the CSS anchor. | | items | `{ label: string; href?: string; hint?: string; destructive?: boolean; separatorBefore?: boolean; heading?: string; icon?: Component; items?: { label: string; href: string; hint?: string; destructive?: boolean; separatorBefore?: boolean; icon?: Component }[] }[]` | | yes | Menu links in order. separatorBefore draws a divider above an item. heading shows a small label above it to start a group. icon is a component such as one from @lucide/astro, drawn before the label. An item with items (and no href) becomes a submenu trigger with a trailing chevron; one level of nesting. | | label | `string` | "Options" | no | Visible trigger text when the trigger slot is not used. | | ariaLabel | `string` | | no | Accessible name for an icon-only trigger. | | variant | `"primary" \| "secondary" \| "outline" \| "ghost"` | "outline" | no | Trigger button style. | | size | `"sm" \| "md" \| "lg" \| "icon"` | "md" | no | Trigger button size. | | triggerClass | `string` | | no | Extra classes on the trigger button. | | align | `"start" \| "end"` | "start" | no | Trigger edge the menu lines up with. | | side | `"bottom" \| "top"` | "bottom" | no | Preferred edge of the trigger, with native viewport collision fallback. | | class | `string` | | no | Menu panel classes. | | trigger slot | `slot` | | no | Custom trigger content, such as a name and a chevron. | | header / actions slots | `slot` | | no | Optional identity header and trailing native action form. | ## Accessibility - This is a disclosure list of links, not an ARIA menu: items are reached with Tab, which needs no script and matches what links do. - Icons are aria-hidden and a heading is plain text above its link, so every link keeps its own name. - The menu scales and fades in over 150 ms and out again through the native popover; reduced-motion users get no animation. - The destructive style only adds color, so the item text itself must say what happens ("Sign out", "Delete project"). - Opening and dismissal work natively. Enhancement adds arrow navigation, typeahead and a moving pointer highlight. - A submenu trigger is a button with aria-haspopup="menu" and aria-expanded; its panel gets role=menu and its links role=menuitem. The root list stays a disclosure of links, so the submenu is the one menu-pattern part. - Without scripting the submenu has no trigger: its links list inline under the submenu label, so every link stays reachable. - A submenu opens on hover after a 100 ms intent delay and closes 200 ms after the pointer leaves the row and the panel, so a diagonal path into the panel keeps it open. It enters with a 4 px slide and fade over 150 ms; reduced-motion users get none. - Key Enter / Space: Open or close the menu from the trigger - Key Tab / Shift+Tab: Move through the menu links - Key ArrowUp / ArrowDown / Home / End: Open from the trigger or move focus between links - Key Letters: Focus a matching link by its visible label - Key ArrowRight / Enter / Space: On a submenu item, open it and focus its first link - Key ArrowLeft / Escape: In a submenu, close it and return focus to its item - Key Escape: Close the menu and return focus to the trigger ## Agent prompts ### Install and use Install the Haze UI component "Dropdown menu" with `npx shadcn@latest add @haze/dropdown-menu`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import DropdownMenu from "@/components/haze/ui/dropdown-menu.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/dropdown-menu.md ### Customize with real content Adapt the Haze dropdown-menu ui for our product. Replace the demo values of these props with our real content: id, items, label, ariaLabel, variant, size, triggerClass, align, side, class, trigger slot, header / actions slots. Keep the layout, the heading level rules and these accessibility details: This is a disclosure list of links, not an ARIA menu: items are reached with Tab, which needs no script and matches what links do. Icons are aria-hidden and a heading is plain text above its link, so every link keeps its own name. The menu scales and fades in over 150 ms and out again through the native popover; reduced-motion users get no animation. The destructive style only adds color, so the item text itself must say what happens ("Sign out", "Delete project"). Opening and dismissal work natively. Enhancement adds arrow navigation, typeahead and a moving pointer highlight. A submenu trigger is a button with aria-haspopup="menu" and aria-expanded; its panel gets role=menu and its links role=menuitem. The root list stays a disclosure of links, so the submenu is the one menu-pattern part. Without scripting the submenu has no trigger: its links list inline under the submenu label, so every link stays reachable. A submenu opens on hover after a 100 ms intent delay and closes 200 ms after the pointer leaves the row and the panel, so a diagonal path into the panel keeps it open. It enters with a 4 px slide and fade over 150 ms; reduced-motion users get none. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using dropdown-menu, check it fits: use it when an account or workspace menu in a navbar; three to eight secondary destinations behind one button; a "more" button at the end of a table row or card. Avoid it when choosing a form value; use select; only two actions, which fit as visible buttons; panels with inputs or rich content; use popover. Alternatives: @haze/popover, @haze/button. ## Example requests that should lead here - Add an account menu with profile, billing and sign out - Put a three-dot menu on each row with edit and delete links ## Source ```astro --- import { ChevronRight } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Button from "./button.astro"; interface SubItem { label: string; href: string; hint?: string; destructive?: boolean; separatorBefore?: boolean; icon?: (props: Record) => unknown; } interface MenuItem { label: string; /** Required for a plain link. Leave it out when the item has `items`. */ href?: string; /** Short trailing text, such as a shortcut or a count. */ hint?: string; destructive?: boolean; /** Draws a divider above this item to start a new group. */ separatorBefore?: boolean; /** Small label shown above this item, to start a group. */ heading?: string; /** An icon component, for example one from @lucide/astro. Decorative. */ icon?: (props: Record) => unknown; /** Makes this item a submenu trigger. One level of nesting. Without scripting the links list inline under the label. */ items?: SubItem[]; } interface Props { /** Unique on the page. Links the trigger to the menu and names the CSS anchor. */ id: string; items: MenuItem[]; /** Visible trigger text. The "trigger" slot replaces it. */ label?: string; /** Accessible name for an icon-only trigger. */ ariaLabel?: string; variant?: "primary" | "secondary" | "outline" | "ghost"; size?: "sm" | "md" | "lg" | "icon"; triggerClass?: string; /** Which trigger edge the menu lines up with. */ align?: "start" | "end"; side?: "bottom" | "top"; class?: string; } const { id, items, label = "Options", ariaLabel, variant = "outline", size = "md", align = "start", side = "bottom", triggerClass, class: className } = Astro.props; // Same recipe as popover.astro: anchored where CSS anchor positioning exists, a centered sheet elsewhere. // The margin on the panel's far side keeps an 8 px gutter when it has to hug the viewport edge. const placement = { "bottom-start": "origin-top-left supports-[position-area:block-end]:me-2 supports-[position-area:block-end]:[position-area:block-end_span-inline-end]", "bottom-end": "origin-top-right supports-[position-area:block-end]:ms-2 supports-[position-area:block-end]:[position-area:block-end_span-inline-start]", "top-start": "origin-bottom-left supports-[position-area:block-end]:me-2 supports-[position-area:block-end]:[position-area:block-start_span-inline-end]", "top-end": "origin-bottom-right supports-[position-area:block-end]:ms-2 supports-[position-area:block-end]:[position-area:block-start_span-inline-start]", }; const itemClass = (destructive?: boolean) => cn( "flex min-h-9 w-full items-center gap-2 rounded-sm px-3 py-1.5 text-start transition-colors duration-75 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring [&_svg]:size-4 [&_svg]:shrink-0", destructive ? "text-destructive hover:bg-destructive/8 focus-visible:bg-destructive/8" : "text-popover-foreground hover:bg-accent focus-visible:bg-accent [&_svg]:text-muted-foreground", ); const headingClass = "px-3 pt-1.5 pb-1 text-[0.6875rem]/4 font-medium tracking-wider text-muted-foreground uppercase"; // A submenu panel is plain inline markup until the script turns it into a popover. The script swaps // the inline classes for the popover classes, so the no-script list needs nothing from the popover set. const subInline = "grid min-h-0 gap-0.5 overflow-hidden ps-3"; const subPanel = cn( "m-auto h-fit max-h-[min(24rem,calc(100dvh-2rem))] w-48 max-w-[calc(100vw-1rem)] overflow-y-auto rounded-lg border border-border bg-popover p-1 text-[0.8125rem] text-popover-foreground shadow-float", "-translate-x-1 opacity-0 transition-[opacity,translate,overlay,display] transition-discrete duration-150 ease-snappy open:translate-x-0 open:opacity-100 starting:open:-translate-x-1 starting:open:opacity-0 motion-reduce:transition-none", // The script picks the side (data-side) so the panel never covers its trigger row; it falls back to inline mode when neither side fits. "supports-[position-area:inline-end]:m-0 supports-[position-area:inline-end]:-mt-1 supports-[position-area:inline-end]:ms-0.5 supports-[position-area:inline-end]:me-2 supports-[position-area:inline-end]:[position-area:inline-end_span-block-end] supports-[position-area:inline-end]:[position-try-fallbacks:flip-block] supports-[position-area:inline-end]:data-[side=left]:ms-2 supports-[position-area:inline-end]:data-[side=left]:me-0.5 supports-[position-area:inline-end]:data-[side=left]:[position-area:inline-start_span-block-end]", ); // Below 640 px, or when neither side has room, the submenu opens inline under its trigger and the menu grows. const subInlinePanel = "grid grid-rows-[0fr] transition-[grid-template-rows] duration-150 ease-snappy data-[open]:grid-rows-[1fr] motion-reduce:transition-none"; ---
``` --- # Elastic slider > A native slider with a yielding track, live value and keyboard reachable preset stops. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/elastic-slider` - File: `src/components/haze/ui/elastic-slider.astro` - npm dependencies: none - Registry dependencies: @haze/slider, @haze/utils - Docs page: https://hazeui.com/ui/elastic-slider ## Use when - Volume, intensity or a similar continuous setting benefits from subtle resistance at the limits. - A few common values should be reachable directly as named presets. ## Avoid when - Use slider for a plain compact range without preset buttons. - Use range-slider when users choose both bounds of an interval. ## Alternatives - [slider](https://hazeui.com/ui/slider.md) - [range-slider](https://hazeui.com/ui/range-slider.md) - [ruler-slider](https://hazeui.com/ui/ruler-slider.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique caller supplied prefix for the control and its associated content. | | name | `string` | id | no | Name submitted by the native form control. | | label | `string` | Playback volume | no | Visible label for the range input. | | min | `number` | 0 | no | Lower bound of the domain. | | max | `number` | 100 | no | Upper bound of the domain. | | step | `number` | 1 | no | Native range increment. | | value | `number` | 60 | no | Initial setting, clamped to the supplied domain. | | unit | `string` | % | no | Suffix used in the readout and accessible value. | | marks | `{ value: number; label: string }[]` | Mute / Half / Full | no | Named native datalist stops with enhanced shortcut buttons. | | disabled | `boolean` | false | no | Prevents user changes through the native disabled state. | | class | `string` | | no | Additional classes on this component's outer wrapper. | | [key: string] | `unknown` | | no | Other native range attributes are passed through to Slider. | ## Accessibility - The real range input remains the only slider and provides native keyboard behavior and forced color support. - The datalist works without enhancement; preset buttons are enabled only after their handlers are ready. - The visible readout is hidden from assistive technology because aria-valuetext supplies the same value with its unit. - Track displacement is capped at eight pixels and is skipped for reduced motion; cancellation releases the transient displacement. - Key Arrows / Home / End: Adjust the native range or reach either end. - Key Tab, Enter / Space: Focus and apply one of the named stops. ## Agent prompts ### Install and use Install the Haze UI component "Elastic slider" with `npx shadcn@latest add @haze/elastic-slider`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ElasticSlider from "@/components/haze/ui/elastic-slider.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/elastic-slider.md ### Customize with real content Adapt the Haze elastic-slider ui for our product. Replace the demo values of these props with our real content: id, name, label, min, max, step, value, unit, marks, disabled, class, [key: string]. Keep the layout, the heading level rules and these accessibility details: The real range input remains the only slider and provides native keyboard behavior and forced color support. The datalist works without enhancement; preset buttons are enabled only after their handlers are ready. The visible readout is hidden from assistive technology because aria-valuetext supplies the same value with its unit. Track displacement is capped at eight pixels and is skipped for reduced motion; cancellation releases the transient displacement. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using elastic-slider, check it fits: use it when volume, intensity or a similar continuous setting benefits from subtle resistance at the limits.; a few common values should be reachable directly as named presets.. Avoid it when use slider for a plain compact range without preset buttons.; use range-slider when users choose both bounds of an interval.. Alternatives: @haze/slider, @haze/range-slider, @haze/ruler-slider. ## Example requests that should lead here - Add a listening volume control with Mute, Half and Full presets - Use an elastic native slider for playback intensity ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; import Slider from "./slider.astro"; interface Props { id: string; name?: string; label?: string; min?: number; max?: number; step?: number; value?: number; unit?: string; marks?: { value: number; label: string }[]; disabled?: boolean; class?: string; [key: string]: unknown; } const { id, name = id, label = "Playback volume", min = 0, max = 100, step = 1, value = 60, unit = "%", marks = [{ value: 0, label: "Mute" }, { value: 50, label: "Half" }, { value: 100, label: "Full" }], disabled, class: className, ...rest } = Astro.props; const floor = Number.isFinite(min) ? min : 0; const ceiling = Number.isFinite(max) && max > floor ? max : floor + 100; const increment = Number.isFinite(step) && step > 0 ? step : 1; const initial = Number.isFinite(value) ? Math.max(floor, Math.min(ceiling, value)) : floor; const stops = marks.filter((mark) => Number.isFinite(mark.value) && mark.value >= floor && mark.value <= ceiling); ---
{stops.map((mark) =>
{stops.map((mark) => )}
``` --- # Emoji picker > Search a configurable emoji list with categories, session recents and skin tones, backed by a native select. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/emoji-picker` - File: `src/components/haze/ui/emoji-picker.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/emoji-picker ## Use when - A status or update form needs a compact searchable set of named emoji. - Products should control the emoji vocabulary while keeping a native selection fallback. ## Avoid when - Use reactions for a small fixed collection of independent acknowledgments. - Use select when only a few textual status choices are necessary. ## Alternatives - [reactions](https://hazeui.com/ui/reactions.md) - [select](https://hazeui.com/ui/select.md) - [combobox](https://hazeui.com/ui/combobox.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique caller supplied prefix for the control and its associated content. | | name | `string` | id | no | Name submitted by the native form control. | | label | `string` | Choose an emoji | no | Legend describing the emoji selection. | | value | `string` | Empty | no | Initially selected emoji string. | | items | `{ emoji: string; label: string; category: string; keywords?: string; tones?: string[] }[]` | 22 curated emoji | no | Searchable vocabulary; tones lists the five standard skin variations when supported. | | disabled | `boolean` | false | no | Prevents user changes through the native disabled state. | | class | `string` | | no | Additional classes on this component's outer wrapper. | | [key: string] | `unknown` | | no | Additional attributes applied to the submitted native select. | ## Accessibility - The native select is labelled and stays available before and after enhancement, so the selected Unicode value always submits normally. - Search filters by label, keywords and emoji, and a polite region reports matching counts and selections. - The emoji buttons form a labelled group with one Tab stop; arrow keys, Home and End navigate the visible buttons. - Category selection is expressed with pressed state and skin tone uses a labelled native select; variants are only offered for supplied supported gestures. - Recent choices are held only in this component's session, and the default curated list is intentionally smaller than the full Unicode emoji catalog. - Key Down from search: Focus the first matching emoji. - Key Arrows / Home / End: Move among visible emoji choices. - Key Enter / Space: Select the focused emoji. - Key Escape in search: Clear a nonempty query without closing a surrounding overlay. ## Agent prompts ### Install and use Install the Haze UI component "Emoji picker" with `npx shadcn@latest add @haze/emoji-picker`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import EmojiPicker from "@/components/haze/ui/emoji-picker.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/emoji-picker.md ### Customize with real content Adapt the Haze emoji-picker ui for our product. Replace the demo values of these props with our real content: id, name, label, value, items, disabled, class, [key: string]. Keep the layout, the heading level rules and these accessibility details: The native select is labelled and stays available before and after enhancement, so the selected Unicode value always submits normally. Search filters by label, keywords and emoji, and a polite region reports matching counts and selections. The emoji buttons form a labelled group with one Tab stop; arrow keys, Home and End navigate the visible buttons. Category selection is expressed with pressed state and skin tone uses a labelled native select; variants are only offered for supplied supported gestures. Recent choices are held only in this component's session, and the default curated list is intentionally smaller than the full Unicode emoji catalog. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using emoji-picker, check it fits: use it when a status or update form needs a compact searchable set of named emoji.; products should control the emoji vocabulary while keeping a native selection fallback.. Avoid it when use reactions for a small fixed collection of independent acknowledgments.; use select when only a few textual status choices are necessary.. Alternatives: @haze/reactions, @haze/select, @haze/combobox. ## Example requests that should lead here - Add a searchable project status emoji picker with named categories - Offer a configurable emoji vocabulary with native select fallback and gesture skin tones ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Emoji { emoji: string; label: string; category: string; keywords?: string; tones?: string[]; } interface Props { id: string; name?: string; label?: string; value?: string; items?: Emoji[]; disabled?: boolean; class?: string; [key: string]: unknown; } const { id, name = id, label = "Choose an emoji", value = "", items = [ { emoji: "😀", label: "Grinning face", category: "Faces", keywords: "happy smile" }, { emoji: "😊", label: "Smiling face", category: "Faces", keywords: "happy kind" }, { emoji: "😂", label: "Tears of joy", category: "Faces", keywords: "laugh funny" }, { emoji: "🤔", label: "Thinking face", category: "Faces", keywords: "consider question" }, { emoji: "😎", label: "Smiling face with sunglasses", category: "Faces", keywords: "cool" }, { emoji: "🥳", label: "Partying face", category: "Faces", keywords: "celebrate" }, { emoji: "👍", label: "Thumbs up", category: "Gestures", keywords: "like approve helpful", tones: ["👍🏻", "👍🏼", "👍🏽", "👍🏾", "👍🏿"] }, { emoji: "👋", label: "Waving hand", category: "Gestures", keywords: "hello goodbye", tones: ["👋🏻", "👋🏼", "👋🏽", "👋🏾", "👋🏿"] }, { emoji: "👏", label: "Clapping hands", category: "Gestures", keywords: "applause well done", tones: ["👏🏻", "👏🏼", "👏🏽", "👏🏾", "👏🏿"] }, { emoji: "🙏", label: "Folded hands", category: "Gestures", keywords: "thanks please", tones: ["🙏🏻", "🙏🏼", "🙏🏽", "🙏🏾", "🙏🏿"] }, { emoji: "💛", label: "Yellow heart", category: "Symbols", keywords: "love care" }, { emoji: "✨", label: "Sparkles", category: "Symbols", keywords: "new magic" }, { emoji: "✅", label: "Check mark", category: "Symbols", keywords: "done complete" }, { emoji: "💡", label: "Light bulb", category: "Symbols", keywords: "idea" }, { emoji: "🔥", label: "Fire", category: "Symbols", keywords: "popular" }, { emoji: "🎉", label: "Party popper", category: "Symbols", keywords: "celebration launch" }, { emoji: "🌿", label: "Herb", category: "Nature", keywords: "plant calm" }, { emoji: "🌻", label: "Sunflower", category: "Nature", keywords: "flower" }, { emoji: "🌈", label: "Rainbow", category: "Nature", keywords: "weather" }, { emoji: "🌙", label: "Crescent moon", category: "Nature", keywords: "night" }, { emoji: "☀️", label: "Sun", category: "Nature", keywords: "day bright" }, { emoji: "🌱", label: "Seedling", category: "Nature", keywords: "growth" }, ], disabled, class: className, ...rest } = Astro.props; const categories = [...new Set(items.map((item) => item.category))]; ---
{label}

{items.length} emoji available. Supply your own list to extend the picker.

``` --- # Empty > Centered empty state with an icon chip, title, description and action buttons, inside a dashed frame that you can turn off. - Kind: ui · Category: Feedback · Interactivity: none - Install: `npx shadcn@latest add @haze/empty` - File: `src/components/haze/ui/empty.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/empty ## Use when - A new project, inbox or table with no rows yet, where the next step is one click away - Search or filter results that came back empty - A heading level that must fit the page outline, not always h3 ## Avoid when - An error the reader caused or can retry; use alert - A section still loading; use skeleton or spinner ## Alternatives - [alert](https://hazeui.com/ui/alert.md) - [skeleton](https://hazeui.com/ui/skeleton.md) - [placeholder](https://hazeui.com/ui/placeholder.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | title | `string` | | yes | Short heading, such as "No invoices yet". | | description | `string` | | no | One or two sentences on why it is empty and what to do. | | headingLevel | `2 \| 3 \| 4` | 3 | no | Tag of the title, so it fits the heading outline around it. | | class | `string` | | no | Extra classes on the box. | | framed | `boolean` | true | no | Draws the dashed frame and its padding. Set it to false inside a card or table that already has a border. | | icon | `slot` | | no | A Lucide icon, shown in a 44 px rounded chip that is hidden from assistive technology. | | default slot | `slot` | | no | Action buttons or links under the text. | ## Accessibility - The title is a real heading whose level you choose, so the empty state sits correctly in the page outline. - The icon chip is aria-hidden; the title and description carry the whole message. - Tell the reader what to do next in the description, and make the first action a real button or link in the default slot. ## Agent prompts ### Install and use Install the Haze UI component "Empty" with `npx shadcn@latest add @haze/empty`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Empty from "@/components/haze/ui/empty.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/empty.md ### Customize with real content Adapt the Haze empty ui for our product. Replace the demo values of these props with our real content: title, description, headingLevel, class, framed, icon, default slot. Keep the layout, the heading level rules and these accessibility details: The title is a real heading whose level you choose, so the empty state sits correctly in the page outline. The icon chip is aria-hidden; the title and description carry the whole message. Tell the reader what to do next in the description, and make the first action a real button or link in the default slot. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using empty, check it fits: use it when a new project, inbox or table with no rows yet, where the next step is one click away; search or filter results that came back empty; a heading level that must fit the page outline, not always h3. Avoid it when an error the reader caused or can retry; use alert; a section still loading; use skeleton or spinner. Alternatives: @haze/alert, @haze/skeleton, @haze/placeholder. ## Example requests that should lead here - Show an empty state for a projects list with a Create project button - Add a no results box with a Clear filters link under an h2 ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Props { title: string; description?: string; headingLevel?: 2 | 3 | 4; /** Draws the dashed frame and its padding. Turn it off when the empty state already sits inside a panel. */ framed?: boolean; class?: string; } const { title, description, headingLevel = 3, framed = true, class: className } = Astro.props; const Heading = ({ 2: "h2", 3: "h3", 4: "h4" } as const)[headingLevel]; const hasIcon = Astro.slots.has("icon"); const hasActions = Astro.slots.has("default"); ---
{ hasIcon && ( ) } {title} {description &&

{description}

} {hasActions &&
}
``` --- # Expandable card > A native details card with a compact summary, animated disclosure and a slot for additional content. - Kind: ui · Category: Layout and media · Interactivity: native - Install: `npx shadcn@latest add @haze/expandable-card` - File: `src/components/haze/ui/expandable-card.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/expandable-card ## Use when - A card needs to keep its main information readable while making secondary details available on demand. - Expanded content belongs in the current document flow and should work without client code. ## Avoid when - Use accordion for a coordinated set of repeated question and answer rows. - Use dialog when opening the details must move focus into a modal task. ## Alternatives - [accordion](https://hazeui.com/ui/accordion.md) - [card](https://hazeui.com/ui/card.md) - [dialog](https://hazeui.com/ui/dialog.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique caller supplied prefix for the control and its associated content. | | title | `string` | Workspace retention | no | Heading in the disclosure summary. | | description | `string` | Keep the details close without crowding the page. | no | Short secondary description beside the disclosure chevron. | | headingLevel | `2 \| 3 \| 4` | 3 | no | Heading level appropriate to the containing page. | | open | `boolean` | false | no | Whether the native disclosure starts expanded. | | class | `string` | | no | Additional classes on this component's outer wrapper. | ## Accessibility - The summary is the native disclosure control, so the browser exposes expanded state and manages the closed content. - The summary target spans the full card header and its focus outline stays inside the card's clipped edge. - Supported browsers interpolate the details panel height; other browsers animate only the appearing content and the theme disables both paths for reduced motion. - The caller selects the summary heading level and can put normal links or form controls inside the default content slot. - Key Enter / Space: Expand or collapse the focused card summary. - Key Tab: Reach expanded links and controls after the summary. ## Agent prompts ### Install and use Install the Haze UI component "Expandable card" with `npx shadcn@latest add @haze/expandable-card`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ExpandableCard from "@/components/haze/ui/expandable-card.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/expandable-card.md ### Customize with real content Adapt the Haze expandable-card ui for our product. Replace the demo values of these props with our real content: id, title, description, headingLevel, open, class. Keep the layout, the heading level rules and these accessibility details: The summary is the native disclosure control, so the browser exposes expanded state and manages the closed content. The summary target spans the full card header and its focus outline stays inside the card's clipped edge. Supported browsers interpolate the details panel height; other browsers animate only the appearing content and the theme disables both paths for reduced motion. The caller selects the summary heading level and can put normal links or form controls inside the default content slot. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using expandable-card, check it fits: use it when a card needs to keep its main information readable while making secondary details available on demand.; expanded content belongs in the current document flow and should work without client code.. Avoid it when use accordion for a coordinated set of repeated question and answer rows.; use dialog when opening the details must move focus into a modal task.. Alternatives: @haze/accordion, @haze/card, @haze/dialog. ## Example requests that should lead here - Put workspace retention details inside an expandable native card - Add a compact project summary that reveals a link and longer explanation ## Source ```astro --- import { ChevronDown } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id: string; title?: string; description?: string; headingLevel?: 2 | 3 | 4; open?: boolean; class?: string; } const { id, title = "Workspace retention", description = "Keep the details close without crowding the page.", headingLevel = 3, open = false, class: className } = Astro.props; const Heading = ({ 2: "h2", 3: "h3", 4: "h4" } as const)[headingLevel]; const slide = "supports-[interpolate-size:allow-keywords]:[interpolate-size:allow-keywords] supports-[interpolate-size:allow-keywords]:details-content:h-0 supports-[interpolate-size:allow-keywords]:details-content:overflow-clip supports-[interpolate-size:allow-keywords]:details-content:transition-[height,content-visibility] supports-[interpolate-size:allow-keywords]:details-content:transition-discrete supports-[interpolate-size:allow-keywords]:details-content:duration-300 supports-[interpolate-size:allow-keywords]:details-content:ease-snappy supports-[interpolate-size:allow-keywords]:open:details-content:h-auto"; ---
{title}{description}

Archived projects stay available for 90 days. Workspace owners can export a copy before the retention period ends.

``` --- # Expandable text > Clamp long text to a few lines and animate the full passage into view with a disclosure button. - Kind: ui · Category: Layout and media · Interactivity: script - Install: `npx shadcn@latest add @haze/expandable-text` - File: `src/components/haze/ui/expandable-text.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/expandable-text ## Use when - A description may use several more lines than the surrounding card. - Short text should stay just as it was when no disclosure is needed. ## Avoid when - Use Accordion for several independent sections. ## Alternatives - [collapsible](https://hazeui.com/ui/collapsible.md) - [accordion](https://hazeui.com/ui/accordion.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | ID for the controlled passage. | | text | `string` | | no | Plain text passage. | | lines | `number` | | no | Number of visible lines when collapsed. | | expandLabel | `string` | | no | Label for expanding. | | collapseLabel | `string` | | no | Label for collapsing. | | class | `string` | | no | Classes for the wrapper. | ## Accessibility - The control announces whether the full passage is expanded. - Without JavaScript the full text is visible. - Key Keyboard: Enter or Space toggles the full passage. ## Agent prompts ### Install and use Install the Haze UI component "Expandable text" with `npx shadcn@latest add @haze/expandable-text`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ExpandableText from "@/components/haze/ui/expandable-text.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/expandable-text.md ### Customize with real content Adapt the Haze expandable-text ui for our product. Replace the demo values of these props with our real content: id, text, lines, expandLabel, collapseLabel, class. Keep the layout, the heading level rules and these accessibility details: The control announces whether the full passage is expanded. Without JavaScript the full text is visible. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using expandable-text, check it fits: use it when a description may use several more lines than the surrounding card.; short text should stay just as it was when no disclosure is needed.. Avoid it when use accordion for several independent sections.. Alternatives: @haze/collapsible, @haze/accordion. ## Example requests that should lead here - Show the first two lines of each release summary with a Read more button only where needed. ## Source ```astro --- import { ChevronDown } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id: string; text?: string; lines?: number; expandLabel?: string; collapseLabel?: string; class?: string; } const { id, text = "The team can now schedule weekly exports from any saved report. In the export menu, choose the columns you need, pick a delivery day, and save the schedule. People who already receive the report continue to receive the same file until you update the schedule.", lines = 3, expandLabel = "Read more", collapseLabel = "Show less", class: className } = Astro.props; const shortLines = Number.isFinite(lines) ? Math.max(1, Math.floor(lines)) : 3; ---

{text}

``` --- # Expanding button group > A compact icon action tray that slides open a label on hover or keyboard focus. - Kind: ui · Category: Actions · Interactivity: script - Install: `npx shadcn@latest add @haze/expanding-button-group` - File: `src/components/haze/ui/expanding-button-group.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/expanding-button-group ## Use when - Space is limited but the available actions still need names. - The label should reveal itself beside its icon on focus. ## Avoid when - Use a regular Button Group when all labels should stay visible. ## Alternatives - [button-group](https://hazeui.com/ui/button-group.md) - [floating-button-group](https://hazeui.com/ui/floating-button-group.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | label | `string` | | no | Accessible group name. | | actions | `Action[]` | | no | Label, icon and optional link destination, submit name and value, or disabled state. | | class | `string` | | no | Classes for the outer tray. | ## Accessibility - Every action has an accessible name in its compact state. - Only motion-safe contexts animate the label width. - Key Keyboard: Tab focuses each action and reveals its label. Enter activates the focused link or button. ## Agent prompts ### Install and use Install the Haze UI component "Expanding button group" with `npx shadcn@latest add @haze/expanding-button-group`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ExpandingButtonGroup from "@/components/haze/ui/expanding-button-group.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/expanding-button-group.md ### Customize with real content Adapt the Haze expanding-button-group ui for our product. Replace the demo values of these props with our real content: label, actions, class. Keep the layout, the heading level rules and these accessibility details: Every action has an accessible name in its compact state. Only motion-safe contexts animate the label width. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using expanding-button-group, check it fits: use it when space is limited but the available actions still need names.; the label should reveal itself beside its icon on focus.. Avoid it when use a regular button group when all labels should stay visible.. Alternatives: @haze/button-group, @haze/floating-button-group. ## Example requests that should lead here - Show a compact release toolbar whose labels expand as each action receives focus. ## Source ```astro --- import { Download, Link, Share2 } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; type Action = { label: string; icon: (props: Record) => unknown; href?: string; name?: string; value?: string; disabled?: boolean; }; interface Props { label?: string; actions?: Action[]; class?: string; } const defaultActions: Action[] = [ { label: "Share", icon: Share2, href: "#share" }, { label: "Copy link", icon: Link, href: "#link" }, { label: "Export", icon: Download, href: "#export" }, ]; const { label = "Project actions", actions = defaultActions, class: className } = Astro.props; const actionClass = "group/action inline-grid h-8 min-w-8 max-w-full grid-cols-[1.125rem_0fr] items-center rounded-sm border border-transparent px-2 text-[0.8125rem]/5 font-medium text-muted-foreground select-none motion-safe:transition-[grid-template-columns,background-color,color] motion-safe:duration-200 motion-safe:ease-snappy focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring data-[expanded]:grid-cols-[1.125rem_1fr] data-[expanded]:border-frame data-[expanded]:bg-background data-[expanded]:shadow-key data-[expanded]:text-foreground group-data-[enhanced=false]/rail:hover:grid-cols-[1.125rem_1fr] group-data-[enhanced=false]/rail:focus-visible:grid-cols-[1.125rem_1fr] aria-disabled:opacity-50 disabled:opacity-50"; ---
{actions.map(({ label: text, icon: Icon, href, name, value, disabled }) => { const Action = href && !disabled ? "a" : "button"; return ( ); })}
``` --- # Expanding search > A compact search trigger expands into a GET form with optional filterable page links. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/expanding-search` - File: `src/components/haze/ui/expanding-search.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/input, @haze/utils - Docs page: https://hazeui.com/ui/expanding-search ## Use when - Search should stay compact until someone opens it. - A small local list can guide visitors to known pages. ## Avoid when - Use Combobox to choose a value rather than following a link. ## Alternatives - [search-field](https://hazeui.com/ui/search-field.md) - [command-menu](https://hazeui.com/ui/command-menu.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique search field ID. | | label | `string` | | no | Accessible label for the search. | | name | `string` | | no | Query parameter sent by the form. | | placeholder | `string` | | no | Field hint. | | action | `string` | | no | Destination for the GET form. | | results | `Result[]` | | no | Optional links to filter as the visitor types. | | emptyMessage | `string` | | no | Message when no link matches the query. | | class | `string` | | no | Classes for the disclosure surface. | ## Accessibility - A native disclosure opens the search form without JavaScript. - Filtering keeps results as regular links. - Key Keyboard: Enter or Space opens search. Arrow Down focuses the first matching result. Escape closes and returns focus. ## Agent prompts ### Install and use Install the Haze UI component "Expanding search" with `npx shadcn@latest add @haze/expanding-search`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ExpandingSearch from "@/components/haze/ui/expanding-search.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/expanding-search.md ### Customize with real content Adapt the Haze expanding-search ui for our product. Replace the demo values of these props with our real content: id, label, name, placeholder, action, results, emptyMessage, class. Keep the layout, the heading level rules and these accessibility details: A native disclosure opens the search form without JavaScript. Filtering keeps results as regular links. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using expanding-search, check it fits: use it when search should stay compact until someone opens it.; a small local list can guide visitors to known pages.. Avoid it when use combobox to choose a value rather than following a link.. Alternatives: @haze/search-field, @haze/command-menu. ## Example requests that should lead here - Make a search icon expand to a field with matching documentation links below. ## Source ```astro --- import { Search, X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Input from "./input.astro"; interface Result { label: string; href: string; detail?: string; } interface Props { id: string; label?: string; placeholder?: string; name?: string; action?: string; results?: Result[]; emptyMessage?: string; class?: string; } const { id, label = "Search", placeholder = "Find a page", name = "q", action = "/browse", results = [], emptyMessage = "No matching pages.", class: className } = Astro.props; ---
{results.length > 0 && (
)}
``` --- # Field > Form row that stacks a label, the control you pass in, optional help text and an error message. - Kind: ui · Category: Forms · Interactivity: none - Install: `npx shadcn@latest add @haze/field` - File: `src/components/haze/ui/field.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/label, @haze/utils - Docs page: https://hazeui.com/ui/field ## Use when - Any labelled control in a form: input, textarea, select or slider - Showing a validation error next to the control it belongs to - Help text that explains a format or a consequence ## Avoid when - A single checkbox or switch, where the label sits beside the control - A search box whose label is visually hidden ## Alternatives - [label](https://hazeui.com/ui/label.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | The id of the control in the slot. Help text gets -description, the error -error. | | label | `string` | | yes | Visible label text. | | description | `string` | | no | Help text under the control. | | error | `string` | | no | Error message; rendered with an icon in the destructive color. | | required | `boolean` | false | no | Adds the asterisk to the label. | | class | `string` | | no | Extra classes on the wrapper. | | default slot | `slot` | | yes | One form control whose id equals the id prop. | ## Accessibility - Point the control at the texts yourself: aria-describedby="-description -error", and aria-invalid="true" when there is an error. - The error line has an icon as well as color, so it does not rely on color alone (WCAG 1.4.1). - Write errors that say how to fix the value, not only that it is wrong (WCAG 3.3.3). ## Agent prompts ### Install and use Install the Haze UI component "Field" with `npx shadcn@latest add @haze/field`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Field from "@/components/haze/ui/field.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/field.md ### Customize with real content Adapt the Haze field ui for our product. Replace the demo values of these props with our real content: id, label, description, error, required, class, default slot. Keep the layout, the heading level rules and these accessibility details: Point the control at the texts yourself: aria-describedby="-description -error", and aria-invalid="true" when there is an error. The error line has an icon as well as color, so it does not rely on color alone (WCAG 1.4.1). Write errors that say how to fix the value, not only that it is wrong (WCAG 3.3.3). Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using field, check it fits: use it when any labelled control in a form: input, textarea, select or slider; showing a validation error next to the control it belongs to; help text that explains a format or a consequence. Avoid it when a single checkbox or switch, where the label sits beside the control; a search box whose label is visually hidden. Alternatives: @haze/label. ## Example requests that should lead here - Wrap the email input in a field with help text - Show a validation error under the team URL input ## Source ```astro --- import { CircleAlert } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Label from "./label.astro"; interface Props { /** The id of the control in the slot. The help text gets `-description` and the error `-error`. */ id: string; label: string; description?: string; error?: string; required?: boolean; class?: string; } const { id, label, description, error, required = false, class: className } = Astro.props; ---
{description &&

{description}

} { error && (

) }
``` --- # Fieldset > Native fieldset container with legend, optional description, card framing, and automatic disabled propagation. - Kind: ui · Category: Forms · Interactivity: native - Install: `npx shadcn@latest add @haze/fieldset` - File: `src/components/haze/ui/fieldset.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/fieldset ## Use when - Grouping related address, billing, or profile fields under a shared accessible legend - Disabling an entire form section at once while keeping its description legible - Separating multi-section settings forms into crisp card panels ## Avoid when - Wrapping a single form control and label; use field instead - Exclusive radio choices; use radio-group which supplies its own legend and items ## Alternatives - [field](https://hazeui.com/ui/field.md) - [frame](https://hazeui.com/ui/frame.md) - [radio-group](https://hazeui.com/ui/radio-group.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | legend | `string` | | yes | Accessible group heading rendered as the semantic . | | description | `string` | | no | Supporting helper text displayed beneath the legend. | | disabled | `boolean` | false | no | Disables every native control inside the fieldset without dimming the description. | | variant | `"plain" \| "card"` | "plain" | no | plain spaces controls without borders; card wraps the group in an elevated hairline surface. | | class | `string` | | no | Extra classes on the
. | ## Accessibility - Emits a native
and so assistive technologies announce the section context for every child input. - Setting disabled disables descendant controls natively while preserving legend and helper text contrast. - Key Tab: Moves focus through enabled controls inside the fieldset, skipping the whole section when disabled ## Agent prompts ### Install and use Install the Haze UI component "Fieldset" with `npx shadcn@latest add @haze/fieldset`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Fieldset from "@/components/haze/ui/fieldset.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/fieldset.md ### Customize with real content Adapt the Haze fieldset ui for our product. Replace the demo values of these props with our real content: legend, description, disabled, variant, class. Keep the layout, the heading level rules and these accessibility details: Emits a native
and so assistive technologies announce the section context for every child input. Setting disabled disables descendant controls natively while preserving legend and helper text contrast. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using fieldset, check it fits: use it when grouping related address, billing, or profile fields under a shared accessible legend; disabling an entire form section at once while keeping its description legible; separating multi-section settings forms into crisp card panels. Avoid it when wrapping a single form control and label; use field instead; exclusive radio choices; use radio-group which supplies its own legend and items. Alternatives: @haze/field, @haze/frame, @haze/radio-group. ## Example requests that should lead here - Group company name and tax ID fields inside a card Fieldset labeled Billing address - Wrap locked workspace settings in a disabled Fieldset ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Props { /** Legend heading associating all grouped controls inside the native fieldset. */ legend: string; /** Optional helper copy displayed under the legend. */ description?: string; /** Disables every descendant native form control inside this fieldset. */ disabled?: boolean; /** plain renders unboxed vertical stack spacing; card frames the fieldset inside a hairline card. */ variant?: "plain" | "card"; class?: string; [key: string]: unknown; } const { legend, description, disabled = false, variant = "plain", class: className, ...rest } = Astro.props; ---
{legend} {description &&

{description}

}
``` --- # File Input > A compact native file control with a label, file type hint, and browser-managed selection. - Kind: ui · Category: Forms · Interactivity: native - Install: `npx shadcn@latest add @haze/file-input` - File: `src/components/haze/ui/file-input.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/file-input ## Use when - A normal form needs a file attachment. - A large drop zone takes too much space in a tight form. ## Avoid when - Users need a drop zone and a removable file list. ## Alternatives - [file-upload](https://hazeui.com/ui/file-upload.md) - [field](https://hazeui.com/ui/field.md) - [input](https://hazeui.com/ui/input.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique native input ID. | | name | `string` | id | no | Submitted field name. | | label | `string` | Attach a file | no | Visible input label. | | hint | `string` | | no | Short description of accepted files. | | accept | `string` | | no | Native file chooser type filter. | | multiple | `boolean` | | no | Allow multiple files. | | required | `boolean` | | no | Require at least one file. | | disabled | `boolean` | | no | Disable the control. | | class | `string` | | no | Classes for the field wrapper. | ## Accessibility - The native chooser and file names work without JavaScript. - When a hint is supplied it is linked to the input. - Key Tab: Focus the file input. - Key Enter / Space: Open the operating system file chooser. ## Agent prompts ### Install and use Install the Haze UI component "File Input" with `npx shadcn@latest add @haze/file-input`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import FileInput from "@/components/haze/ui/file-input.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/file-input.md ### Customize with real content Adapt the Haze file-input ui for our product. Replace the demo values of these props with our real content: id, name, label, hint, accept, multiple, required, disabled, class. Keep the layout, the heading level rules and these accessibility details: The native chooser and file names work without JavaScript. When a hint is supplied it is linked to the input. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using file-input, check it fits: use it when a normal form needs a file attachment.; a large drop zone takes too much space in a tight form.. Avoid it when users need a drop zone and a removable file list.. Alternatives: @haze/file-upload, @haze/field, @haze/input. ## Example requests that should lead here - Add a compact attachment field to a project form. - Collect a PDF résumé with a native file input. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Props { id: string; name?: string; label?: string; hint?: string; accept?: string; multiple?: boolean; required?: boolean; disabled?: boolean; class?: string; [key: string]: unknown; } const { id, name = id, label = "Attach a file", hint, accept, multiple, required, disabled, class: className, "aria-describedby": describedBy, ...rest } = Astro.props; const ids = [hint && `${id}-hint`, typeof describedBy === "string" && describedBy].filter(Boolean).join(" ") || undefined; ---
{hint &&

{hint}

}
``` --- # File tree > Native folder disclosures with optional nested folders and ordinary file links. - Kind: ui · Category: Navigation · Interactivity: native - Install: `npx shadcn@latest add @haze/file-tree` - File: `src/components/haze/ui/file-tree.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/file-tree ## Use when - Docs show a project structure with expandable directories - File entries are either descriptive names or regular links ## Avoid when - The feature needs file editing or a full tree widget with application keyboard shortcuts. - A flat list is easier to read. Use item. ## Alternatives - [collapsible](https://hazeui.com/ui/collapsible.md) - [item](https://hazeui.com/ui/item.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | name | `string` | "Project files" | no | Visible folder name. | | files | `{ name: string; href?: string; current?: boolean }[]` | | no | Files in the folder. An href makes a file a link. | | open | `boolean` | false | no | Opens the folder initially. | | default slot | `slot` | | no | Place child FileTree components here to nest folders. | | class | `string` | | no | Additional classes on the folder disclosure. | ## Accessibility - Folders use native summaries and expose their expanded state. File links behave like links. - Use current only on the file whose link points to the current page. - Key Tab: Move among visible folders and file links. - Key Enter or Space: Toggle the focused folder. ## Agent prompts ### Install and use Install the Haze UI component "File tree" with `npx shadcn@latest add @haze/file-tree`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import FileTree from "@/components/haze/ui/file-tree.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/file-tree.md ### Customize with real content Adapt the Haze file-tree ui for our product. Replace the demo values of these props with our real content: name, files, open, default slot, class. Keep the layout, the heading level rules and these accessibility details: Folders use native summaries and expose their expanded state. File links behave like links. Use current only on the file whose link points to the current page. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using file-tree, check it fits: use it when docs show a project structure with expandable directories; file entries are either descriptive names or regular links. Avoid it when the feature needs file editing or a full tree widget with application keyboard shortcuts.; a flat list is easier to read. use item.. Alternatives: @haze/collapsible, @haze/item. ## Example requests that should lead here - Show a project file tree with two nested folders and links to the source files. ## Source ```astro --- import { ChevronRight, File, Folder } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { name?: string; files?: { name: string; href?: string; current?: boolean }[]; open?: boolean; class?: string; } const { name = "Project files", files = [{ name: "README.md" }, { name: "config.ts" }], open = false, class: className } = Astro.props; const fileRow = "flex min-h-9 min-w-0 items-center gap-2 rounded-lg px-2.5 py-1 text-[0.8125rem]/5"; ---
summary>[data-tree-chevron]]:rotate-90", className)}>
{files.length > 0 && (
    {files.map(({ name: fileName, href, current }) => (
  • {href ? ( ) : ( )}
  • ))}
)}
``` --- # File upload > Dashed drop area over a real file input; a small script lists the chosen files with a remove button and announces changes. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/file-upload` - File: `src/components/haze/ui/file-upload.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/file-upload ## Use when - Attaching invoices, screenshots or documents to a form - Uploads where dragging files onto the page area should work as well as clicking ## Avoid when - Uploads that need previews, progress bars or resumable transfers, which need an application-level uploader - A single small avatar change; a button that opens the file picker is lighter ## Alternatives - [input](https://hazeui.com/ui/input.md) - [button](https://hazeui.com/ui/button.md) - [field](https://hazeui.com/ui/field.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | File input id; the visible title is a label for it, the hint id is -hint. | | name | `string` | id | no | Form field name. | | label | `string` | | yes | Title inside the box and the accessible name of the input. | | hint | `string` | | no | Help text such as accepted types and the size limit; linked with aria-describedby. | | accept | `string` | | no | Comma-separated file types, as in the native accept attribute. | | multiple | `boolean` | | no | Allows choosing more than one file. | | class | `string` | | no | Extra classes on the wrapper. | | ...rest | `attributes` | | no | Any other input attribute, for example required or disabled. A passed aria-describedby is joined to the hint id, not a replacement for it. | ## Accessibility - The invisible file input fills the whole box, so click, drag-and-drop and the operating system's file dialog are all native; the visible title is its label. - With the script, chosen files are listed as rows, and a polite live region announces what was added or removed and how many files are selected. Without scripting the native file input is shown below the hint, so the browser itself displays the chosen file names. - Each row has a remove button named "Remove ". Removing a file returns focus to the file input. - The focus outline is drawn on the box with has-focus-visible, because the input itself has no visible edge. While files are dragged over the box its border and tint change; this is a hint only, and dropping works the same either way. - Type and size limits are written in the hint; accept only filters the picker, so validate files on the server. - Key Tab: Focuses the file input - Key Enter or Space: Opens the file dialog ## Agent prompts ### Install and use Install the Haze UI component "File upload" with `npx shadcn@latest add @haze/file-upload`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import FileUpload from "@/components/haze/ui/file-upload.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/file-upload.md ### Customize with real content Adapt the Haze file-upload ui for our product. Replace the demo values of these props with our real content: id, name, label, hint, accept, multiple, class, ...rest. Keep the layout, the heading level rules and these accessibility details: The invisible file input fills the whole box, so click, drag-and-drop and the operating system's file dialog are all native; the visible title is its label. With the script, chosen files are listed as rows, and a polite live region announces what was added or removed and how many files are selected. Without scripting the native file input is shown below the hint, so the browser itself displays the chosen file names. Each row has a remove button named "Remove ". Removing a file returns focus to the file input. The focus outline is drawn on the box with has-focus-visible, because the input itself has no visible edge. While files are dragged over the box its border and tint change; this is a hint only, and dropping works the same either way. Type and size limits are written in the hint; accept only filters the picker, so validate files on the server. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using file-upload, check it fits: use it when attaching invoices, screenshots or documents to a form; uploads where dragging files onto the page area should work as well as clicking. Avoid it when uploads that need previews, progress bars or resumable transfers, which need an application-level uploader; a single small avatar change; a button that opens the file picker is lighter. Alternatives: @haze/input, @haze/button, @haze/field. ## Example requests that should lead here - Add an invoice upload box that accepts PNG and PDF - Make a multiple-file screenshot upload that lists the file names ## Source ```astro --- import { Upload, X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id: string; name?: string; /** Accessible name, shown as the title inside the drop area. */ label: string; /** Short help text, for example "PNG or PDF, up to 10 MB". */ hint?: string; /** Comma-separated types, as in the native accept attribute. */ accept?: string; multiple?: boolean; class?: string; /** Any other input attribute, for example required or disabled. An aria-describedby is added after the hint id, not instead of it. */ [key: string]: unknown; } const { id, name = id, label, hint, accept, multiple, class: className, ...rest } = Astro.props; const { "aria-describedby": extraDescribedBy, ...inputRest } = rest; const describedBy = [hint ? `${id}-hint` : undefined, typeof extraDescribedBy === "string" ? extraDescribedBy : undefined].filter(Boolean).join(" ") || undefined; ---
{hint &&

{hint}

}

    ``` --- # Filter panel > A vertical GET form of collapsible facets with checkbox counts, a number range, a switch, in-list search and Clear all. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/filter-panel` - File: `src/components/haze/ui/filter-panel.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/button, @haze/checkbox, @haze/input, @haze/switch, @haze/utils - Docs page: https://hazeui.com/ui/filter-panel ## Use when - A product catalog, directory or table sits beside a sidebar of facets such as category, brand and price. - Selected filters should land in the query string so results can be linked, reloaded and server-rendered. - A facet has many options and needs a folded 'Show more' list with optional search. ## Avoid when - Filters sit above the results as a row of dropdowns; use filter-toolbar. - The filters must open from a button on small screens; put this panel inside drawer. - One short list of options in a form; use checkbox-group. ## Alternatives - [filter-toolbar](https://hazeui.com/ui/filter-toolbar.md) - [drawer](https://hazeui.com/ui/drawer.md) - [checkbox-group](https://hazeui.com/ui/checkbox-group.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Prefix for the form, title and every field id. | | action | `string` | "" | no | Where the GET form submits. Empty means the current page. | | title | `string` | "Filters" | no | Panel heading. | | headingLevel | `2 \| 3 \| 4` | 2 | no | Heading level of the title. | | facets | `Facet[]` | | no | Sections. type 'options' (default): key, label, options[{ value, label, count, checked }], visibleCount, searchable, open. type 'range': min, max, step, minValue, maxValue, minName, maxName. type 'toggle': checked, description. | | locale | `string` | "en-US" | no | BCP 47 locale for the result counts. | | clearHref | `string` | | no | Makes Clear all a link to the unfiltered URL. Without it Clear all is type=reset and restores the form's first state. | | clearLabel | `string` | "Clear all" | no | Text of the clear control. | | applyLabel | `string` | "Apply" | no | Text of the submit button. | | activeLabel | `string` | "active" | no | Word after the active count, read as '2 active'. | | resultsLabel | `string` | "results" | no | Spoken after each option count. | | showMoreLabel | `string` | "Show {count} more" | no | Folded-list opener; {count} is replaced by the number of hidden options. | | showFewerLabel | `string` | "Show fewer" | no | Folded-list closer. | | searchLabel | `string` | "Search within" | no | Accessible name prefix of a facet search, followed by the facet label. | | searchPlaceholder | `string` | "Search" | no | Placeholder of a facet search. | | emptyLabel | `string` | "No matches" | no | Shown when a facet search matches nothing. | | minLabel | `string` | "Min" | no | Label of the lower range input. | | maxLabel | `string` | "Max" | no | Label of the upper range input. | | class | `string` | | no | Classes for the form, for example a fixed sidebar width. | ## Accessibility - A real form named by its heading. Every option is a native checkbox in a fieldset whose legend is the facet name; counts are announced as descriptions such as '48 results'. - Sections are native details elements, not exclusive, so any number can stay open; summaries show a focus ring and rotate a decorative chevron. - Without script the panel still filters: the form submits query parameters, 'Show more' is a nested details, and the live count and facet search simply do not appear. - The active count is a polite status region that is updated only when the number changes. The visible badge is hidden from assistive technology so it is not read twice. - On a small screen the panel is one column; place it inside drawer rather than building a second layout. - Key Tab / Shift+Tab: Move between section summaries, options, range inputs, Clear all and Apply - Key Enter / Space: Open or close a section or a 'Show more' list; toggle a checkbox or switch ## Agent prompts ### Install and use Install the Haze UI component "Filter panel" with `npx shadcn@latest add @haze/filter-panel`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import FilterPanel from "@/components/haze/ui/filter-panel.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/filter-panel.md ### Customize with real content Adapt the Haze filter-panel ui for our product. Replace the demo values of these props with our real content: id, action, title, headingLevel, facets, locale, clearHref, clearLabel, applyLabel, activeLabel, resultsLabel, showMoreLabel, showFewerLabel, searchLabel, searchPlaceholder, emptyLabel, minLabel, maxLabel, class. Keep the layout, the heading level rules and these accessibility details: A real form named by its heading. Every option is a native checkbox in a fieldset whose legend is the facet name; counts are announced as descriptions such as '48 results'. Sections are native details elements, not exclusive, so any number can stay open; summaries show a focus ring and rotate a decorative chevron. Without script the panel still filters: the form submits query parameters, 'Show more' is a nested details, and the live count and facet search simply do not appear. The active count is a polite status region that is updated only when the number changes. The visible badge is hidden from assistive technology so it is not read twice. On a small screen the panel is one column; place it inside drawer rather than building a second layout. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using filter-panel, check it fits: use it when a product catalog, directory or table sits beside a sidebar of facets such as category, brand and price.; selected filters should land in the query string so results can be linked, reloaded and server-rendered.; a facet has many options and needs a folded 'show more' list with optional search.. Avoid it when filters sit above the results as a row of dropdowns; use filter-toolbar.; the filters must open from a button on small screens; put this panel inside drawer.; one short list of options in a form; use checkbox-group.. Alternatives: @haze/filter-toolbar, @haze/drawer, @haze/checkbox-group. ## Example requests that should lead here - Add a catalog sidebar with Category and Brand checkboxes, a price range and an in-stock switch. - Put the filter panel in a drawer on mobile and pin it as a 288 px sidebar on desktop. - Pre-check two brands from the URL and show how many filters are active. ## Source ```astro --- import { ChevronDown } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Button from "./button.astro"; import Checkbox from "./checkbox.astro"; import Input from "./input.astro"; import Switch from "./switch.astro"; interface Option { value: string; label: string; /** Number of results with this value. Shown muted and read as a description. */ count?: number; checked?: boolean; } interface Facet { /** Query parameter for options and toggles (key=value, repeated for several values). */ key: string; label: string; /** options: checkboxes. range: two number inputs. toggle: one switch. */ type?: "options" | "range" | "toggle"; /** Section starts open. Sections are not exclusive, so several can be open. */ open?: boolean; options?: Option[]; /** Options shown before the "Show more" disclosure. Default 6; a single hidden option is never folded away. */ visibleCount?: number; /** Adds a search field above the options. It appears only once the script has run. */ searchable?: boolean; /** Range: bounds, step and current values. Parameters are `${key}_min` and `${key}_max` unless named. */ min?: number; max?: number; step?: number; minValue?: number; maxValue?: number; minName?: string; maxName?: string; /** Toggle: starts on. */ checked?: boolean; /** Toggle: helper text under the label. */ description?: string; } interface Props { /** Required: ids of the title, fields and options derive from it. */ id: string; /** Where the GET form submits. Empty means the current page. */ action?: string; title?: string; headingLevel?: 2 | 3 | 4; facets?: Facet[]; /** BCP 47 locale for the result counts. */ locale?: string; /** Link target of "Clear all", normally the unfiltered URL. Without it the button is a reset: with script it clears every field, without script it restores the page's initial state (pre-checked options come back). */ clearHref?: string; clearLabel?: string; applyLabel?: string; /** Word after the active count ("2 active"). */ activeLabel?: string; /** Spoken after a count ("48 results"). */ resultsLabel?: string; /** Use {count} for the number of folded options. */ showMoreLabel?: string; showFewerLabel?: string; searchPlaceholder?: string; /** Prefix of the search field's accessible name, followed by the facet label. */ searchLabel?: string; emptyLabel?: string; minLabel?: string; maxLabel?: string; class?: string; } const { id, action = "", title = "Filters", headingLevel = 2, locale = "en-US", clearHref, clearLabel = "Clear all", applyLabel = "Apply", activeLabel = "active", resultsLabel = "results", showMoreLabel = "Show {count} more", showFewerLabel = "Show fewer", searchPlaceholder = "Search", searchLabel = "Search within", emptyLabel = "No matches", minLabel = "Min", maxLabel = "Max", class: className, facets = [ { key: "category", label: "Category", open: true, options: [ { value: "notebooks", label: "Notebooks", count: 48 }, { value: "pens", label: "Pens and markers", count: 112 }, { value: "desk", label: "Desk organisers", count: 37 }, { value: "filing", label: "Filing and folders", count: 64 }, { value: "boards", label: "Whiteboards", count: 15 }, ], }, { key: "brand", label: "Brand", open: true, searchable: true, visibleCount: 5, options: [ { value: "alder", label: "Alder & Co", count: 41 }, { value: "basalt", label: "Basalt", count: 23 }, { value: "harbor", label: "Harbor Desk", count: 58 }, { value: "lumen", label: "Lumen Office", count: 19 }, { value: "pennant", label: "Pennant", count: 76 }, { value: "quillmark", label: "Quillmark", count: 33 }, { value: "tern", label: "Tern Supply", count: 12 }, { value: "wicker", label: "Wicker & Reed", count: 9 }, ], }, { key: "price", label: "Price (USD)", type: "range", open: true, min: 0, max: 500, step: 1 }, { key: "in_stock", label: "In stock only", type: "toggle", description: "Hide items that ship in 2 weeks or more" }, ], } = Astro.props; const Heading = ({ 2: "h2", 3: "h3", 4: "h4" } as const)[headingLevel]; const number = new Intl.NumberFormat(locale); const slide = "supports-[interpolate-size:allow-keywords]:[interpolate-size:allow-keywords] supports-[interpolate-size:allow-keywords]:details-content:h-0 supports-[interpolate-size:allow-keywords]:details-content:overflow-clip supports-[interpolate-size:allow-keywords]:details-content:transition-[height,content-visibility] supports-[interpolate-size:allow-keywords]:details-content:transition-discrete supports-[interpolate-size:allow-keywords]:details-content:duration-300 supports-[interpolate-size:allow-keywords]:details-content:ease-snappy supports-[interpolate-size:allow-keywords]:open:details-content:h-auto"; const enhancedOnly = "hidden [[data-haze-filter-panel][data-enhanced]_&]:block"; ---
    {title}
    { clearHref ? ( ) : ( ) }
    { facets.map((facet) => { const kind = facet.type ?? "options"; const options = facet.options ?? []; const fold = facet.visibleCount ?? 6; const split = options.length - fold > 1 ? fold : options.length; const head = options.slice(0, split); const tail = options.slice(split); const facetId = `${id}-${facet.key}`; const minName = facet.minName ?? `${facet.key}_min`; const maxName = facet.maxName ?? `${facet.key}_max`; return kind === "toggle" ? (
    ) : (
    {facet.label}
    {kind === "range" ? (
    {facet.label}
    ) : (
    {facet.label} {facet.searchable && (
    )}
    {head.map((option, index) => (
    {option.count !== undefined && ( {number.format(option.count)} {resultsLabel} )}
    ))} {tail.length > 0 && (
    option.checked)} class="group/more grid gap-2"> {showMoreLabel.replace("{count}", String(tail.length))}
    {tail.map((option, index) => (
    {option.count !== undefined && ( {number.format(option.count)} {resultsLabel} )}
    ))}
    )}
    {facet.searchable && }
    )}
    ); }) }
    ``` --- # Filter Toolbar > Native faceted filters with removable active chips, a reset control, and values ready for GET submission. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/filter-toolbar` - File: `src/components/haze/ui/filter-toolbar.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/button, @haze/select, @haze/utils - Docs page: https://hazeui.com/ui/filter-toolbar ## Use when - A project collection needs status and owner facets close to its results. - Active choices should be visible and individually removable. ## Avoid when - The task is plain text matching. Use search-field. ## Alternatives - [search-field](https://hazeui.com/ui/search-field.md) - [chip-group](https://hazeui.com/ui/chip-group.md) - [sortable-data-table](https://hazeui.com/ui/sortable-data-table.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Form ID and input label prefix. | | label | `string` | | no | Accessible filter group name. | | action | `string` | | no | GET form destination. Defaults to the current URL. | | filters | `{ key: string; label: string; options: { value: string; label: string }[]; allLabel?: string }[]` | | no | Facet definitions. allLabel names the first, unfiltered option (default "All"). | | values | `Record` | | no | Initial selected value by filter key. | | class | `string` | | no | Additional classes on the component wrapper. | ## Accessibility - Each select has a visible label and sends its native value with the GET form. Active chips are enhancements built from the chosen labels. - Removing a chip returns focus to its select. haze:filter-change carries current key/value pairs for a client-filtered collection. - Key Arrow keys: Choose a value in a focused native select. - Key Enter / Space: Remove an active chip or reset and apply filters. ## Agent prompts ### Install and use Install the Haze UI component "Filter Toolbar" with `npx shadcn@latest add @haze/filter-toolbar`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import FilterToolbar from "@/components/haze/ui/filter-toolbar.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/filter-toolbar.md ### Customize with real content Adapt the Haze filter-toolbar ui for our product. Replace the demo values of these props with our real content: id, label, action, filters, values, class. Keep the layout, the heading level rules and these accessibility details: Each select has a visible label and sends its native value with the GET form. Active chips are enhancements built from the chosen labels. Removing a chip returns focus to its select. haze:filter-change carries current key/value pairs for a client-filtered collection. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using filter-toolbar, check it fits: use it when a project collection needs status and owner facets close to its results.; active choices should be visible and individually removable.. Avoid it when the task is plain text matching. use search-field.. Alternatives: @haze/search-field, @haze/chip-group, @haze/sortable-data-table. ## Example requests that should lead here - Put status and owner filters above projects and show removable chips for the current choices. ## Source ```astro --- import { X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Button from "./button.astro"; import Select from "./select.astro"; interface Props { id: string; label?: string; action?: string; filters?: { key: string; label: string; options: { value: string; label: string }[]; /** Label of the first, unfiltered option. Defaults to "All". */ allLabel?: string }[]; values?: Record; class?: string; } const { id, label = "Filter projects", action = "", values = {}, class: className, filters = [ { key: "status", label: "Status", allLabel: "All statuses", options: [{ value: "open", label: "Open" }, { value: "review", label: "In review" }, { value: "done", label: "Done" }] }, { key: "owner", label: "Owner", allLabel: "All owners", options: [{ value: "mila", label: "Mila" }, { value: "owen", label: "Owen" }] }, ] } = Astro.props; ---
    {filters.map(filter =>
    {groups.map((segment,index)=>)}} {group?.steps.length?
    :

    No conversion steps supplied.

    } {group&&group.steps.length>0&&}

    Step widths use a common scale; an increase remains an increase.

    Conversion and drop-off data{groups.flatMap(segment=>segment.steps.map((step,index)=>))}
    {label}
    Audience / stepCount / retained / of first
    {segment.label} / {step.label}{step.value} / {index?rate(step.value,segment.steps[index-1].value):"Start"} / {rate(step.value,segment.steps[0].value)}
    ``` --- # Gantt chart > A project schedule with a fixed task column and a scrolling date axis: phased bars, progress, milestones and a today marker. - Kind: ui · Category: Data display · Interactivity: none - Install: `npx shadcn@latest add @haze/gantt-chart` - File: `src/components/haze/ui/gantt-chart.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/gantt-chart ## Use when - A launch or project plan needs to show which tasks overlap and where the milestones fall. - Task status and progress must read at a glance next to the dates. - A read-only schedule goes in a status report or client portal. ## Avoid when - The list has no dates, only order; use timeline or a plain list. - Users drag bars to reschedule or link dependencies; that needs a scheduling tool, not this display. - A single metric over time is plotted; use area-chart or bar-chart. ## Alternatives - [timeline](https://hazeui.com/ui/timeline.md) - [bar-chart](https://hazeui.com/ui/bar-chart.md) - [table](https://hazeui.com/ui/table.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | tasks | `Task[]` | launch demo | no | Rows with name, phase, start, end (ISO dates, end inclusive), owner initials, progress 0-100, status and milestone. | | label | `string` | Product launch schedule, scroll sideways to see all dates | no | Accessible name of the scrollable timeline region. | | scale | `"day" \| "week"` | week | no | Week shows one label per Monday; day adds a number for every day and a wider axis. | | weekends | `boolean` | true | no | Shades Saturdays and Sundays. | | today | `string` | 2026-11-12 | no | ISO date for the today marker. Pass an empty string to hide it. The component never reads the clock. | | todayLabel | `string` | Today | no | Text of the today marker. | | taskHeading | `string` | Task | no | Header of the task column. | | ownerLabel | `string` | Owner | no | Screen reader word read before the owner initials. | | doneLabel | `string` | done | no | Word after the progress percentage. | | locale | `string` | en | no | BCP 47 locale for dates, formatted in UTC. | | class | `string` | | no | Classes for the outer panel. | ## Accessibility - Every bar has its meaning as visible text in the task column: dates, percent done, owner and a status word with an icon, so nothing relies on color or bar length. - The bars, axis and today marker are decorative and hidden from assistive technology; milestones read as 'Milestone, '. - The scroll region is focusable and named, so keyboard users can pan the timeline with the arrow keys. - Key Tab, then arrow keys: Focus the timeline region and scroll it sideways. ## Agent prompts ### Install and use Install the Haze UI component "Gantt chart" with `npx shadcn@latest add @haze/gantt-chart`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import GanttChart from "@/components/haze/ui/gantt-chart.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/gantt-chart.md ### Customize with real content Adapt the Haze gantt-chart ui for our product. Replace the demo values of these props with our real content: tasks, label, scale, weekends, today, todayLabel, taskHeading, ownerLabel, doneLabel, locale, class. Keep the layout, the heading level rules and these accessibility details: Every bar has its meaning as visible text in the task column: dates, percent done, owner and a status word with an icon, so nothing relies on color or bar length. The bars, axis and today marker are decorative and hidden from assistive technology; milestones read as 'Milestone, '. The scroll region is focusable and named, so keyboard users can pan the timeline with the arrow keys. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using gantt-chart, check it fits: use it when a launch or project plan needs to show which tasks overlap and where the milestones fall.; task status and progress must read at a glance next to the dates.; a read-only schedule goes in a status report or client portal.. Avoid it when the list has no dates, only order; use timeline or a plain list.; users drag bars to reschedule or link dependencies; that needs a scheduling tool, not this display.; a single metric over time is plotted; use area-chart or bar-chart.. Alternatives: @haze/timeline, @haze/bar-chart, @haze/table. ## Example requests that should lead here - Show the six-week launch plan with design, build and QA phases and a launch milestone. - Add a day-scale sprint chart with a today marker and an at-risk task. - Render a read-only roadmap with owners and progress for a client update. ## Source ```astro --- import { Check, CircleAlert, Info, TriangleAlert } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; type Status = "default" | "info" | "success" | "warning" | "destructive"; interface Task { name: string; /** Group heading. Tasks with the same phase are listed together, in order of first appearance. */ phase?: string; /** ISO date, YYYY-MM-DD. */ start: string; /** ISO date, YYYY-MM-DD, inclusive. */ end: string; /** Initials of the person responsible. */ owner?: string; /** 0 to 100. */ progress?: number; status?: Status; /** Text shown with the status icon. Defaults to a word for each status. */ statusLabel?: string; /** Draws a diamond on the start date instead of a bar. */ milestone?: boolean; } interface Props { tasks?: Task[]; /** Accessible name of the scrollable timeline. */ label?: string; scale?: "day" | "week"; /** Shade Saturdays and Sundays. */ weekends?: boolean; /** ISO date drawn as a labeled vertical marker. Never read from the clock. */ today?: string; todayLabel?: string; taskHeading?: string; ownerLabel?: string; doneLabel?: string; locale?: string; class?: string; } const DAY = 86400000; const toDay = (iso: string) => Math.floor(Date.parse(`${iso}T00:00:00Z`) / DAY); const { tasks = [ { name: "API freeze", phase: "Build", start: "2026-11-02", end: "2026-11-06", owner: "MO", progress: 100, status: "success" }, { name: "Checkout redesign", phase: "Build", start: "2026-11-04", end: "2026-11-13", owner: "IS", progress: 60, status: "info" }, { name: "Pricing page", phase: "Build", start: "2026-11-09", end: "2026-11-13", owner: "TV", progress: 30, status: "destructive", statusLabel: "Blocked" }, { name: "Beta testing", phase: "Launch", start: "2026-11-12", end: "2026-11-20", owner: "PN", progress: 20, status: "warning" }, { name: "Launch copy", phase: "Launch", start: "2026-11-16", end: "2026-11-19", owner: "MO", progress: 0 }, { name: "Public launch", phase: "Launch", start: "2026-11-24", end: "2026-11-24", milestone: true }, ], label = "Product launch schedule, scroll sideways to see all dates", scale = "week", weekends = true, today = "2026-11-12", todayLabel = "Today", taskHeading = "Task", ownerLabel = "Owner", doneLabel = "done", locale = "en", class: className, } = Astro.props; const fmt = new Intl.DateTimeFormat(locale, { month: "short", day: "numeric", timeZone: "UTC" }); const dayNum = new Intl.DateTimeFormat(locale, { day: "numeric", timeZone: "UTC" }); const show = (d: number) => fmt.format(new Date(d * DAY)); const NAME_W = "8.5rem"; const statusText: Record = { default: "", info: "In progress", success: "Done", warning: "At risk", destructive: "Blocked" }; const statusIcon = { default: null, info: Info, success: Check, warning: TriangleAlert, destructive: CircleAlert }; const barTone: Record = { default: { track: "border-border-strong bg-muted", fill: "bg-muted-foreground" }, info: { track: "border-brand-border bg-brand/22", fill: "bg-brand" }, success: { track: "border-success-border bg-success/14", fill: "bg-success" }, warning: { track: "border-warning-border bg-warning/14", fill: "bg-warning" }, destructive: { track: "border-destructive-border bg-destructive/14", fill: "bg-destructive" }, }; const statusColor: Record = { default: "text-muted-foreground", info: "text-brand", success: "text-success", warning: "text-warning", destructive: "text-destructive" }; const rows = tasks .map((t) => ({ ...t, s: toDay(t.start), e: Math.max(toDay(t.start), toDay(t.end)) })) .filter((t) => !Number.isNaN(t.s) && !Number.isNaN(t.e)); const todayDay = today ? toDay(today) : NaN; const hasToday = !Number.isNaN(todayDay); // Range: whole weeks (Monday to Sunday) around every task and the today marker. const lo = Math.min(...rows.map((t) => t.s), hasToday ? todayDay : Infinity); const hi = Math.max(...rows.map((t) => t.e), hasToday ? todayDay : -Infinity); const mondayOf = (d: number) => d - ((((d + 3) % 7) + 7) % 7); // day 0 (1970-01-01) was a Thursday const rangeStart = Number.isFinite(lo) ? mondayOf(lo) : mondayOf(toDay("2026-11-02")); const rangeEnd = Number.isFinite(hi) ? mondayOf(hi) + 7 : rangeStart + 7; const span = rangeEnd - rangeStart; const pct = (d: number) => `${(((d - rangeStart) / span) * 100).toFixed(3)}%`; const minWidth = span * (scale === "day" ? 28 : 16); const days = Array.from({ length: span }, (_, i) => rangeStart + i); const mondays = days.filter((d) => mondayOf(d) === d); const weekendDays = days.filter((d) => { const w = (((d + 3) % 7) + 7) % 7; return w >= 5; }); const phases: { name: string; tasks: typeof rows }[] = []; for (const t of rows) { const name = t.phase ?? ""; let group = phases.find((p) => p.name === name); if (!group) phases.push((group = { name, tasks: [] })); group.tasks.push(t); } const rowStyle = `grid-template-columns: ${NAME_W} minmax(${minWidth}px, 1fr)`; const innerStyle = `min-width: calc(${NAME_W} + ${minWidth}px)`; const nameCell = "sticky left-0 z-10 min-w-0 border-r border-border bg-card px-3 py-2"; ---
    ``` --- # Gauge > Read one clamped measurement against a known range, with named threshold bands and an optional native adjustment control. - Kind: ui · Category: Data display · Interactivity: script - Install: `npx shadcn@latest add @haze/gauge` - File: `src/components/haze/ui/gauge.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/gauge ## Use when - Capacity or health has a meaningful minimum and maximum. - A named threshold explains when a reading needs attention. ## Avoid when - Several independent measurements need comparison. Use bar-chart. ## Alternatives - [progress](https://hazeui.com/ui/progress.md) - [bar-chart](https://hazeui.com/ui/bar-chart.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | label | `string` | Storage capacity | no | Visible caption and accessible name of the native meter. | | value | `number` | 64 | no | Finite reading, clamped to the valid range; nonfinite values use the minimum. | | min | `number` | 0 | no | Lower bound. A nonfinite bound becomes zero. | | max | `number` | 100 | no | Upper bound; invalid ranges receive a positive fallback span. | | unit | `string` | % | no | Suffix for the visible value and accessible reading. | | bands | `{ max: number; label: string; tone?: string }[]` | | no | Upper thresholds sorted ascending; semantic tones are brand, success, warning and destructive. | | adjustable | `boolean` | false | no | Show a native range control after enhancement. | | class | `string` | | no | Additional classes on the chart figure. | ## Accessibility - The native meter exposes its bounds, value and threshold label; the visual ring duplicates that information. - The optional range changes the value and threshold text together, with ring travel removed by reduced motion. - Key Arrow keys / Home / End: Adjust the value when the optional range is enabled. ## Agent prompts ### Install and use Install the Haze UI component "Gauge" with `npx shadcn@latest add @haze/gauge`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Gauge from "@/components/haze/ui/gauge.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/gauge.md ### Customize with real content Adapt the Haze gauge ui for our product. Replace the demo values of these props with our real content: label, value, min, max, unit, bands, adjustable, class. Keep the layout, the heading level rules and these accessibility details: The native meter exposes its bounds, value and threshold label; the visual ring duplicates that information. The optional range changes the value and threshold text together, with ring travel removed by reduced motion. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using gauge, check it fits: use it when capacity or health has a meaningful minimum and maximum.; a named threshold explains when a reading needs attention.. Avoid it when several independent measurements need comparison. use bar-chart.. Alternatives: @haze/progress, @haze/bar-chart. ## Example requests that should lead here - Show build cache occupancy in a meter with named healthy, filling and near-capacity bands. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Band {max:number;label:string;tone?:"brand"|"success"|"warning"|"destructive"} interface Props {label?:string;value?:number;min?:number;max?:number;unit?:string;bands?:Band[];adjustable?:boolean;class?:string} const {label="Storage capacity",value=64,min=0,max=100,unit="%",adjustable=false,bands=[{max:70,label:"Within capacity",tone:"success"},{max:90,label:"Filling up",tone:"warning"},{max:100,label:"Near capacity",tone:"destructive"}],class:className}=Astro.props; let floor=Number.isFinite(min)?min:0; let ceiling=Number.isFinite(max)&&max>floor?max:(floor<0?0:floor+1); if(!Number.isFinite(ceiling)||ceiling<=floor){floor=0;ceiling=100;} const current=Number.isFinite(value)?Math.max(floor,Math.min(ceiling,value)):floor; const magnitude=Math.max(Math.abs(floor),Math.abs(ceiling),1); const ratio=(current/magnitude-floor/magnitude)/(ceiling/magnitude-floor/magnitude); const ordered=bands.filter(item=>Number.isFinite(item.max)).sort((a,b)=>a.max-b.max),band=ordered.find(item=>current<=item.max)??ordered.at(-1); const colors={brand:"stroke-brand",success:"stroke-success",warning:"stroke-warning",destructive:"stroke-destructive"}; const text=(n:number)=>new Intl.NumberFormat("en",{maximumFractionDigits:2}).format(n)+unit; ---
    {label}
    {text(current)}

    {text(floor)} – {text(ceiling)}

    {adjustable&&}
    ``` --- # Group > Control joiner merging mixed inputs, selects, buttons, and static text addons horizontally or vertically with collapsed seams. - Kind: ui · Category: Layout and media · Interactivity: none - Install: `npx shadcn@latest add @haze/group` - File: `src/components/haze/ui/group.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/group ## Use when - Combining an input with a static URL prefix or domain suffix and copy button - Attaching a scope select beside a search field and submit icon button - Stacking related action buttons or fields vertically with seamless inner corners ## Avoid when - Attaching icons or text strictly inside a single input border; use input-group - A pure row of action buttons that benefits from a sliding hover highlight; use button-group ## Alternatives - [button-group](https://hazeui.com/ui/button-group.md) - [input-group](https://hazeui.com/ui/input-group.md) - [toolbar](https://hazeui.com/ui/toolbar.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | label | `string` | | yes | Accessible label set as aria-label on the role="group" container. | | prefix | `string` | | no | Static muted addon joined cleanly before the first child control. | | suffix | `string` | | no | Static muted addon joined cleanly after the last child control. | | orientation | `"horizontal" \| "vertical"` | "horizontal" | no | Controls axis and collapsed outer/inner corner radii. | | class | `string` | | no | Extra classes on the outer group wrapper. | ## Accessibility - Uses role="group" with a required accessible label so screen readers announce control membership. - Promotes any hovered, focused, or focus-within child above adjacent overlapping borders (z-10) so focus rings remain intact. - Key Tab: Moves naturally through interactive controls inside the group ## Agent prompts ### Install and use Install the Haze UI component "Group" with `npx shadcn@latest add @haze/group`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Group from "@/components/haze/ui/group.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/group.md ### Customize with real content Adapt the Haze group ui for our product. Replace the demo values of these props with our real content: label, prefix, suffix, orientation, class. Keep the layout, the heading level rules and these accessibility details: Uses role="group" with a required accessible label so screen readers announce control membership. Promotes any hovered, focused, or focus-within child above adjacent overlapping borders (z-10) so focus rings remain intact. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using group, check it fits: use it when combining an input with a static url prefix or domain suffix and copy button; attaching a scope select beside a search field and submit icon button; stacking related action buttons or fields vertically with seamless inner corners. Avoid it when attaching icons or text strictly inside a single input border; use input-group; a pure row of action buttons that benefits from a sliding hover highlight; use button-group. Alternatives: @haze/button-group, @haze/input-group, @haze/toolbar. ## Example requests that should lead here - Join a scope Select, filter Input, and Search icon Button in a horizontal Group - Wrap an Input with https:// prefix and .haze.ui suffix inside a Group ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Props { /** Accessible name describing the joined controls, for example "Domain URL" or "Search filters". */ label: string; /** Optional static text chip joined cleanly before the slotted controls. */ prefix?: string; /** Optional static text chip joined cleanly after the slotted controls. */ suffix?: string; /** Arranges controls inline (horizontal) or stacked cleanly (vertical). */ orientation?: "horizontal" | "vertical"; class?: string; } const { label, prefix, suffix, orientation = "horizontal", class: className } = Astro.props; // One field surface, like input-group: the group carries the fill, frame, focus and invalid border; // segments are flat (no own border or fill) and split by a 1 px border-colour hairline. const orientations = { horizontal: "h-10 flex-row items-stretch *:h-auto [&>*:first-child]:rounded-s-[calc(var(--radius-lg)-1px)] [&>*:last-child]:rounded-e-[calc(var(--radius-lg)-1px)] [&>*:not(:first-child)]:border-s [&>*:not(:first-child)]:border-border!", vertical: "flex-col [&>*:first-child]:rounded-t-[calc(var(--radius-lg)-1px)] [&>*:last-child]:rounded-b-[calc(var(--radius-lg)-1px)] [&>*:not(:first-child)]:border-t [&>*:not(:first-child)]:border-border!", }; const addon = "inline-flex shrink-0 items-center bg-muted! px-3 text-[0.8125rem]/5 whitespace-nowrap text-muted-foreground select-none"; ---
    *:focus-visible]:z-10 [&>*:hover]:z-10", "[&_select]:border-0 [&_select]:bg-transparent [&_:is(input,select,textarea)]:focus-visible:ring-0", orientations[orientation], className, )} > {prefix && {prefix}} {suffix && {suffix}}
    ``` --- # Hold to Confirm > Fills as a confirmation is held, then changes to a check. Includes a standard two-step button. - Kind: ui · Category: Actions · Interactivity: script - Install: `npx shadcn@latest add @haze/hold-to-confirm` - File: `src/components/haze/ui/hold-to-confirm.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/button, @haze/utils - Docs page: https://hazeui.com/ui/hold-to-confirm ## Use when - A consequential action is easy to trigger by mistake. - The effect of revoking access is already explained in the surrounding UI. ## Avoid when - A dialog is needed to explain the consequences or ask for more information. ## Alternatives - [alert-dialog](https://hazeui.com/ui/alert-dialog.md) - [stateful-button](https://hazeui.com/ui/stateful-button.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique ID for the control and its keyboard instructions. | | label | `string` | Revoke link | no | Label on the standard confirmation button. | | holdLabel | `string` | Hold to revoke link | no | Label on the press-and-hold button. Provide a translation with label. | | confirmedLabel | `string` | Link revoked | no | Text and live announcement after confirmation. | | alternateLabel | `string` | | no | Label for the standard two-step confirmation disclosure. | | hint | `string` | Press and hold for 1.2 s | no | Visible hint under the button. The default states the hold time. | | holdingHint | `string` | Keep holding… | no | Hint shown while a hold is in progress. | | duration | `number` | 1200 | no | Hold time in milliseconds, with a 500 ms minimum. | | form | `string` | | no | ID of a form to submit. Otherwise, listen for the click on the element marked data-hold-action. | | name | `string` | | no | Native submit button name. | | value | `string` | | no | Native submit button value. | | class | `string` | | no | Classes on the wrapper. | ## Accessibility - Confirmation requires one uninterrupted hold. The disclosure lets people confirm with a standard button, including when scripts are disabled. - Key Hold Enter / Space: Confirm after the indicated hold time. - Key Escape: Cancel an active hold. ## Agent prompts ### Install and use Install the Haze UI component "Hold to Confirm" with `npx shadcn@latest add @haze/hold-to-confirm`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import HoldToConfirm from "@/components/haze/ui/hold-to-confirm.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/hold-to-confirm.md ### Customize with real content Adapt the Haze hold-to-confirm ui for our product. Replace the demo values of these props with our real content: id, label, holdLabel, confirmedLabel, alternateLabel, hint, holdingHint, duration, form, name, value, class. Keep the layout, the heading level rules and these accessibility details: Confirmation requires one uninterrupted hold. The disclosure lets people confirm with a standard button, including when scripts are disabled. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using hold-to-confirm, check it fits: use it when a consequential action is easy to trigger by mistake.; the effect of revoking access is already explained in the surrounding ui.. Avoid it when a dialog is needed to explain the consequences or ask for more information.. Alternatives: @haze/alert-dialog, @haze/stateful-button. ## Example requests that should lead here - Make link revocation require a deliberate press and provide a two-step alternative. ## Source ```astro --- import { Check, ChevronDown, Lock } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Button from "./button.astro"; interface Props { id: string; label?: string; holdLabel?: string; confirmedLabel?: string; alternateLabel?: string; hint?: string; holdingHint?: string; duration?: number; form?: string; name?: string; value?: string; class?: string; } const { id, label = "Revoke link", holdLabel = `Hold to ${label.charAt(0).toLowerCase()}${label.slice(1)}`, confirmedLabel = "Link revoked", alternateLabel = "Confirm with a button", duration = 1200, form, name, value, class: className, } = Astro.props; const holdTime = Number.isFinite(duration) ? Math.max(500, Math.round(duration)) : 1200; const { hint = `Press and hold for ${holdTime / 1000} s`, holdingHint = "Keep holding…" } = Astro.props; ---
    {alternateLabel}
    ``` --- # Hover Card > Shows a short preview of a link’s destination on hover or keyboard focus. - Kind: ui · Category: Overlays · Interactivity: script - Install: `npx shadcn@latest add @haze/hover-card` - File: `src/components/haze/ui/hover-card.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/hover-card ## Use when - A destination needs more context before navigation. - A short title and description fit in a small text preview. ## Avoid when - The overlay contains its own actions or inputs. ## Alternatives - [popover](https://hazeui.com/ui/popover.md) - [tooltip](https://hazeui.com/ui/tooltip.md) - [navigation-menu](https://hazeui.com/ui/navigation-menu.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique prefix for the link description and native anchor. | | href | `string` | | yes | Link destination. | | label | `string` | View details | no | Visible link label. | | heading | `string` | | no | Optional title in the preview. | | description | `string` | | yes | Text associated with the link and shown in the preview. | | class | `string` | | no | Classes for the link wrapper. | ## Accessibility - The destination remains a normal link for touch and when scripting is disabled. - The preview stays visible as the pointer moves onto it and can be dismissed with Escape. - Key Tab: Focus the link and show the preview. - Key Escape: Close the preview. - Key Enter: Open the link. ## Agent prompts ### Install and use Install the Haze UI component "Hover Card" with `npx shadcn@latest add @haze/hover-card`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import HoverCard from "@/components/haze/ui/hover-card.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/hover-card.md ### Customize with real content Adapt the Haze hover-card ui for our product. Replace the demo values of these props with our real content: id, href, label, heading, description, class. Keep the layout, the heading level rules and these accessibility details: The destination remains a normal link for touch and when scripting is disabled. The preview stays visible as the pointer moves onto it and can be dismissed with Escape. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using hover-card, check it fits: use it when a destination needs more context before navigation.; a short title and description fit in a small text preview.. Avoid it when the overlay contains its own actions or inputs.. Alternatives: @haze/popover, @haze/tooltip, @haze/navigation-menu. ## Example requests that should lead here - Preview a glossary article from its link. - Show what is in the component guide before someone opens it. ## Source ```astro --- import { ArrowUpRight } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id: string; href: string; label?: string; heading?: string; description: string; class?: string; } const { id, href, label = "View details", heading, description, class: className } = Astro.props; --- {label} {heading && {heading}} {description} ``` --- # Icon morph > A named native checkbox with a menu, playback or favorite icon that moves into its checked state. - Kind: ui · Category: Actions · Interactivity: native - Install: `npx shadcn@latest add @haze/icon-morph` - File: `src/components/haze/ui/icon-morph.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/icon-morph ## Use when - A small toggle needs a recognizable visual change without a changing layout - A navigation, preview or favorite control already has a meaningful checked state ## Avoid when - Use action-swap when the action needs visible text beside its icon - Use button for an icon action that does not retain a selected state ## Alternatives - [action-swap](https://hazeui.com/ui/action-swap.md) - [toggle](https://hazeui.com/ui/toggle.md) - [button](https://hazeui.com/ui/button.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique caller-supplied prefix for this component and its related elements. | | name | `string` | id | no | Form submission name. | | label | `string` | "Toggle navigation" | no | Accessible label describing the checked state. | | variant | `"menu" \| "play" \| "favorite"` | "menu" | no | Icon pair to draw. | | checked | `boolean` | false | no | Initial native checked state. | | disabled | `boolean` | | no | Disables the native control and its enhancement. | | class | `string` | | no | Additional classes for the component root. | | ...attributes | `native control attributes` | | no | Other attributes are forwarded to the real form control. | ## Accessibility - Only the checkbox is exposed as a control; the drawn icon is decorative. - A persistent text label names the toggle, and its checked state is available without JavaScript. - Key Tab, Space: Reach the icon control and toggle its checked state. ## Agent prompts ### Install and use Install the Haze UI component "Icon morph" with `npx shadcn@latest add @haze/icon-morph`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import IconMorph from "@/components/haze/ui/icon-morph.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/icon-morph.md ### Customize with real content Adapt the Haze icon-morph ui for our product. Replace the demo values of these props with our real content: id, name, label, variant, checked, disabled, class, ...attributes. Keep the layout, the heading level rules and these accessibility details: Only the checkbox is exposed as a control; the drawn icon is decorative. A persistent text label names the toggle, and its checked state is available without JavaScript. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using icon-morph, check it fits: use it when a small toggle needs a recognizable visual change without a changing layout; a navigation, preview or favorite control already has a meaningful checked state. Avoid it when use action-swap when the action needs visible text beside its icon; use button for an icon action that does not retain a selected state. Alternatives: @haze/action-swap, @haze/toggle, @haze/button. ## Example requests that should lead here - Add a labeled menu-to-close icon toggle using a real checkbox. ## Source ```astro --- import { Heart, Pause, Play } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; interface Props { id: string; name?: string; label?: string; variant?: "menu" | "play" | "favorite"; checked?: boolean; disabled?: boolean; class?: string; [key: string]: unknown; } const { id, name = id, label = "Toggle navigation", variant = "menu", checked = false, disabled, class: className, ...rest } = Astro.props; --- ``` --- # Image cropper > Pan and zoom an image under a fixed-aspect or circle crop frame, then read the crop rect in image pixels or export a data URL. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/image-cropper` - File: `src/components/haze/ui/image-cropper.astro` - npm dependencies: none - Registry dependencies: @haze/slider, @haze/utils - Docs page: https://hazeui.com/ui/image-cropper ## Use when - An image must be cropped to a fixed aspect ratio, such as a square cover or a round avatar, before it is saved. - The caller needs the crop rectangle in image pixels or a canvas-rendered result. ## Avoid when - Use avatar-upload when the whole flow, including the file input and a submitted PNG, is wanted for a profile photo. - Use aspect-ratio when an image is only displayed in a fixed ratio. - Free-form crop handles and rotation are not supported. ## Alternatives - [avatar-upload](https://hazeui.com/ui/avatar-upload.md) - [aspect-ratio](https://hazeui.com/ui/aspect-ratio.md) - [slider](https://hazeui.com/ui/slider.md) - [file-upload](https://hazeui.com/ui/file-upload.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique id of the wrapper; the zoom slider and help text derive their ids from it. | | label | `string` | Crop image | no | Accessible name of the crop area. | | aspect | `number` | 1 | no | Width divided by height of the crop frame. | | shape | `"rect" \| "circle"` | rect | no | Frame outline; a circle also clips the exported image. | | src | `string` | | no | Optional image URL loaded on init. Otherwise call the load method. | | maxZoom | `number` | 3 | no | Largest zoom, as a multiple of the size that just covers the frame. | | class | `string` | | no | Additional classes on this component's outer wrapper. | | [key: string] | `unknown` | | no | Additional attributes on the wrapper. | ## Accessibility - The crop area is a focusable group with an accessible name and help text that lists the keys; dragging, wheel and pinch all have keyboard and slider alternatives. - Zoom is a native range input and a Reset button restores the starting view. - The crop size and zoom are announced politely after changes settle. - The script sets load(src), getCrop() and toDataURL(type, maxSize) on the wrapper element and dispatches haze:crop-change with { x, y, width, height, zoom } in image pixels. The image always covers the frame. - The rule-of-thirds grid shows while dragging only; reduced motion removes its fade. - Key Arrow keys: Move the image under the frame; Shift moves further. - Key + / -: Zoom in or out. - Key 0: Reset zoom and position. - Key Tab: Move to the zoom slider and Reset button. ## Agent prompts ### Install and use Install the Haze UI component "Image cropper" with `npx shadcn@latest add @haze/image-cropper`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ImageCropper from "@/components/haze/ui/image-cropper.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/image-cropper.md ### Customize with real content Adapt the Haze image-cropper ui for our product. Replace the demo values of these props with our real content: id, label, aspect, shape, src, maxZoom, class, [key: string]. Keep the layout, the heading level rules and these accessibility details: The crop area is a focusable group with an accessible name and help text that lists the keys; dragging, wheel and pinch all have keyboard and slider alternatives. Zoom is a native range input and a Reset button restores the starting view. The crop size and zoom are announced politely after changes settle. The script sets load(src), getCrop() and toDataURL(type, maxSize) on the wrapper element and dispatches haze:crop-change with { x, y, width, height, zoom } in image pixels. The image always covers the frame. The rule-of-thirds grid shows while dragging only; reduced motion removes its fade. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using image-cropper, check it fits: use it when an image must be cropped to a fixed aspect ratio, such as a square cover or a round avatar, before it is saved.; the caller needs the crop rectangle in image pixels or a canvas-rendered result.. Avoid it when use avatar-upload when the whole flow, including the file input and a submitted png, is wanted for a profile photo.; use aspect-ratio when an image is only displayed in a fixed ratio.; free-form crop handles and rotation are not supported.. Alternatives: @haze/avatar-upload, @haze/aspect-ratio, @haze/slider, @haze/file-upload. ## Example requests that should lead here - Add a square image cropper with zoom before uploading a cover photo - Crop a profile picture to a circle and export it as a data URL ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; import Slider from "./slider.astro"; interface Props { id: string; label?: string; /** Width divided by height of the crop frame. */ aspect?: number; shape?: "rect" | "circle"; src?: string; maxZoom?: number; class?: string; [key: string]: unknown; } const { id, label = "Crop image", aspect = 1, shape = "rect", src, maxZoom = 3, class: className, ...rest } = Astro.props; const ratio = Number.isFinite(aspect) && aspect > 0 ? aspect : 1; const top = Number.isFinite(maxZoom) && maxZoom > 1 ? maxZoom : 3; const circle = shape === "circle"; ---

    No image loaded

    Drag the image to move it. Scroll or pinch to zoom. With the area focused, use the arrow keys to move (Shift for larger steps), plus and minus to zoom, and 0 to reset.

    ``` --- # Image Viewer > Opens a thumbnail gallery in a focus-managed lightbox with image navigation and a zoom toggle. - Kind: ui · Category: Overlays · Interactivity: script - Install: `npx shadcn@latest add @haze/image-viewer` - File: `src/components/haze/ui/image-viewer.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/button, @haze/dialog, @haze/utils - Docs page: https://hazeui.com/ui/image-viewer ## Use when - Previewing full-size screenshots, design assets, or attachments. - Users need to inspect details without leaving the page. ## Avoid when - Several images need to be compared side by side. ## Alternatives - [carousel](https://hazeui.com/ui/carousel.md) - [compare-slider](https://hazeui.com/ui/compare-slider.md) - [dialog](https://hazeui.com/ui/dialog.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique ID for the lightbox dialog. | | title | `string` | Image gallery | no | Name for the gallery and dialog. | | items | `ImageItem[]` | | yes | Images with a source, alt text, optional caption, and optional thumbnail. | | emptyLabel | `string` | | no | Message shown if there are no images. | | headingLevel | `2 \| 3 \| 4 \| 5 \| 6` | 2 | no | Level of the dialog heading. | | class | `string` | | no | Classes for the gallery wrapper. | ## Accessibility - Thumbnail links open the source image when scripting is unavailable. - The current image index is announced and focus returns to the opening thumbnail. - Key ← / →: Browse images unless focused on a zoomed preview. - Key Tab: Reach zoom, navigation, and the preview surface. - Key Escape: Close the viewer and return to the thumbnail. ## Agent prompts ### Install and use Install the Haze UI component "Image Viewer" with `npx shadcn@latest add @haze/image-viewer`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ImageViewer from "@/components/haze/ui/image-viewer.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/image-viewer.md ### Customize with real content Adapt the Haze image-viewer ui for our product. Replace the demo values of these props with our real content: id, title, items, emptyLabel, headingLevel, class. Keep the layout, the heading level rules and these accessibility details: Thumbnail links open the source image when scripting is unavailable. The current image index is announced and focus returns to the opening thumbnail. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using image-viewer, check it fits: use it when previewing full-size screenshots, design assets, or attachments.; users need to inspect details without leaving the page.. Avoid it when several images need to be compared side by side.. Alternatives: @haze/carousel, @haze/compare-slider, @haze/dialog. ## Example requests that should lead here - Add a thumbnail lightbox for original brand assets. - Let users zoom and browse screenshot attachments without leaving the page. ## Source ```astro --- import { ChevronLeft, ChevronRight, ZoomIn } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Button from "./button.astro"; import Dialog from "./dialog.astro"; interface ImageItem { src: string; alt: string; caption?: string; thumbnail?: string; fit?: "cover" | "contain" } interface Props { id: string; title?: string; items: ImageItem[]; emptyLabel?: string; headingLevel?: 2 | 3 | 4 | 5 | 6; class?: string; } const { id, title = "Image gallery", items, emptyLabel = "No images available.", headingLevel, class: className } = Astro.props; const first = items[0]; ---
    {first ? ( <>
    {first.alt}
    {first.caption ?? first.alt}
    1 of {items.length}
    ) :

    {emptyLabel}

    }
    ``` --- # In-view title > A semantic section heading gently responds when it enters view after being outside the reading viewport. - Kind: ui · Category: Data display · Interactivity: script - Install: `npx shadcn@latest add @haze/in-view-title` - File: `src/components/haze/ui/in-view-title.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/in-view-title ## Use when - An article section should acknowledge scrolling into view without concealing its title - A nested scroll panel needs the same readable heading behavior as a document ## Avoid when - Use section-heading when the heading should remain entirely static - Use text-reveal for a word-by-word response to a deliberate action ## Alternatives - [section-heading](https://hazeui.com/ui/section-heading.md) - [text-reveal](https://hazeui.com/ui/text-reveal.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique caller-supplied prefix for this component and its related elements. | | text | `string` | "A fresh perspective" | no | Section heading text. | | headingLevel | `"h2" \| "h3" \| "h4" \| "h5" \| "h6"` | "h2" | no | Semantic heading level. | | once | `boolean` | true | no | Stops observing after the first offscreen-to-onscreen entry. | | class | `string` | | no | Additional classes for the component root. | ## Accessibility - The heading is visible in the original HTML and remains readable when scripts or IntersectionObserver are unavailable. - Initially visible headings stay still; motion starts only after a heading has been outside the viewport. - The supplied heading level preserves the surrounding document outline. ## Agent prompts ### Install and use Install the Haze UI component "In-view title" with `npx shadcn@latest add @haze/in-view-title`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import InViewTitle from "@/components/haze/ui/in-view-title.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/in-view-title.md ### Customize with real content Adapt the Haze in-view-title ui for our product. Replace the demo values of these props with our real content: id, text, headingLevel, once, class. Keep the layout, the heading level rules and these accessibility details: The heading is visible in the original HTML and remains readable when scripts or IntersectionObserver are unavailable. Initially visible headings stay still; motion starts only after a heading has been outside the viewport. The supplied heading level preserves the surrounding document outline. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using in-view-title, check it fits: use it when an article section should acknowledge scrolling into view without concealing its title; a nested scroll panel needs the same readable heading behavior as a document. Avoid it when use section-heading when the heading should remain entirely static; use text-reveal for a word-by-word response to a deliberate action. Alternatives: @haze/section-heading, @haze/text-reveal. ## Example requests that should lead here - Add a readable h3 that responds once as it enters a scrollable article viewport. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Props { id: string; text?: string; headingLevel?: "h2" | "h3" | "h4" | "h5" | "h6"; once?: boolean; class?: string; } const { id, text = "A fresh perspective", headingLevel: Heading = "h2", once = true, class: className } = Astro.props; --- {text} ``` --- # Inbox list > Email threads with sender, company, subject, preview, time, unread mark and a reply label, with the open thread highlighted. - Kind: ui · Category: Navigation · Interactivity: none - Install: `npx shadcn@latest add @haze/inbox-list` - File: `src/components/haze/ui/inbox-list.astro` - npm dependencies: none - Registry dependencies: @haze/avatar, @haze/tag, @haze/utils - Docs page: https://hazeui.com/ui/inbox-list ## Use when - A CRM or outreach tool sorts the replies it received - A support screen lists conversations next to the open one ## Avoid when - Only one conversation is on screen. Use chat-thread. - Rows hold many columns that need sorting. Use table. ## Alternatives - [chat-thread](https://hazeui.com/ui/chat-thread.md) - [item](https://hazeui.com/ui/item.md) - [table](https://hazeui.com/ui/table.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | label | `string` | "Replies" | no | Accessible name of the list. | | threads | `{ from: string; org?: string; subject: string; preview?: string; time: string; unread?: boolean; label?: { text: string; variant?: Tone }; href: string; current?: boolean }[]` | | no | Threads, newest first. | | unreadLabel | `string` | "Unread" | no | Word read before an unread thread. | | class | `string` | | no | Additional classes on the list. | ## Accessibility - Unread threads are read as unread and also shown in bold, not by the dot alone. - The open thread carries aria-current, and the whole row is one link. - Key Tab: Move between threads. ## Agent prompts ### Install and use Install the Haze UI component "Inbox list" with `npx shadcn@latest add @haze/inbox-list`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import InboxList from "@/components/haze/ui/inbox-list.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/inbox-list.md ### Customize with real content Adapt the Haze inbox-list ui for our product. Replace the demo values of these props with our real content: label, threads, unreadLabel, class. Keep the layout, the heading level rules and these accessibility details: Unread threads are read as unread and also shown in bold, not by the dot alone. The open thread carries aria-current, and the whole row is one link. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using inbox-list, check it fits: use it when a crm or outreach tool sorts the replies it received; a support screen lists conversations next to the open one. Avoid it when only one conversation is on screen. use chat-thread.; rows hold many columns that need sorting. use table.. Alternatives: @haze/chat-thread, @haze/item, @haze/table. ## Example requests that should lead here - Add an inbox of sales replies labelled Interested, Later and Not interested, with unread ones bold. ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; import Avatar from "./avatar.astro"; import Tag from "./tag.astro"; type Tone = "default" | "info" | "success" | "warning" | "destructive"; interface Thread { from: string; /** Company or address shown after the sender. */ org?: string; subject: string; /** First words of the latest message. */ preview?: string; /** Time as it should read, such as "09:12" or "Mon". */ time: string; unread?: boolean; /** Sorting label, such as a reply category. Its text carries the meaning. */ label?: { text: string; variant?: Tone }; href: string; /** The thread open next to the list. */ current?: boolean; } interface Props { /** Accessible name of the list. */ label?: string; threads?: Thread[]; /** Word read for an unread thread, for translation. */ unreadLabel?: string; class?: string; } const { label = "Replies", threads = [ { from: "Amra Kovač", org: "Smile Dental", subject: "Re: Fewer missed appointments", preview: "Sounds interesting. Could you show me how the reminders look on a phone?", time: "09:12", unread: true, label: { text: "Interested", variant: "success" }, href: "#t1", current: true, }, { from: "Dario Petrović", org: "Petrović Auto", subject: "Re: Booking for the service bay", preview: "We are fully booked until January, write to me again after the holidays.", time: "08:47", unread: true, label: { text: "Later", variant: "warning" }, href: "#t2", }, { from: "Office", org: "Nova Clinic", subject: "Automatic reply: out of office", preview: "Thank you for your message. We are back on Monday, 1 December.", time: "Mon", label: { text: "Out of office" }, href: "#t3", }, { from: "Selma Hadžić", org: "Studio Forma", subject: "Re: Intro", preview: "Thanks, but we already use another system. Please remove us from your list.", time: "Sun", label: { text: "Not interested", variant: "destructive" }, href: "#t4", }, ], unreadLabel = "Unread", class: className, } = Astro.props; --- ``` --- # Inline edit > Switch a label or description into an editable field in place, with explicit save, cancel and retry states. - Kind: ui · Category: Forms · Interactivity: script - Install: `npx shadcn@latest add @haze/inline-edit` - File: `src/components/haze/ui/inline-edit.astro` - npm dependencies: @lucide/astro - Registry dependencies: @haze/button, @haze/utils - Docs page: https://hazeui.com/ui/inline-edit ## Use when - A project title or short description is read often and edited occasionally. - A settings row needs its own save action and feedback. ## Avoid when - Several fields in the same form are reviewed and saved together. Use input or textarea. ## Alternatives - [input](https://hazeui.com/ui/input.md) - [textarea](https://hazeui.com/ui/textarea.md) - [field](https://hazeui.com/ui/field.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Unique control ID and prefix for the read button, label and feedback. | | name | `string` | id | no | Name submitted to a native form. | | label | `string` | Name | no | Visible label used when editing and in action names. | | value | `string` | "" | no | Initially committed text. | | placeholder | `string` | Add a value | no | Visible hint when the value is empty. | | multiline | `boolean` | false | no | Use a growing native textarea. Shift+Enter inserts a line break. | | variant | `"title" \| "body"` | body | no | Typography shared by the resting text and the field. | | required / disabled / readonly | `boolean` | | no | Native validation and editing states. | | class | `string` | | no | Extra classes on the root. | | ...attributes | `HTML form control attributes` | | no | Forwarded to the input or textarea, including form, maxlength and aria-describedby. | ## Accessibility - A native button names the field and its value. Save and cancel return keyboard focus to that button. - Errors and save results use a live region. Without JavaScript the editor is an ordinary labelled form control. - Changes apply locally. A bubbling haze:inline-edit-save event provides detail.value and detail.previousValue. Call detail.waitUntil(promise) during dispatch to show pending progress and restore the previous value on rejection. Reopening offers the failed draft for retry. - Key Enter / Space: Open the editor from the value button. - Key Enter / Escape: Apply the draft or cancel it and restore the saved value. - Key Shift+Enter: Insert a line break in a multiline value. - Key Tab: Move through save and cancel. Leaving the whole editor commits a valid draft. ## Agent prompts ### Install and use Install the Haze UI component "Inline edit" with `npx shadcn@latest add @haze/inline-edit`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import InlineEdit from "@/components/haze/ui/inline-edit.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/inline-edit.md ### Customize with real content Adapt the Haze inline-edit ui for our product. Replace the demo values of these props with our real content: id, name, label, value, placeholder, multiline, variant, required / disabled / readonly, class, ...attributes. Keep the layout, the heading level rules and these accessibility details: A native button names the field and its value. Save and cancel return keyboard focus to that button. Errors and save results use a live region. Without JavaScript the editor is an ordinary labelled form control. Changes apply locally. A bubbling haze:inline-edit-save event provides detail.value and detail.previousValue. Call detail.waitUntil(promise) during dispatch to show pending progress and restore the previous value on rejection. Reopening offers the failed draft for retry. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using inline-edit, check it fits: use it when a project title or short description is read often and edited occasionally.; a settings row needs its own save action and feedback.. Avoid it when several fields in the same form are reviewed and saved together. use input or textarea.. Alternatives: @haze/input, @haze/textarea, @haze/field. ## Example requests that should lead here - Make the project name editable in place and keep the user's draft available if the save request fails. ## Source ```astro --- import { Check, CircleAlert, LoaderCircle, Pencil, X } from "@lucide/astro"; import { cn } from "../../../lib/haze/utils"; import Button from "./button.astro"; interface Props { id: string; name?: string; label?: string; value?: string; placeholder?: string; multiline?: boolean; variant?: "title" | "body"; required?: boolean; disabled?: boolean; readonly?: boolean; class?: string; "aria-describedby"?: string; [key: string]: unknown; } const { id, name = id, label = "Name", value = "", placeholder = "Add a value", multiline = false, variant = "body", required, disabled, readonly, class: className, "aria-describedby": describedBy, ...rest } = Astro.props; const type = variant === "title" ? "text-[1.0625rem]/6 font-medium tracking-[-0.01em]" : "text-sm/6 tracking-[-0.01em]"; const field = cn("block min-h-10 w-full min-w-0 rounded-lg bg-field px-2.5 py-1.5 text-foreground placeholder:text-muted-foreground", "group-data-enhanced/inline:pe-17 focus-visible:outline-2 focus-visible:outline-offset-0 focus-visible:outline-ring disabled:opacity-50 aria-invalid:bg-destructive/10 aria-invalid:focus-visible:outline-destructive", type); const control = { ...rest, id, name, required, disabled, readonly, placeholder, "aria-describedby": [describedBy, `${id}-status`].filter(Boolean).join(" ") }; ---
    {multiline ? : }

    ``` --- # Input group > Input with a leading and trailing add-on, such as https:// or an icon, where the outer box takes the border and focus ring. - Kind: ui · Category: Forms · Interactivity: native - Install: `npx shadcn@latest add @haze/input-group` - File: `src/components/haze/ui/input-group.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/input-group ## Use when - Showing a fixed prefix or suffix, like a domain, currency or unit - A search box with a magnifier icon inside the field - Values where the user should only type the changing part ## Avoid when - An add-on that is clickable, such as a Copy button; place a button next to an input instead - Plain text with no prefix or suffix; use input ## Alternatives - [input](https://hazeui.com/ui/input.md) - [field](https://hazeui.com/ui/field.md) - [button-group](https://hazeui.com/ui/button-group.md) ## Props | Name | Type | Default | Required | Description | |---|---|---|---|---| | id | `string` | | yes | Input id; reference it from a label or Field. | | name | `string` | id | no | Form field name. | | type | `"text" \| "email" \| "password" \| "search" \| "url" \| "tel" \| "number"` | "text" | no | Input type. | | placeholder | `string` | | no | Example value shown while empty. | | leading | `string` | | no | Text add-on before the input, on a quiet fill. | | trailing | `string` | | no | Text add-on after the input, on a quiet fill. | | class | `string` | | no | Extra classes on the bordered wrapper. | | leading slot | `slot` | | no | Replaces the leading text, for example with an icon. Styled as an icon add-on with no fill. | | trailing slot | `slot` | | no | Replaces the trailing text. | | ...rest | `attributes` | | no | Any other input attribute, for example value, required, disabled or aria-invalid. | ## Accessibility - Text add-ons sit on a quiet fill with a hairline; icon add-ons have no fill. - The wrapper draws the focus ring through focus-within, so the whole box lights up while the real input holds focus. A destructive border shows when the input has aria-invalid=true. - Add-on text is not part of the input's accessible name; repeat the unit in the label or description, for example "Monthly budget in dollars". - Icons in the slots should be aria-hidden; a meaningful add-on needs text. - Key Tab: Focuses the input; the add-ons are not focusable ## Agent prompts ### Install and use Install the Haze UI component "Input group" with `npx shadcn@latest add @haze/input-group`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import InputGroup from "@/components/haze/ui/input-group.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/input-group.md ### Customize with real content Adapt the Haze input-group ui for our product. Replace the demo values of these props with our real content: id, name, type, placeholder, leading, trailing, class, leading slot, trailing slot, ...rest. Keep the layout, the heading level rules and these accessibility details: Text add-ons sit on a quiet fill with a hairline; icon add-ons have no fill. The wrapper draws the focus ring through focus-within, so the whole box lights up while the real input holds focus. A destructive border shows when the input has aria-invalid=true. Add-on text is not part of the input's accessible name; repeat the unit in the label or description, for example "Monthly budget in dollars". Icons in the slots should be aria-hidden; a meaningful add-on needs text. Do not add raw color classes; use the Haze tokens. ### Choose the right block Before using input-group, check it fits: use it when showing a fixed prefix or suffix, like a domain, currency or unit; a search box with a magnifier icon inside the field; values where the user should only type the changing part. Avoid it when an add-on that is clickable, such as a copy button; place a button next to an input instead; plain text with no prefix or suffix; use input. Alternatives: @haze/input, @haze/field, @haze/button-group. ## Example requests that should lead here - Add a site address input with https:// before and .haze.dev after - Make a search input with a leading magnifier icon ## Source ```astro --- import { cn } from "../../../lib/haze/utils"; interface Props { id: string; name?: string; type?: "text" | "email" | "password" | "search" | "url" | "tel" | "number"; placeholder?: string; /** Text add-on before the input, on a quiet fill. The `leading` slot replaces it and is styled as an icon add-on with no fill. */ leading?: string; /** Text add-on after the input, on a quiet fill. The `trailing` slot replaces it and is styled as an icon add-on with no fill. */ trailing?: string; class?: string; /** Any other input attribute, for example value, required, disabled or aria-describedby. */ [key: string]: unknown; } const { id, name = id, type = "text", placeholder, leading, trailing, class: className, ...rest } = Astro.props; const hasLeading = Astro.slots.has("leading") || Boolean(leading); const hasTrailing = Astro.slots.has("trailing") || Boolean(trailing); // A slot add-on is treated as an icon (no fill); a text add-on gets a quiet fill. const addon = { text: "flex shrink-0 items-center bg-muted px-3 text-muted-foreground", icon: "flex shrink-0 items-center px-3 text-muted-foreground [&_svg]:size-4", }; const leadingClass = Astro.slots.has("leading") ? cn(addon.icon, "pe-0") : cn(addon.text, "border-r border-border"); const trailingClass = Astro.slots.has("trailing") ? cn(addon.icon, "ps-0") : cn(addon.text, "border-l border-border"); ---
    { hasLeading && ( {leading} ) } { hasTrailing && ( {trailing} ) }
    ``` --- # Input > Single-line text field with a soft border on a filled background, a muted placeholder, and a stronger border plus ring on focus. - Kind: ui · Category: Forms · Interactivity: native - Install: `npx shadcn@latest add @haze/input` - File: `src/components/haze/ui/input.astro` - npm dependencies: none - Registry dependencies: @haze/utils - Docs page: https://hazeui.com/ui/input ## Use when - Email, name, search or URL fields in forms - Always pair it with a