Multistep Onboarding Flow
clerk/nextjs-custom-flows-multistep-onboardingFreeBlock
A custom sign-up and sign-in onboarding flow using Clerk's useSignIn and useSignUp hooks with animated step transitions.
Install it
npx shadcn@latest add https://clerk.com/r/nextjs-custom-flows-multistep-onboarding.jsonSource
1'use client';23import { AnimatePresence, motion, useReducedMotion } from 'motion/react';4import { useState, useCallback, useMemo, useEffect, useRef } from 'react';5import { useRouter } from 'next/navigation';6import { useForm } from '@tanstack/react-form';7import { useSignIn, useSignUp, useOrganizationList, useOrganizationCreationDefaults, useSession } from '@clerk/nextjs';8import { Button } from '@/components/ui/button';9import { Checkbox } from '@/components/ui/checkbox';10import { Field, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSet } from '@/components/ui/field';11import { Input } from '@/components/ui/input';12import { InputOTP, InputOTPGroup, InputOTPSlot } from '@/components/ui/input-otp';13import { REGEXP_ONLY_DIGITS } from 'input-otp';14import { RefreshCwIcon, ChevronLeftIcon, LoaderIcon, CameraIcon, XIcon } from 'lucide-react';15import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group';16import { Testimonials } from '@/components/ui/testimonials';1718type Step = 'email' | 'welcome' | 'company' | 'account' | 'verify' | 'org';19type VerifyMode = 'sign_up_email_code' | 'client_trust_email_code' | null;2021function toFieldErrors(errors: unknown[]): { message: string }[] {22 return errors.map(e => ({23 message: typeof e === 'string' ? e : String(e),24 }));25}2627const SIGNUP_STEPS: Step[] = ['company', 'account', 'verify', 'org'];2829const STEP_FIELDS: Record<Step, string[]> = {30 email: ['email'],31 welcome: ['password'],32 company: ['companySize'],33 account: ['firstName', 'lastName', 'password', 'agreedToTerms'],34 verify: ['otpCode'],35 org: ['orgName'],36};3738const COMPANY_SIZES = ['1-10', '11-50', '51-200', '201-500', '501-1000', '1000+'] as const;3940const QUOTES = [41 {42 quote:43 'This has completely reshaped how our team thinks about onboarding. The flow is intuitive, the defaults feel right, and our activation numbers jumped within the very first week of rolling it out.',44 cite: 'Maya Chen, CTO',45 },46 {47 quote:48 'Adopting it saved our small engineering team months of work. The primitives are flexible enough to fit our brand, secure enough for our enterprise customers, and the team behind it actually listens to feedback and ships fixes fast.',49 cite: 'Jordan Whitfield, Head of Engineering',50 },51 {52 quote:53 "We rebuilt our entire signup experience in an afternoon. It's easily the best developer experience we've had all year.",54 cite: 'Priya Anand, Co-founder',55 },56];5758const dotVariants = {59// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from clerk
All 12 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Multistep Onboarding Flow (AIO)nextjs-aio-multistep-onboarding | clerk | Blocks | Free | 5 deps · 6 files | |
| Layout with Headernextjs-layout-with-header | clerk | Blocks | Free | 3 deps | |
| Clerk Next.js Quickstart (App Router)nextjs-quickstart | clerk | Blocks | Free | 3 deps · 3 files | |
| Clerk Next.js Quickstart — Sign-in-or-up (App Router)nextjs-quickstart-sign-in-or-up | clerk | Blocks | Free | 3 deps · 2 files | |
| Clerk Next.js Sign In Page (App Router)nextjs-sign-in-page | clerk | Blocks | Free | 1 dep | |
| Clerk Next.js Sign Up Page (App Router)nextjs-sign-up-page | clerk | Blocks | Free | 2 deps | |
| Clerk Next.js Waitlist Page (App Router)nextjs-waitlist-page | clerk | Blocks | Free | 1 dep |
