AI SDK Agents
Full Stack AI Patterns
Complex AI Agents
Workflow Patterns
Tools + Artifacts
Sophisticated expandable toolbar with smooth animations and step-based navigation for complex workflows.
External state management for programmatic control
5-step process with internal state management
2-step process for download preferences
Key capabilities and technical highlights
Inspiration
pnpm dlx shadcn@latest add https://cult-ui.com/r/toolbar-expandable.json
import ToolbarExpandable from "@/components/ui/toolbar-expandable"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" />
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}
/>| 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 |
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 |
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" />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" />The component requires the following dependencies:
motion - For animations@radix-ui/react-scroll-area - For enhanced scrolling@/components/ui/badge - For the badge componentThe component includes several accessibility features:
The component is optimized for performance with:
The component supports all modern browsers and includes: