npm install @thrivecart/uiyarn add @thrivecart/uipnpm add @thrivecart/uibun add @thrivecart/uiimport { PageSectionWizard } from '@thrivecart/ui';Wizard header with title and step progress
<SidebarProvider mainNavItems={[]} config={{ defaultSecondaryOpen: false }}>
<div className="w-full border border-border rounded-lg overflow-hidden">
<PageSectionWizard
title="Create Campaign"
currentStep={1}
totalSteps={4}
steps={[
{ id: 'details', label: 'Details' },
{ id: 'content', label: 'Content' },
{ id: 'audience', label: 'Audience' },
{ id: 'review', label: 'Review' },
]}
/>
</div>
</SidebarProvider>When onTitleChange is provided, the title becomes inline-editable. Click the title or the pencil icon to edit. Press Enter to save or Escape to cancel.
Click the title to rename the wizard
<SidebarProvider mainNavItems={[]} config={{ defaultSecondaryOpen: false }}>
<div className="w-full border border-border rounded-lg overflow-hidden">
<PageSectionWizard
title={title}
onTitleChange={setTitle}
onTitleChangeEnd={(newTitle) => console.log('Saved:', newTitle)}
titlePlaceholder="Untitled Campaign"
currentStep={0}
totalSteps={3}
steps={[
{ id: 'details', label: 'Details' },
{ id: 'content', label: 'Content' },
{ id: 'review', label: 'Review' },
]}
/>
</div>
</SidebarProvider>Click completed steps to navigate back
<SidebarProvider mainNavItems={[]} config={{ defaultSecondaryOpen: false }}>
<div className="w-full border border-border rounded-lg overflow-hidden">
<PageSectionWizard
title="Campaign Builder"
currentStep={currentStep}
totalSteps={steps.length}
steps={steps}
onStepClick={setCurrentStep}
/>
</div>
</SidebarProvider>When used inside a Stepper component, PageSectionWizard automatically reads the current step and navigation from context. No need to pass currentStep, totalSteps, or onStepClick.
Automatic step management via Stepper context
import { Stepper, StepperContent, PageSectionWizard } from '@thrivecart/ui';
function CampaignWizard() {
const [activeStep, setActiveStep] = useState('details');
return (
<Stepper value={activeStep} onValueChange={setActiveStep}>
<PageSectionWizard
title="Campaign Builder"
onTitleChange={(title) => updateCampaignName(title)}
steps={[
{ id: 'details', label: 'Campaign Details' },
{ id: 'content', label: 'Email Content' },
{ id: 'audience', label: 'Select Audience' },
{ id: 'review', label: 'Review & Send' },
]}
/>
<StepperContent value="details">
<CampaignDetailsForm />
</StepperContent>
</Stepper>
);
}In a real application, PageSectionWizard sits inside a SidebarProvider alongside SideNavigation. The sidebar toggle button appears when the sidebar is collapsed.
PageSectionWizard inside a SidebarProvider with SideNavigation
<SidebarProvider mainNavItems={[]} config={{ defaultSecondaryOpen: true }}>
<div className="flex h-[400px] w-full border border-secondary overflow-hidden">
<SidebarPanel>
<SidebarPanelHeader>
<SidebarPanelTitle>Navigation</SidebarPanelTitle>
</SidebarPanelHeader>
<SidebarPanelContent>
<SidebarItem
label="Dashboard"
iconOutlined={MdOutlineDashboard}
iconFilled={MdDashboard}
/>
<SidebarItem
label="Campaigns"
iconOutlined={MdOutlineCampaign}
iconFilled={MdCampaign}
isActive
>
<SidebarSubItem label="Templates" />
<SidebarSubItem label="All Campaigns" isActive />
</SidebarItem>
</SidebarPanelContent>
</SidebarPanel>
<div className="flex-1 flex flex-col overflow-hidden">
<PageSectionWizard
title="Create Campaign"
showSidebarToggle
currentStep={1}
totalSteps={4}
steps={[
{ id: 'details', label: 'Details' },
{ id: 'content', label: 'Content' },
{ id: 'audience', label: 'Audience' },
{ id: 'review', label: 'Review' },
]}
/>
<main className="flex-1 overflow-y-auto px-space-2xl">
<div className="max-w-2xl">
<h3 className="font-medium mb-4">Email Content</h3>
<div className="space-y-4">
<div className="h-8 bg-bg rounded w-full" />
<div className="h-32 bg-bg rounded w-full" />
</div>
</div>
</main>
</div>
</div>
</SidebarProvider>If you don't provide steps, the wizard shows a simple "Step X of Y" text.
Minimal step indicator without labels
<SidebarProvider mainNavItems={[]} config={{ defaultSecondaryOpen: false }}>
<div className="w-full border border-border rounded-lg overflow-hidden">
<PageSectionWizard
title="Setup Wizard"
currentStep={2}
totalSteps={5}
/>
</div>
</SidebarProvider>Use stepsContent to render custom content in the steps area instead of the default step indicators.
Replace step indicators with custom content
<SidebarProvider mainNavItems={[]} config={{ defaultSecondaryOpen: false }}>
<div className="w-full border border-border rounded-lg overflow-hidden">
<PageSectionWizard
title="Import Contacts"
stepsContent={
<div className="flex items-center gap-2">
<Button variant="secondary" size="sm">Cancel</Button>
<Button variant="primary" size="sm">Import 234 Contacts</Button>
</div>
}
/>
</div>
</SidebarProvider>Step labels should clearly describe what happens in each step (e.g., "Campaign Details" not "Step 1").
When the wizard creates a named entity (campaign, template), let users name it inline rather than in a separate field.
More than 5 steps feels overwhelming. Group related steps or use sub-steps.
Always set showSidebarToggle when using inside a SidebarProvider so users can re-open a collapsed sidebar.
If users can complete sections in any order, use Tabs instead.
Use one header type per page. Don't combine PageSection and PageSectionWizard.
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | — | Wizard title text |
onTitleChange | (newTitle: string) => void | — | Makes title editable; called on each keystroke |
onTitleChangeEnd | (newTitle: string) => void | — | Called when editing ends (blur or Enter) |
titlePlaceholder | string | 'Untitled' | Placeholder text when title is empty |
currentStep | number | — | Current step index (0-based). Auto-detected from Stepper context if omitted. |
totalSteps | number | — | Total steps. Auto-detected from Stepper context if omitted. |
steps | WizardStepItem[] | — | Step definitions for indicators. Uses Stepper context if omitted. |
onStepClick | (stepIndex: number) => void | — | Called when a step indicator is clicked |
showSidebarToggle | boolean | true | Show sidebar toggle when sidebar is collapsed |
stepsContent | ReactNode | — | Custom content replacing the default step indicators |
className | string | — | Additional className |
onStepClick is providedaria-label