Canvas
Onboarding guide
A setup guide that stays open beside the chat while the user works through 3–7 steps in your app. The agent explains the current step; only your app ticks a step off.
When to use it
Section titled “When to use it”Use it when: A new user needs to finish 3–7 setup steps in your app, in order. The guide stays open beside the chat while the user works and the agent explains the current step.
Use something else when: One step (tell the user in chat, or spotlight it). Steps the agent does itself (that’s an action, not a guide). Mobile: the canvas isn’t available; use the checklist card (mountMobile).
What the agent receives
Section titled “What the agent receives”| The template calls | The agent gets | When |
|---|---|---|
canvas.setState(patch) | Canvas state | A step is done (your app, or “I’ve done this”). The agent sees it with the user’s next message. |
displayed() | FUNCTION_TOOL_DISPLAYED | Mobile checklist card: as soon as it shows. |
States
Section titled “States”Besides its data, the template draws these as itself: mountState() on the canvas, mountMobileState() in the mobile card. Pick one on the preview with State.
| State | When it shows |
|---|---|
| Loading | The guide opens at once while your app reads which steps the user already did, and again after Try again. |
| Empty | Your app has no setup steps for this user, for example a teammate who joined a workspace an admin already set up. |
| Error | Your app couldn’t read the user’s progress. Try again loads the steps in place; steps already done stay done. |
mountState({ root, head, title: "…", state: { kind: "error", text: "…", retry } });mountMobileState({ root, head, title: "…", state: { kind: "error", text: "…", retry } });The hosted action and the in-page handler below show each case. The state types are LoadingState, EmptyState and ErrorState in fs-kit.
OnboardingState
Section titled “OnboardingState”| Field | Type | Notes |
|---|---|---|
title | string | |
intro (optional) | string | |
canvasTitle (optional) | string | The canvas header (setTitle, up to 80 characters). |
eyebrow (optional) | string | |
doneTitle (optional) | string | |
doneText (optional) | string | |
steps | OnboardingStep[] | |
current | string | null | The step the user is on. The agent moves it only when the user asks. |
OnboardingStep
Section titled “OnboardingStep”| Field | Type | Notes |
|---|---|---|
id | string | |
title | string | |
detail | string | |
done | boolean | Only your app sets this, when the user really did the step. The agent never does. |
minutes (optional) | number | |
cta (optional) | { label: string; href?: string } | The step’s button. Without actions.go, href is opened. |
auto (optional) | boolean | Your app detects this step itself: hides “I’ve done this”. |
OnboardingActions
Section titled “OnboardingActions”| Field | Type | Notes |
|---|---|---|
go() (optional) | (step: OnboardingStep) => void | Take the user to the step in your app (navigate, spotlight). |
finish() (optional) | () => void | The last screen’s button. Default: close the canvas. |
subscribe() (optional) | (onChange: (patch: Partial<OnboardingState>) => void) => () => void | Your app reports progress here (a step the user really finished). The guide redraws and shares it with the agent through canvas.setState. Return the unsubscribe. |
Install
Section titled “Install”Copy the template and the shared kit into your code: agent/ui/ in an agent repo, or anywhere in your app. The template imports only ./fs-kit.js. Then wire it up from the hosted action or the in-page handler.
- Hosted action: TypeScript, JavaScript
- In-page handler: TypeScript, JavaScript
- onboarding-canvas: TypeScript, JavaScript
- fs-kit: TypeScript, JavaScript
The hosted action needs an agent repo with one folder per action (agent/actions/<action_key>/index.ts). If your repo keeps its actions in agent/actions/index.ts, use the in-page handler: it runs the same template in your app.
All templates in machine-readable form: /ui-catalog/catalog.json.