Loading...
Installation
Usage
import DockMorph from "@/components/ruixen/dock-morph";
import { Home, Search, Bell, User, Settings } from "lucide-react";
const dockItems = [
{
icon: <Home className="h-6 w-6" />,
label: "Home",
onClick: () => alert("Home clicked"),
},
{
icon: <Search className="h-6 w-6" />,
label: "Search",
onClick: () => alert("Search clicked"),
},
{
icon: <Bell className="h-6 w-6" />,
label: "Notifications",
onClick: () => alert("Notifications clicked"),
},
{
icon: <User className="h-6 w-6" />,
label: "Profile",
onClick: () => alert("Profile clicked"),
},
{
icon: <Settings className="h-6 w-6" />,
label: "Settings",
onClick: () => alert("Settings clicked"),
},
];
export default function App() {
return <DockMorph items={dockItems} position="bottom" />;
}
Props
Prop | Type | Default | Description |
---|---|---|---|
items | Array<{icon: ReactNode, label: string, onClick?: function}> | Default items | Array of dock items |
position | "bottom" | "top" | "left" | "bottom" | Dock positioning |
className | string | "" | Additional CSS classes |
Features
- Morphic Bubbles: Glassmorphism bubbles appear on hover
- Multi-Position: Support for bottom, top, and left positioning
- Gradient Effects: Primary color gradients with transparency
- Tooltips: Positioned tooltips based on dock location
- Scale Animation: Smooth hover scaling effects
Position Variants
- Bottom: Fixed at bottom center with horizontal layout
- Top: Fixed at top center with horizontal layout
- Left: Fixed at left center with vertical layout
Bubble Effect
The morphic glass bubble uses:
- Gradient backgrounds with primary color
- Backdrop blur for glassmorphism
- Scale animations from 0.6 to 1.4
- Shadow effects for depth