Motoko UI Released — Explore the components

Morph Floating Menu

A compact floating pill that morphs into a navigation menu with staggered motion.

Installation

pnpm dlx shadcn@latest add @motokoui/morph-floating-menu

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

PropTypeDefault
itemsMorphFloatingMenuItem[]required
position"top" | "bottom" | "inline""bottom"
align"start" | "center" | "end""center"
openboolean
defaultOpenbooleanfalse
onOpenChange(open: boolean) => void
onItemSelect(item: MorphFloatingMenuItem) => void
closeOnSelectbooleantrue
triggerLabelReactNode"Menu"
triggerIconReactNodeMenu icon
labelstring"Navigation"
offsetnumber24
revealbooleantrue

inline keeps the shell in normal flow (useful in docs previews).

MorphFloatingMenuItem

PropTypeDefault
idstringrequired
labelReactNoderequired
iconReactNode
hrefstring
onSelect() => void
disabledboolean