Installation
Usage
import { Home, Layers, Settings } from "lucide-react"
import { MorphFloatingMenu } from "@/components/ui/morph-floating-menu"
export default function Example() {
return (
<MorphFloatingMenu
items={[
{ id: "home", label: "Home", icon: <Home />, href: "/" },
{
id: "components",
label: "Components",
icon: <Layers />,
href: "/docs",
},
{
id: "settings",
label: "Settings",
icon: <Settings />,
onSelect: () => {},
},
]}
/>
)
}Click the pill — the shell morphs and reveals navigation. Escape or click outside to close.
Props
MorphFloatingMenu
| Prop | Type | Default |
|---|---|---|
items | MorphFloatingMenuItem[] | required |
position | "top" | "bottom" | "inline" | "bottom" |
align | "start" | "center" | "end" | "center" |
open | boolean | — |
defaultOpen | boolean | false |
onOpenChange | (open: boolean) => void | — |
onItemSelect | (item: MorphFloatingMenuItem) => void | — |
closeOnSelect | boolean | true |
triggerLabel | ReactNode | "Menu" |
triggerIcon | ReactNode | Menu icon |
label | string | "Navigation" |
offset | number | 24 |
reveal | boolean | true |
inline keeps the shell in normal flow (useful in docs previews).
MorphFloatingMenuItem
| Prop | Type | Default |
|---|---|---|
id | string | required |
label | ReactNode | required |
icon | ReactNode | — |
href | string | — |
onSelect | () => void | — |
disabled | boolean | — |