Onboarding
Screens for getting started: onboarding, creating a workspace, accepting an invite and a multi-step setup wizard.
Installation & usage
npx @youj/cli add app-onboardingAlso installs async-button, button, card, empty, field, grid-backdrops, icon-check-circle, icon-rocket, icon-sparkles, icon-user-plus, icon-x, illustrations, input, input-group, presence-list, radio-group, stepper, youj-core, youj-presets, youj-ui-core.
The CLI copies the block to blocks/app/onboarding.tsx with every component it uses, so it’s yours to edit.
Every prop is optional and falls back to the demo, so it renders as you see it until you pass your own. Give it your data, rewrite or translate its strings through copy, and connect its actions:
'use client'
import Link from 'next/link'
import { Onboarding, type OnboardingProps } from '@/blocks/app/onboarding'
export function OnboardingView({ presets }: Pick<OnboardingProps, 'presets'>) {
return (
<Onboarding
presets={presets}
copy={{ page: 'Set up your workspace' }}
linkComponent={Link}
onFinish={(setup) => {
// your code
}}
onStepChange={(step) => {
// your code
}}
onOpenDashboard={() => {
// your code
}}
/>
)
}Description
Welcome users with a guided flow for naming a workspace, choosing a theme and inviting teammates.
Walk users through creating a workspace, choosing its address and inviting their team, with the address checked as they type.
Help a new teammate join a workspace with an invitation page that shows who invited them.
A multi-step setup with checks at each step, a review, a saved draft and a finished state.
Code
Onboarding, the Onboarding story: the files youj add writes.
blocks/app
Reference
Props13 props, 1 types
Props
| Prop | Type | |
|---|---|---|
onFinish | (setup: OnboardingSetup) => unknownCreates the workspace from the answers; resolve to show "You're all set", throw to show why it failed. default a demo wait | a demo wait |
illustration | IllustrationSlotThe welcome step's picture: a scene from the illustrations by id, your own node, or default 'team' | 'team' |
brand | { name: string; logo?: ReactNode }The product the welcome names. default Northwind | Northwind |
defaultValues | Partial<OnboardingSetup>Answers filled in at the start, e.g. the company name from sign-up. | – |
presets | string[]The theme presets to choose from, by id. default every preset | every preset |
step | numberThe open step (0–3), controlled. Pair it with | – |
defaultStep | numberThe step open at first, uncontrolled. default 0 | 0 |
onStepChange | (step: number) => voidCalled with the step a Back, Get started or Continue moves to. | – |
dashboardHref | stringWhere "Open your dashboard" goes; without it the button calls | – |
onOpenDashboard | () => voidCalled from "Open your dashboard". | – |
linkComponent | ElementTypeRenders the dashboard link, e.g. Next.js default 'a' | 'a' |
headingLevel | 1 | 2 | 3The page title's level (visually hidden); step titles sit one below. default 1 | 1 |
copy | Partial<OnboardingCopy>Any of the flow's strings, to rewrite or translate. | – |
OnboardingSetup
| Prop | Type | |
|---|---|---|
nameRequired | string | – |
theme | stringThe picked theme preset's id, else the app's own preset's; undefined when neither is a preset. | – |
invitesRequired | string[] | – |
Strings40 keys for copy
Strings
copy takes any of these keys; the rest keep their defaults. A key whose text holds a value (a count, a name) takes a function.
pagestepperstepWelcomestepWorkspacestepThemestepInvitewelcomeTitlewelcomeDescriptionnameTitlenameDescriptionnameLabelnamePlaceholdernameRequiredurlurlPrefixurlFallbackurlDescriptionthemeTitlethemeDescriptionthemeGroupthemePreviewinviteTitleinviteDescriptionemailemailPlaceholderemailInvalidemailTakenaddinvitesremovebackstartcontinuefinishingfinishedfinishfaileddoneTitledoneDescriptionopenDashboardBuilt from11 components
Built from
Accessibilitylandmarks, headings, forms, progress
Accessibility
Each screen is a main with one heading (h1 by default; headingLevel changes it). Onboarding’s step indicator is labelled, its theme choice is a labelled radio group, and Enter moves to the next step from its text fields. Create workspace announces the result of the address check in a live region. Setup wizard announces step changes in a live region and labels its review sections. Accept invite shows the inviter’s avatar with alt text. Links and buttons are real a and button elements with the kit’s focus ring.