shadcn examples svg logo
488

Command Palette

Search for a command to run...

Sign inGet All Access

Shadcn Onboarding Flow

Onboarding Flow is a full-page account setup wizard block presented as a single centered card with a step indicator on top. Users pick a personal or corporate account with Shadcn UI radio cards, then move through team setup, company details with an industry select, and a payment step featuring live card number formatting, expiry and CVV fields, and a save-card switch. Form data and navigation live in a Zustand store, and each step validates in React before continuing, surfacing inline error messages. Styled entirely with Tailwind, it is available in React, Vuejs, and Svelte versions.

Pro
Onboarding Flow preview

Other Onboarding Flows Examples

Get Unlimited Access to All Examples & Blocks.
Unlock everything with a single payment. Get lifetime access to all content. You will also receive free access to all new examples.

A Five Step Signup Wizard in a Single Card

Onboarding Flow is a self contained signup wizard block that lives inside one centered Shadcn UI Card, capped at max-w-2xl and rendered with React and Tailwind utilities. Five stages take a new user from choosing an account type all the way to a confirmation screen, and every stage swaps in and out of the same CardContent area, so the page never navigates away. If you are collecting anything from plan choices to payment details during activation, this block gives you the full skeleton instead of a bare stepper, and it pairs naturally with the broader wizard patterns in the multi step forms collection.

What Each Step Collects, From Account Type to Billing

Step one presents two selectable tiles, Personal and Corporate, built as plain buttons that light up with border-primary and a ring when active. Step two mixes a team size button grid, a required team name Input, and a RadioGroup of three account plans, each with its own lucide icon and description. Step three gathers business details through Inputs and an industry Select, step four is a complete billing form with card number, expiry month and year Selects, CVV, and a save card Switch, and step five closes with an emerald check circle plus an Account Summary panel that echoes back everything the user picked before a Start Over button resets the whole flow.

Zustand Keeps the Answers, useState Keeps the Errors

The wizard's memory lives in a small Zustand store defined in store.ts. It tracks currentStep and a typed FormData object, exposes next and prev actions clamped between steps one and five, a generic update helper for any field, and a reset action. Because the store sits outside the component tree, answers survive as the user moves back and forth between steps.

Validation stays local and honest: a validateStep function checks the rules for the current stage, requiring a team name, a company name and industry, a full sixteen digit card number, expiry selections, and a three digit CVV. Failures land in a useState error string rendered in text-destructive above the navigation row, and a formatCardNumber helper groups typed digits into blocks of four as the user types.

The Responsive Step Indicator

StepIndicator is its own component with two renderings. On desktop it draws five numbered circles joined by connector lines, where finished steps collapse into check marks on a bg-primary disc and the active step gains a soft ring-primary/20 halo. On mobile the circles give way to the current step title, a Step X of 5 counter, and a slim segmented progress bar, so the wizard stays legible on narrow screens without horizontal cramming.

Styling With Shadcn UI Tokens

Every color in the block resolves through Shadcn UI CSS variables: primary for selection states, muted and muted-foreground for secondary text and idle circles, destructive for validation messages, and border for dividers. Change those tokens in globals.css and the entire wizard follows, in light and dark mode alike, with zero hardcoded hex values to hunt down. The components involved are Button, Card, Input, Label, Radio Group, Select, Switch, and Separator. The wizard is not limited to React either: identical Vuejs and Svelte builds exist, created on top of the shadcn-vue and shadcn-svelte ports, so the same design drops into any of the three ecosystems.

Unlocking and Installing the Flow

Onboarding Flow sits on the Pro tier, so the code tab and the registry install unlock once you hold an All Access license. After that, a shadcn CLI snippet waits at the top of the example page with tabs for npm, pnpm, yarn, and bun, and if you prefer manual control you can copy page.tsx, the onboarding component, the step indicator, and the store straight from the code tab into your project.

Frequently Asked Questions

How many steps does this onboarding wizard have?
Five in total: account type selection, account info with team size and plan, business details, billing, and a closing summary screen. The step count is a plain constant in the store and the indicator, so trimming or extending the sequence is a matter of editing the STEPS array and adding a case to the render switch.
What happens to entered data when I click Back?
Nothing is lost. All answers live in a Zustand store outside the React component tree, so navigating backward with prev and forward again with next shows the fields exactly as the user left them. Only the transient error message, held in local useState, is cleared on navigation.
How strict is the billing step validation?
The validateStep function requires a name on card, a full sixteen digit number (the input auto formats digits into groups of four), an expiration month and year picked from Selects, and a CVV of at least three digits. It is front end validation only, ready for you to connect to a real payment provider.
Can I add or remove steps from the flow?
Yes. Add an entry to the STEPS array in step-indicator.tsx, extend the FormData interface and defaults in store.ts, raise the clamp limit in the next action, and add a case to renderStep. Because state, validation, and UI are separated, each edit is local and low risk.
What does the confirmation screen actually show?
A large emerald check inside a ringed circle, a success headline, and an Account Summary card that lists account type, plan, and, when provided, company and team names with matching lucide icons. A full width Button calls the store's reset action to restart the wizard from step one.