Xzero UI
Pro library

AI feature launchPro

An in-product launch card for an AI feature. A looping mini demo plays above a three-step tour (inline rewrite, thread summary, ask your workspace), with benefit rows, an admin-gated "Enable for my workspace" switch, and Try it now and Learn more actions.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/ai-feature-launch
Live · keyboard ready

Show it once when a member first opens the product after an AI feature ships, inline or inside a Dialog. Wire onEnabledChange(enabled, signal) to your settings endpoint. The switch shows the new value while the save runs. Toggling again aborts the signal and reverts, and a rejection shows an error note. Set canManage from the viewer's role, and onTry / onLearnMore to open the feature and the docs. To replace the tour, pass steps. Each demo can be a function of the loop time in ms, so pausing, looping, freezing between steps and reduced motion all work without timers.

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/ai-feature-launch

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { AiFeatureLaunch } from "@/components/xzero/blocks/ai-feature-launch/ai-feature-launch";

export function AiLaunch({ workspace, isAdmin }: { workspace: { name: string; members: number; aiEnabled: boolean }; isAdmin: boolean }) {
  return (
    <AiFeatureLaunch
      workspaceName={workspace.name}
      memberCount={workspace.members}
      canManage={isAdmin}
      defaultEnabled={workspace.aiEnabled}
      onEnabledChange={async (enabled, signal) => {
        const res = await fetch("/api/workspace/ai", { method: "PATCH", body: JSON.stringify({ enabled }), signal });
        if (!res.ok) throw new Error("Could not save");
      }}
      onTry={() => router.push("/editor?ai=1")}
      onLearnMore={() => window.open("/docs/ai", "_blank")}
    />
  );
}

API reference

AiFeatureLaunch

An in-product launch card for an AI feature: a looping mini demo, a three-step tour with dots, three benefit rows per step, a workspace switch with an admin note, and Try it now and Learn more actions. With no props it plays a simulated tour of inline rewrite, thread summary and workspace search, and every action says that it was simulated.

PropTypeDefaultDescription
stepsLaunchStep[]rewrite, summarize, askTour steps: { id, title, description, benefits, demo?, posterTime? }. The card is always as tall as its tallest step, so switching steps never resizes it.
stepnumber–Controlled step index. Pair with onStepChange.
defaultStepnumber0Starting step when uncontrolled.
onStepChange(index: number) => void–Called when the step changes from the dots, the arrow keys or autoplay.
autoPlaybooleantrueAdvances to the next step after each preview loop. Stops for good on any interaction, waits while the pointer is over the card, and is off with reduced motion.
stepDurationnumber6400Length of one preview loop in milliseconds. The active dot fills over this time while autoplay runs.
workspaceNamestring"Halcyon"Workspace named in the saved and simulated announcements.
memberCountnumber48Members the setting applies to, used in the note and the pending label.
canManagebooleantrueWhen false the switch is disabled and the note says only admins can change it, while Try it now still works.
enabledboolean–Controlled workspace setting.
defaultEnabledbooleanfalseStarting setting when uncontrolled.
onEnabledChange(enabled: boolean, signal: AbortSignal) => Promise<void> | void–Saves the setting. The switch shows the new value while it runs and the note shimmers; toggling again aborts the signal and reverts; a rejection reverts and shows an error note. Leave it out to simulate a 0.9s save.
onTry(signal: AbortSignal) => Promise<void> | void–Primary action, for example opening the editor with the feature focused. The button shows a spinner while the promise runs. Simulated when omitted.
onLearnMore() => void–Secondary action, for example opening the docs or a changelog entry. Simulated when omitted.
modelNamestring"Claude Sonnet 5.5"Model credited in the footer ("Runs on ...").
modelMarkReactNodeClaude mark14px mark before the model name.
enableLabelstring"Enable for my workspace"Switch label.
tryLabelstring"Try it now"Primary action label.
learnMoreLabelstring"Learn more"Secondary action label.
classNamestring–Extra class on the root card.

LaunchStep

One step of the tour.

PropTypeDefaultDescription
id (required)string–Stable key.
title (required)string–Step title, sentence case, one line.
description (required)string–One sentence under the title.
benefits (required){ icon: LucideIcon; label: string }[]–Up to three rows with a 16px icon. Keep labels under about 45 characters.
demoReactNode | ((time: number) => ReactNode)–The preview in the stage. A function gets the loop time in milliseconds, so a mini demo is a pure function of time that pauses, loops and freezes for free. Return the start state at 0 and near the end of the loop so it repeats seamlessly.
posterTimenumber60% of stepDurationLoop time shown as a still frame with reduced motion. Pick the most telling moment.

Keyboard interactions

KeysAction
TabMoves through the active tour dot, the workspace switch, Learn more and Try it now.
ArrowLeft / ArrowRightOn the dots, moves to the previous or next step and stops autoplay.
Home / EndOn the dots, jumps to the first or last step.
SpaceToggles the workspace switch. Pressing it again while saving cancels the save.
Enter / SpaceActivates a dot or an action button.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Guidance for AI tools

Blocks are complete, self-contained screens with sample data. Replace the sample data and connect the callbacks described above. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components