Skip to content
caliper ui pro docs

Morph surface

A floating surface that grows out of the element that opened it.

Pro

Targets for the billing launch, the hiring plan for Platform and the two migrations left before year end.

When to use

  • Building your own menus, pickers and cards that should feel attached to their trigger.
  • You need the shared overlay frost and edge.

When not to use

  • A standard menu or popover already fits.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/morph-surface

Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

MorphSurface

8 props

Also accepts the native props of its root element and a ref.

PropTypeDefaultDescription
open *boolean—
originRef *RefObject<HTMLElement | null>—
placement"center" | "below""below""below" opens under the origin; "center" opens in the middle of the screen near the top.
widthnumber | "origin"280Pixels, or "origin" to match the origin's width at least.
gapnumber6
radiusnumber12
onExited(() => void)—
onOpenChange((open: boolean) => void)—Called with false on Escape or a press outside the panel and its origin; focus returns to the origin on Escape.

Keyboard

  • No custom key handling; Tab and the native activation keys do the work.

Accessibility

It is built on native elements, so roles and focus come from the browser.

Motion

  • State changes animate with the library's shared durations and curves, so its timing matches every other part.
  • Under reduced motion each change lands on its end state without movement; nothing is hidden or skipped.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/morph-surface.md

The index of every part is at /llms.txt.

More in Modal