Try:
How to use
01Import the component
import { ChatOnboarding } from '@/components/shitui/ChatOnboarding';02Quick Start
Render Chat Onboarding with modern built-in AI developer onboarding defaults.
export default function OnboardingModal() {
return (
<div className="flex min-h-[500px] w-full items-center justify-center p-4">
<ChatOnboarding
brandName="Acme AI"
onComplete={(answers) => {
console.log('Onboarding completed:', answers);
// Send to your backend API or database
}}
/>
</div>
);
}03Custom Questions & Types
Pass your own questions with single-select, multi-select, and custom validation.
import { ChatOnboarding, type OnboardingStep } from '@/components/shitui/ChatOnboarding';
const customSteps: OnboardingStep[] = [
{
id: 'name',
label: 'Full Name',
question: "What's your full name?",
placeholder: 'Enter your name',
type: 'text',
},
{
id: 'workspace',
label: 'Workspace',
question: (ans) => `Great to meet you, ${ans.name}! What should we name your workspace?`,
placeholder: 'My AI Studio',
type: 'text',
},
{
id: 'plan',
label: 'Plan',
question: 'Select your team tier',
type: 'single-select',
options: ['Starter', 'Pro', 'Enterprise'],
},
{
id: 'goals',
label: 'Goals',
question: 'What are your main goals?',
helperText: 'Select all that apply',
type: 'multi-select',
options: ['Code Generation', 'Automated Testing', 'Internal Chatbot', 'Other'],
},
];
export default function CustomOnboarding() {
return (
<ChatOnboarding
brandName="Nexus"
steps={customSteps}
accentColor="#3074fe"
confirmButtonText="Launch"
onComplete={(answers) => fetch('/api/user/setup', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(answers),
})}
/>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| brandName | string | 'Shit AI' | Brand name displayed in the chat header and completion headline. |
| steps | OnboardingStep[] | DEFAULT_ONBOARDING_STEPS | Array of onboarding steps with type, questions, options, and validators. |
| accentColor | string | '#3074fe' | Accent hex color for user chat bubbles, primary action buttons, and active options. |
| successColor | string | '#22c55e' | Hex color for the celebration checkmark, comet trail, and burst particles. |
| confirmButtonText | string | 'Launch' | Label text for the final confirmation button on the review step. |
| expandedHeight | number | 420 | Height in pixels when expanded into interactive chat mode. |
| initialPlaceholder | string | steps[0].placeholder | Placeholder text displayed in the compact initial input pill. |
| completionTitle | string | ((answers: OnboardingAnswers) => string) | Welcome to {brandName}, {name}! | Custom headline string or dynamic callback displayed upon completion. |
| completionSubtitle | string | 'Your AI workspace is configured and ready.' | Subtitle text displayed below the completion headline. |
| autoFocus | boolean | false | Whether the initial compact input pill automatically focuses on mount. |
| onComplete | (answers: OnboardingAnswers) => void | undefined | Callback function triggered with all collected answers when confirmed. |
| onStepChange | (stepIndex: number, step: OnboardingStep) => void | undefined | Callback function triggered whenever the active question step changes. |
| onReset | () => void | undefined | Callback function triggered when the user resets or restarts the onboarding flow. |
| logo | React.ReactNode | <DefaultBrandLogo /> | Custom brand logo rendered inside the compact pill and chat header. |
| className | string | undefined | Optional CSS class name applied to the outer container. |