Use it for a small task anchored to the thing it changes: rename a file from its row, set a limit from a settings card, confirm a revoke next to the key it revokes, or show a member's details when the pointer rests on their name. It keeps the person in place: no page change, no full dialog. For a list of actions pick the dropdown menu; for a choice from many values the combobox; for a long form or anything that needs the whole screen the morphing dialog.
The motion follows the three beats. Pressing the button charges: it sinks under the finger. On release it acts: a copy of the button's surface grows into the panel, opaque from its first frame and never bouncing, while the button's label travels, letters never stretched, to become the panel's title. It settles as the panel's parts rise in one after another (description, fields, then the actions last) and focus lands in the first field; its ring waits until the panel has landed. Closing plays it back: the parts leave first, the panel contracts into the button with its title, and the label lands on the button again. The button itself never leaves its place. calm shortens and quiets all of this, playful lets the parts rise with more spring; the surface never bounces.
Put the trigger's text in Popover.Label and the same text in Popover.Title: that is the label that travels. Each direct child of Popover.Body rises in turn, Popover.Actions rises last. open is controlled or uncontrolled; onOpenChange(false) fires as closing starts, so focus is back on the trigger while the panel contracts. Close the popover yourself when a save succeeds. Popover.Error shows a failed action above the buttons (role="alert", the panel makes room on a calm spring); pending on the content sets aria-busy and on a Popover.Button swaps its label for a turning arc while keeping its width. Popover.Anchor anchors the panel to another element (a filter chip, a table cell).
Pick a layout with preset: form (default, 320 px), confirm (280 px; add destructive on the content for a calm, never bouncing destructive confirm) or card (288 px, a hover card: it opens after openDelay when the pointer rests on the trigger and closes closeDelay after it leaves; touch taps). Panel width size is sm (240 px), md (the preset's) or lg (400 px), always clamped to the viewport. The trigger takes size (sm, md, lg), variant (outline, or ghost for an inline name) and asChild for your own element. Set the character app-wide with MotionKitProvider, or per popover with temperament; the look never changes.
Add solid on the root (default off) when the panel must never read as an empty tile: its rim and fill are drawn in every frame of the morph, and its content fades in from 35% of the opening and out in the first 40% of the closing.
The confirm preset in a settings list: "Revoke" becomes a one-sentence confirm with a destructive button. With destructive the whole popover moves calmly whatever the temperament, and the button shows its arc while the request runs. The row leaves only after the panel is back in its button.
The card preset on a ghost trigger: resting on a name for 400 ms opens a details card (a 32 px initials ball, role, team, local time). It never takes focus; a click pins it open, a tap opens it on touch screens.
Click meTap me
Activity
Invoice #1042 · 2 comments
M
10 min ago
Invoice #1042 was paid twice. I have issued the refund for the second payment.
J
4 min ago
Thanks. I will let the customer know and close the ticket once it lands.
Built on Radix Popover. The trigger is a button with aria-haspopup="dialog", aria-expanded and aria-controls; the panel has role="dialog", named by Popover.Title and described by Popover.Description.
The copy of the trigger's label that travels and the copy of its surface that flies are aria-hidden; the trigger keeps its own text, so its name never changes. The card initials ball is decorative.
Focus moves to the first field as soon as the panel is placed (keystrokes are never lost) and returns to the trigger the moment closing starts. A popover opened by hover never takes focus. Rings inside the panel and on the trigger wait until the surface has landed, so they never draw around a box in flight.
Non-modal by default: Tab out of the panel or click outside to close it. modal traps focus.
Popover.Error is a role="alert" region; pending sets aria-busy on the panel and aria-disabled on the pending button.
Text is popover-foreground and muted-foreground on popover, AA in both themes; the destructive button is white text on destructive. Triggers are at least 28 px tall, panel buttons 36 px.
With reduced motion (the OS setting, or MotionKitProvider reducedMotion="always") nothing sinks and nothing morphs: the trigger stays exactly as it is, the panel fades in at its anchored position with its title, fields and actions all at once, and closing fades it out in place. Focus moves to the first field immediately. The open panel is the same picture as the morph's last frame: rim, tinted shadow and top highlight next to the unchanged button.
The morph is one layout animation of the panel's surface (transform), with its content counter-scaled so text never stretches; the label travels by transform only and the parts rise with transform and opacity. The error line's height is the one layout property animated, on a single element, when an error appears.
Nothing runs at rest: no loop to pause off-screen. The panel's content mounts only while open. The pending arc turns only while a button is pending (and not under reduced motion).
Third-party dependencies, measured apart: @radix-ui/react-popover and motion, shared with the combobox and the date picker.
Technical sheet
Motion
calm
260 ms · bounce 0
lively
400 ms · bounce 0.3
playful
540 ms · bounce 0.45
Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Size
Not measured yet · budget 15.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom, @radix-ui/react-popover, motion.
Dependencies
@radix-ui/react-popover · peer
motion · peer
Triggers
click, hover, press
Reduced motion
No sink and no morph: the trigger stays in place, the panel fades in at its anchored position with all its parts at once, and closing fades it out.
Keyboard
Enter / Space on the trigger
Opens the panel out of the trigger; focus moves to its first field
Tab / Shift+Tab
Moves through the panel's controls; tabbing out of a non-modal panel closes it
Escape
Closes the panel; focus returns to the trigger at once while the panel contracts into it
Enter in a field
Submits the panel's form (Save) when the fields sit in a form
Browsers
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)