Micro-interactions

Grow Dialog

A dialog that grows out of the clicked element and shrinks back into it, entirely inside a portal — never behind page content.

Install

bun add motion lucide-react clsx tailwind-merge

Then copy 2 files into your project:

  • components/registry/grow-dialog/grow-dialog.tsx
  • lib/utils.ts

Props

PropTypeDefaultDescription
stiffnessnumber320Spring stiffness of the grow.
dampingnumber34Spring damping — lower rings longer.
radiusnumber16Panel corner radius.
blurBackdropbooleantrueFrosted blur on the backdrop scrim.
autoFocusbooleantrueFocus the first focusable element on open.

What It Demonstrates

Origin-aware animation
An element animates out of its trigger, like a popover growing from the button that opened it instead of from its own center which is the default in CSS.
Scale in
Element grows from smaller to full size as it appears, often paired with a fade.
Transform origin
The anchor point a scale or rotation grows or spins from.
Enter / Exit
The animation an element plays when it's added to or removed from the screen.
Continuity transition
A change that keeps the user oriented by visually connecting before and after. For example, making the same rectangle bigger and smaller.

Related Components

Appears In