Component Demo
Dynamic Toolbar Expandable
Sophisticated expandable toolbar with smooth animations and step-based navigation for complex workflows.
Controlled Usage
External state management for programmatic control
expanded: false • active: null
CONTROLLED
Deployment Workflow
5-step process with internal state management
DEPLOYMENT
Download Configuration
2-step process for download preferences
DOWNLOAD
Features
Key capabilities and technical highlights
Smooth Animations
Framer Motion with spring transitions
Responsive Design
Fully responsive with mobile optimization
Enhanced Scrolling
Automatic fade masks and touch support
Performance Optimized
Memoized components and callbacks
Controllable State
Controlled and uncontrolled patterns
TypeScript Support
Fully typed with comprehensive interfaces
References
Inspiration
Installation
pnpm dlx shadcn@latest add https://cult-ui.com/r/toolbar-expandable.json
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
AI SDK Agents
100+ AI Patterns
Real world AI SDK v6 patterns. Copy and paste.
Complex AI Agents
Workflow Patterns
Tools + Artifacts
Browse Patterns