Drop-in onboarding flows for Next.js + shadcn/ui. Define steps as data, get structured answers back.
onboarding-kit.mp4
npx shadcn@latest add "https://the-onboarding-kit.vercel.app/r/onboarding-kit.json"This installs all components, hooks, and dependencies (Framer Motion, Zod, and required shadcn primitives) automatically.
- Next.js 15+ (App Router)
- Tailwind CSS v4
- shadcn/ui initialized (
npx shadcn init)
import { useState } from "react";
import { Survey } from "@/components/survey/survey";
import type { QuestionConfig } from "@/components/survey/survey-types";
interface Attrs {
name?: string;
role?: string;
}
const steps: QuestionConfig<Attrs>[] = [
{
id: "name",
title: "What's your name?",
type: "text",
placeholder: "Jane Doe",
},
{
id: "role",
title: "What's your role?",
type: "radio",
variant: "button",
options: [
{ value: "engineer", label: "Engineer" },
{ value: "designer", label: "Designer" },
{ value: "pm", label: "Product Manager" },
],
},
];
export default function Onboarding() {
const [attrs, setAttrs] = useState<Attrs>({});
return (
<Survey
questions={steps}
attributes={attrs}
onAttributeChange={setAttrs}
onComplete={(final) => console.log(final)}
showProgress
logo={<span className="text-lg font-bold">My App</span>}
/>
);
}| Type | Value | Auto-advances |
|---|---|---|
info |
— | |
text |
string |
|
number |
number |
|
textarea |
string |
|
radio |
string |
Yes |
boolean |
boolean |
Yes |
card-checkbox |
string[] |
|
slider |
number |
|
rating |
number |
Yes |
Radio supports variant: "button" (list) or "card" (grid). Boolean renders as Yes/No. Card-checkbox supports singleSelection mode.
{
id: "followUp",
title: "Tell us more",
type: "text",
condition: (attrs) => attrs.role === "engineer",
}import { z } from "zod";
{
id: "email",
title: "Your email",
type: "text",
validationSchema: z.string().email(),
validationErrorMessage: "Enter a valid email",
}<Survey rightImage="/hero.png" /> // Image panel
<Survey rightContent={<Custom />} /> // Custom panel
<Survey hideRightPanel /> // Centered, no panelReact 19, Next.js 16, Tailwind CSS v4, shadcn/ui, Framer Motion, Zod
MIT