---
title: "Morph Menu"
description: "A menu pill that springs into a panel of links. The box grows on its own springs, the lines turn into a cross, and each link bounces in."
url: https://gelatinui.com/components/morph-menu
markdown_url: https://gelatinui.com/components/morph-menu.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/morph-menu"
version: "2026-11-21"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Morph Menu

> A menu pill that springs into a panel of links. The box grows on its own springs, the lines turn into a cross, and each link bounces in.

Page: https://gelatinui.com/components/morph-menu

## When to use it

Best for: A short list of site places behind one pill, where the open panel should feel part of the button.

- Use it for four to eight top-level links, with a count or a New tag in `MorphMenuItemMeta`.
- Use `side="end"` for a pill at the end of a header: the box grows toward the start and down.
- Put actions such as Sign in and Get Pro in `MorphMenuFooter`: they rise in after the links.

## When not to use it

- For a desktop top bar with dropdown panels of link cards, use a [Navigation Menu](https://gelatinui.com/components/navigation-menu.md).
- For a long tree of pages on a phone, use a [Drawer](https://gelatinui.com/components/drawer.md).
- To pick one value from a list, use a [Morph Select](https://gelatinui.com/components/morph-select.md).

## Notes for agents

- Compose `MorphMenu` > `MorphMenuTrigger` (`MorphMenuBrand`, `MorphMenuToggle`) and `MorphMenuContent` > `MorphMenuList` > `MorphMenuListItem` > `MorphMenuItem`.
- `MorphMenuItem` renders an `a`. Pass `href`, or your router link through `render` (`render={<Link to="/docs" />}`). Set `current` on the link of the open page.
- `side="center"` (default) grows from the middle of the pill to both sides; `start` and `end` grow from that edge. The pill top stays put: the box grows down.
- `open`, `defaultOpen`, and `onOpenChange` control it. A link press, Escape, and a press outside close it.
- Give the Trigger an `aria-label` (for example "Site menu"), and wrap the list in a `nav` with its own label.

## Anatomy

```text
MorphMenu
├─ MorphMenuTrigger (0..n)
├─ MorphMenuBrand (0..n)
├─ MorphMenuToggle (0..n)
├─ MorphMenuContent (0..n)
├─ MorphMenuList (0..n)
├─ MorphMenuItem (0..n)
├─ MorphMenuListItem (0..n)
├─ MorphMenuItemMeta (0..n)
└─ MorphMenuFooter (0..n)
```

## API reference

### MorphMenu

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `open` | `boolean` |  | Whether the menu is open (controlled). |
| `defaultOpen` | `boolean` |  | Whether the menu is open at first (uncontrolled). Default `false`. |
| `onOpenChange` | `function` |  | Called when the menu opens or closes. |
| `size` | `"default" \| "sm"` | "default" | The pill size: `sm` is 44px tall, `default` 52px. |
| `side` | `"center" \| "end" \| "start"` | "center" | Where the box grows from. `center` (default) grows out from the middle of the pill to both sides; `start` grows toward the end and `end` toward the start. The pill's top edge stays put in every case: the box only grows down. |

Also takes every prop of Base UI `Collapsible.Root`: https://base-ui.com/react/components/collapsible

### MorphMenuTrigger

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### MorphMenuBrand

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### MorphMenuToggle

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### MorphMenuContent

Also takes every prop of Base UI `Collapsible.Panel`: https://base-ui.com/react/components/collapsible

### MorphMenuList

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### MorphMenuItem

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `current` | `boolean` | false | Marks the link of the current page: it keeps the fill and gets `aria-current="page"`. |
| `closeOnClick` | `boolean` | true | Close the menu when the link is pressed. Default `true`. |

Also takes every prop of Base UI `UseRender`: https://base-ui.com/react/components/use-render

### MorphMenuListItem

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### MorphMenuItemMeta

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### MorphMenuFooter

No props of its own: `className`, `children`, and every other prop go to the element it renders.

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| MorphMenu | `morph-menu` | `data-open` |  |  |
| MorphMenuTrigger | `morph-menu-trigger` | `data-disabled` |  |  |
| MorphMenuBrand | `morph-menu-brand` |  |  |  |
| MorphMenuToggle | `morph-menu-toggle` |  |  |  |
| MorphMenuContent | `morph-menu-content` | `data-ending-style`, `data-instant`, `data-trigger-focus` |  |  |
| MorphMenuList | `morph-menu-list` |  | `--radius` |  |
| MorphMenuItem | `morph-menu-item` | `data-current` | `--radius` |  |
| MorphMenuListItem | `morph-menu-list-item` |  |  |  |
| MorphMenuItemMeta | `morph-menu-item-meta` |  |  |  |
| MorphMenuFooter | `morph-menu-footer` |  |  |  |

## Usage

Compose the trigger and the links as parts; each link is a real `a`.

```tsx title="site-menu.tsx"
import {
  MorphMenu,
  MorphMenuBrand,
  MorphMenuContent,
  MorphMenuItem,
  MorphMenuItemMeta,
  MorphMenuList,
  MorphMenuListItem,
  MorphMenuToggle,
  MorphMenuTrigger,
} from "@/components/ui/pro/morph-menu";

export function SiteMenu() {
  return (
    <MorphMenu>
      <MorphMenuTrigger aria-label="Site menu">
        <MorphMenuBrand>Studio</MorphMenuBrand>
        <MorphMenuToggle />
      </MorphMenuTrigger>
      <MorphMenuContent>
        <nav aria-label="Site">
          <MorphMenuList>
            <MorphMenuListItem>
              <MorphMenuItem href="/work">
                Work
                <MorphMenuItemMeta>12</MorphMenuItemMeta>
              </MorphMenuItem>
            </MorphMenuListItem>
            <MorphMenuListItem>
              <MorphMenuItem href="/about" current>
                About
              </MorphMenuItem>
            </MorphMenuListItem>
            <MorphMenuListItem>
              <MorphMenuItem href="/journal">
                Journal
                <MorphMenuItemMeta>New</MorphMenuItemMeta>
              </MorphMenuItem>
            </MorphMenuListItem>
            <MorphMenuListItem>
              <MorphMenuItem href="/contact">Contact</MorphMenuItem>
            </MorphMenuListItem>
          </MorphMenuList>
        </nav>
      </MorphMenuContent>
    </MorphMenu>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui-pro/morph-menu
```

It adds 11 registry items: 10 files, 2817 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `clsx`, `motion`, `tailwind-merge`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Navigation Menu](https://gelatinui.com/components/navigation-menu.md)
- [Morph Select](https://gelatinui.com/components/morph-select.md)
- [Collapsible](https://gelatinui.com/components/collapsible.md)
- [Dynamic Island](https://gelatinui.com/components/dynamic-island.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Enter, Space | On the trigger, opens or closes the menu, with no motion. |
| Down Arrow, Up Arrow | Moves the focus to the next or the previous link. |
| Home, End | Moves the focus to the first or the last link. |
| Escape | Closes the menu and gives the focus back to the trigger. |
| Tab | Moves through the links and the footer actions. |

## Accessibility

It is a Base UI Collapsible: the trigger is a button with `aria-expanded`, and it controls the panel of links.

Closed, the panel is `inert`: its links are out of the tab order and hidden from screen readers.

The focus ring of the trigger is drawn on the whole box, closed and open.

## Motion

| Part | Motion |
| --- | --- |
| Box width | chartTooltip · a spring with a small overshoot, about 300ms · the pill grows to the panel width |
| Box height | chartTooltip · the same spring 1.12× slower · the height lands after the width, so the box morphs; on close it squashes a little below the pill and bounces back |
| Toggle and corners | chartPop · the lines meet as they turn to ±45°, a little past it, and the corners go from 26 to 22px |
| Links | chartTooltip · each link rises 18px on its own spring, 80ms after the open and 50ms apart; on close the last goes first, 30ms apart |
| Highlight | glide · one highlight slides to the link under the pointer |
| Keyboard | none · a keyboard open or close shows the end state at once |
