AI feature launch
In-product AI feature launch card with interactive 3-step tour preview, benefit checklist, admin enable switch and CTAs.
pnpm dlx shadcn@latest add @haze/ai-feature-launch---
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];
---
<section aria-labelledby={`${id}-title`} data-haze-ai-launch class={cn("bg-background px-4 py-10 sm:px-6 sm:py-14", className)}>
<div class="mx-auto max-w-2xl overflow-hidden rounded-2xl border border-border bg-card shadow-float">
<div class="border-b border-border bg-muted/40 p-5 sm:p-6">
<div class="flex flex-wrap items-center justify-between gap-2">
<span class="inline-flex items-center gap-1.5 rounded-full border border-frame bg-muted px-2.5 py-0.5 text-xs font-medium text-foreground">
<Sparkles class="size-3.5" aria-hidden="true" />
{badge}
</span>
<div role="tablist" aria-label="Feature tour steps" hidden={!firstStep} class="flex gap-1">
{
steps.map((s, idx) => (
<button
type="button"
role="tab"
data-fl-step={String(idx)}
data-fl-caption={s.caption}
data-fl-preview={s.preview}
aria-selected={idx === 0 ? "true" : "false"}
class="inline-flex h-7 cursor-pointer items-center rounded-md border border-frame bg-field px-2.5 text-xs font-medium text-muted-foreground transition-colors duration-150 hover:text-foreground aria-selected:border-foreground aria-selected:bg-accent aria-selected:text-foreground focus-visible:outline-2 focus-visible:outline-ring"
>
{s.label}
</button>
))
}
</div>
</div>
<div class="mt-4 rounded-xl border border-border bg-card p-4">
<p data-fl-preview-box class="font-mono text-xs/5 text-foreground">{firstStep?.preview ?? "No tour steps are available."}</p>
<p data-fl-caption-box hidden={!firstStep} class="mt-1.5 text-xs/5 text-muted-foreground">{firstStep?.caption}</p>
</div>
</div>
<div class="p-5 sm:p-6">
<h2 id={`${id}-title`} class="text-xl/7 font-semibold tracking-tight text-foreground">{title}</h2>
<p class="mt-1.5 text-sm/6 text-pretty text-muted-foreground">{description}</p>
<ul role="list" class="mt-4 space-y-2 text-xs/5 text-muted-foreground">
{
benefits.map((b) => (
<li class="flex items-start gap-2">
<Check class="mt-0.5 size-4 shrink-0 text-success" aria-hidden="true" />
<span>{b}</span>
</li>
))
}
</ul>
<label class="mt-5 flex cursor-pointer items-center justify-between gap-3 rounded-xl border border-border bg-muted/40 px-4 py-3">
<span class="flex items-center gap-2.5">
<ShieldCheck class="size-4 shrink-0 text-muted-foreground" aria-hidden="true" />
<span>
<span class="block text-xs/5 font-medium text-foreground">Enable for my workspace</span>
<span class="block text-[0.6875rem]/4 text-muted-foreground">Workspace admin permission required</span>
</span>
</span>
<span class="relative inline-grid size-4 shrink-0 place-items-center"><input type="checkbox" data-fl-enable class="peer col-start-1 row-start-1 shrink-0 focus-visible:outline-2 focus-visible:outline-ring size-4 shrink-0 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 checked:border-primary checked:bg-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring forced-colors:appearance-auto" /><Check class="pointer-events-none col-start-1 row-start-1 size-3 scale-50 text-primary-foreground opacity-0 transition-[opacity,scale] duration-200 ease-spring peer-checked:scale-100 peer-checked:opacity-100 forced-colors:hidden" stroke-width={3} aria-hidden="true" /></span>
</label>
<div class="mt-5 flex flex-wrap items-center justify-between gap-3">
<p data-fl-status role="status" class="text-xs/5 text-muted-foreground">Preview mode · Not yet enabled</p>
<div class="flex items-center gap-2">
<a href="#learn-more" class="inline-flex h-9 items-center rounded-lg border border-frame bg-muted/40 px-3.5 text-xs font-medium text-foreground hover:border-frame-strong hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring">Learn more</a>
<button type="button" data-fl-try class="inline-flex h-9 cursor-pointer items-center gap-1.5 rounded-lg bg-primary px-3.5 text-xs font-medium text-primary-foreground hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring transition-[background-color,border-color,color,opacity,scale] duration-150 ease-snappy active:scale-[0.97] active:duration-75">
Try it now
<ArrowRight class="size-3.5" aria-hidden="true" />
</button>
</div>
</div>
</div>
</div>
</section>
<script>
function initFeatureLaunches() {
document.querySelectorAll<HTMLElement>("[data-haze-ai-launch]").forEach((root) => {
if (root.hasAttribute("data-enhanced")) return;
root.setAttribute("data-enhanced", "");
const preview = root.querySelector<HTMLElement>("[data-fl-preview-box]");
const caption = root.querySelector<HTMLElement>("[data-fl-caption-box]");
const status = root.querySelector<HTMLElement>("[data-fl-status]");
const enable = root.querySelector<HTMLInputElement>("[data-fl-enable]");
root.querySelectorAll<HTMLButtonElement>("[data-fl-step]").forEach((tab) => {
tab.addEventListener("click", () => {
root.querySelectorAll<HTMLButtonElement>("[data-fl-step]").forEach((t) => t.setAttribute("aria-selected", String(t === tab)));
if (preview) preview.textContent = tab.dataset.flPreview ?? "";
if (caption) caption.textContent = tab.dataset.flCaption ?? "";
});
});
enable?.addEventListener("change", () => {
if (status) status.textContent = enable.checked ? "Enabled for all workspace projects." : "Preview mode · Not yet enabled";
});
root.querySelector<HTMLButtonElement>("[data-fl-try]")?.addEventListener("click", () => {
if (status) status.textContent = "Opened interactive sandbox with sample issues.";
});
});
}
initFeatureLaunches();
document.addEventListener("astro:page-load", initFeatureLaunches);
</script>When to use
- 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
When not to use
- Running a full multi-page setup wizard with source syncing; use ai-setup-wizard
Installation
Add the Haze registry to components.json once, then install AI feature launch with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.
pnpm dlx shadcn@latest add @haze/ai-feature-launchnpx shadcn@latest add @haze/ai-feature-launchyarn dlx shadcn@latest add @haze/ai-feature-launchbunx --bun shadcn@latest add @haze/ai-feature-launchFirst time? Registry and theme setup
1. Add to components.json:
{
"registries": {
"@haze": "http://localhost:4329/r/{name}.json"
}
}2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| id | string | "haze-ai-feature-launch" | Unique prefix for section heading IDs. |
| badge | string | "New in Haze" | Pill badge above the interactive tour. |
| title | string | "Meet AI Triage for incoming issues" | Announcement headline. |
| description | string | Feature summary | Short explanation under the title. |
| steps | { label: string; caption: string; preview: string }[] | 3 tour steps | Interactive tour steps displayed at the top. |
| benefits | string[] | 3 privacy and control bullets | Checklist shown above the workspace toggle. |
| class | string | – | Extra classes on the outer section. |
Keyboard interactions
- Tab
- Move across tour step tabs, enable checkbox, Learn more link and Try it now button
- EnterSpace
- Switch tour steps, toggle workspace enablement or launch the sandbox
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.
Notes for AI
Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.
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": "http://localhost:4329/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: http://localhost:4329/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.
Dependencies
- npm: @lucide/astro
- @haze/utils
- @haze/theme (one-time setup)
Source · Original Haze UI work.