Installation
Usage
Props
Additional CSS classes to apply to the toolbar container
Color class for the active tool item
Callback function for search functionality (reserved for future use)
Features
- Expandable Buttons: Selected tool buttons expand to show label text
- Icon Set: 11 pre-configured tools with Lucide icons
- Notification System: Click feedback with animated notification banner
- Toggle Button: State toggle with Lock/Edit icons
- Smooth Animations: Spring-based transitions for all interactions
- Responsive Layout: Flexbox-based layout that adapts to content
Toolbar Items
The toolbar includes these default tools:- Select - MousePointer2 icon
- Move - Move icon
- Shapes - Shapes icon
- Layers - Layers icon
- Frame - Frame icon
- Properties - SlidersHorizontal icon
- Export - FileDown icon
- Share - Share2 icon
- Notifications - Bell icon
- Profile - CircleUserRound icon
- Appearance - Palette icon
Animation Details
Button Expansion
Notification Banner
- Slides down from top with fade-in
- Shows active tool name
- Auto-dismisses after 1.5 seconds
- Includes animated underline
Example with Custom Handling
Customizing Tools
To modify the toolbar items, edit thetoolbarItems array in the component:
State Management
The component manages three internal states:selected: Currently active tool IDisToggled: Toggle button state (On/Off)activeNotification: Current notification to display
Styling
Active tool button styling:- Blue background (
bg-[#1F9CFE]) - White text
- Rounded corners
- Expanded padding
- Muted text color
- Hover background effect
- No padding expansion
Dependencies
motion(Framer Motion)lucide-react(all toolbar icons)react(useState, useRef hooks)@/lib/utils(cn utility)