Onboarding & Flows
Toolbar Expandable
Expandable toolbar for React and shadcn/ui that opens into a scrollable step-by-step panel, for onboarding and feature tours.
Updated
Dynamic Toolbar Expandable
Sophisticated expandable toolbar with smooth animations and step-based navigation for complex workflows.
Controlled Usage
External state management for programmatic control
Deployment Workflow
5-step process with internal state management
Download Configuration
2-step process for download preferences
Features
Key capabilities and technical highlights
Toolbar Expandable is a React toolbar component for shadcn/ui built on Motion and Radix Scroll Area. Use it for onboarding flows, feature tours, or compact settings menus that open from a single bar.
References
Inspiration
Installation
pnpm dlx shadcn@latest add @cult-ui/toolbar-expandable
Usage
import ToolbarExpandable from "@/components/ui/toolbar-expandable";Basic Usage
const steps = [
{
id: "step1",
title: "First Step",
description: "Description of the first step",
icon: Settings,
content: <div>Step 1 content</div>,
},
// ... more steps
]
<ToolbarExpandable steps={steps} badgeText="WORKFLOW" />Controlled Usage
const [expanded, setExpanded] = useState(false)
const [activeStep, setActiveStep] = useState<string | null>(null)
<ToolbarExpandable
steps={steps}
badgeText="CONTROLLED"
expanded={expanded}
onExpandedChange={setExpanded}
activeStep={activeStep}
onActiveStepChange={setActiveStep}
/>API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
steps | DynamicStep[] | - | Array of step objects defining the toolbar content |
badgeText | string | - | Text displayed in the badge |
className | string | - | Additional CSS classes |
expanded | boolean | - | Controlled expanded state |
onExpandedChange | (expanded: boolean) => void | - | Callback for expanded state changes |
activeStep | string | null | - | Controlled active step ID |
onActiveStepChange | (stepId: string | null) => void | - | Callback for active step changes |
DynamicStep Interface
interface DynamicStep {
id: string;
title: string;
description: string;
icon:
| React.ComponentType<{ className?: string }>
| React.ReactElement<{ className?: string }>;
content: React.ReactNode;
}| Property | Type | Description |
|---|---|---|
id | string | Unique identifier for the step |
title | string | Display title for the step |
description | string | Description text for the step |
icon | React.ComponentType or React.ReactElement | Icon component or element |
content | React.ReactNode | Content to display when step is active |
Examples
Deployment Workflow
const deploymentSteps = [
{
id: "setup",
title: "Project Setup",
description: "Initialize your project with the required dependencies.",
icon: Settings,
content: <ProjectSetupForm />,
},
{
id: "configure",
title: "Configuration",
description: "Set up environment variables and project settings.",
icon: Database,
content: <ConfigurationForm />,
},
{
id: "deploy",
title: "Deploy",
description: "Deploy your application to production.",
icon: Rocket,
content: <DeploymentForm />,
},
]
<ToolbarExpandable steps={deploymentSteps} badgeText="DEPLOYMENT" />Download Configuration
const downloadSteps = [
{
id: "format",
title: "Choose Format",
description: "Select the download format that best suits your needs.",
icon: Download,
content: <FormatSelector />,
},
{
id: "options",
title: "Download Options",
description: "Configure additional options for your download.",
icon: Settings,
content: <OptionsForm />,
},
]
<ToolbarExpandable steps={downloadSteps} badgeText="DOWNLOAD" />Dependencies
The component requires the following dependencies:
motion- For animations@radix-ui/react-scroll-area- For enhanced scrolling@/components/ui/badge- For the badge component
Accessibility
The component includes several accessibility features:
- Proper ARIA roles and descriptions
- Keyboard navigation support
- Screen reader friendly
- Focus management
- Touch-friendly interactions
Performance
The component is optimized for performance with:
- Memoized components to prevent unnecessary re-renders
- Efficient state management
- Optimized animations
- Lazy loading of content
- Minimal DOM updates
Browser Support
The component supports all modern browsers and includes:
- Touch device optimization
- Fallbacks for older browsers
- Progressive enhancement
- Responsive design patterns