---
title: "Morph Popover"
description: "Free React popover that reveals from the corner nearest its trigger on one spring clip, with unscaled content and borders. Side and align aware, shadcn install."
category: "Components"
parent: "https://beui.dev/components/motion/popover"
publishedAt: "2026-07-07"
updatedAt: "2026-11-25"
documentation: "https://beui.dev/components/motion/popover/morph"
markdown: "https://beui.dev/components/motion/popover/morph.md"
license: "MIT"
---

# Morph Popover

> Free React popover that reveals from the corner nearest its trigger on one spring clip, with unscaled content and borders. Side and align aware, shadcn install.

## Install

```bash
npx shadcn@latest add @beui/popover-morph
```

## Dependencies

- `clsx`
- `lucide-react`
- `motion`
- `react`
- `react-dom`
- `tailwind-merge`

## Usage

### Morph Popover usage

Composable MorphPopover, MorphPopoverTrigger, MorphPopoverContent. The full-size panel reveals from the corner nearest the trigger on one synchronized spring clip, keeping content and borders unscaled, then retraces the clip on close. Clip-path and its drop-shadow may paint. Side/align aware, controlled or uncontrolled.

```tsx
"use client";

import { ChevronDown, Copy, Pencil, Share2, Trash2 } from "lucide-react";
import { useState } from "react";
import {
  MorphPopover,
  MorphPopoverContent,
  MorphPopoverTrigger,
} from "@/components/motion/popover-morph";

const ACTIONS = [
  { icon: Pencil, label: "Edit" },
  { icon: Copy, label: "Duplicate" },
  { icon: Share2, label: "Share" },
  { icon: Trash2, label: "Delete" },
];

export function MorphPopoverPreview() {
  const [open, setOpen] = useState(false);

  return (
    <MorphPopover open={open} onOpenChange={setOpen}>
      <MorphPopoverTrigger>
        <button
          type="button"
          className="inline-flex h-10 items-center gap-2 rounded-full border border-border bg-background px-4 text-sm font-medium text-foreground outline-none transition-colors hover:border-border-strong focus-visible:ring-2 focus-visible:ring-ring"
        >
          Options
          <ChevronDown className="h-4 w-4 text-muted-foreground" />
        </button>
      </MorphPopoverTrigger>

      <MorphPopoverContent align="start" className="w-48 p-2">
        {ACTIONS.map(({ icon: Icon, label }) => (
          <button
            key={label}
            type="button"
            onClick={() => setOpen(false)}
            className="flex w-full items-center gap-2.5 rounded-full px-3 py-1.5 text-left text-sm text-foreground outline-none transition-colors hover:bg-muted focus-visible:bg-muted"
          >
            <Icon className="h-4 w-4 text-muted-foreground" />
            {label}
          </button>
        ))}
      </MorphPopoverContent>
    </MorphPopover>
  );
}
```

## API Reference

### MorphPopover

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `open` | `boolean` | — | No | Controlled open state. |
| `defaultOpen` | `boolean` | `false` | No | Uncontrolled initial open state. |
| `onOpenChange` | `((open: boolean) => void)` | — | No | Called with the new open state when the panel opens or closes. |
| `className` | `string` | — | No | Classes merged onto the wrapper around the trigger. |

### MorphPopoverContent

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `side` | `"top" \| "bottom"` | — | No | Preferred side of the trigger. Flips when there is no room. Default: "bottom" |
| `align` | `"start" \| "end"` | — | No | Lines the panel up with the trigger's start or end edge. Default: "end" |
| `sideOffset` | `number` | — | No | Gap between trigger and panel, in px. Default 8. |
| `radius` | `number` | — | No | Panel corner radius, in px. Default 16 (rounded-2xl), like every floating panel. |
| `shadow` | `boolean` | — | No | Draw the surface shadow. Default true. |
| `onOpenAutoFocus` | `((content: HTMLDivElement) => void)` | — | No | Runs after the portalled surface is positioned and visible. Passing it hands focus to the caller: the panel then moves no focus on its own. |
| `initialFocus` | `RefObject<HTMLElement \| null>` | — | No | Element to focus when the trigger opens the panel by keyboard. Defaults to the first focusable element in the panel, or the panel itself. A pointer open does not move focus. Ignored with `onOpenAutoFocus`. |
| `className` | `string` | — | No | Classes merged onto the panel surface. |

## More in Popover

- [Gooey Popover](https://beui.dev/components/motion/popover/gooey.md)

## Source

- Registry detail: https://beui.dev/r/popover-morph
- Raw source: https://beui.dev/r/popover-morph/raw
- GitHub: https://github.com/starc007/ui-components
