Micro-interactions
Radial Menu
Press and hold anywhere and the options fan out from the point you pressed. Selection is resolved from the pointer's angle rather than by hit-testing the options, so every target is an infinite wedge — commit to a direction and you can throw the pointer as hard as you like and still land it.
Install
bun add motion clsx tailwind-mergeThen copy 2 files into your project:
- components/registry/radial-menu/radial-menu.tsx
- lib/utils.ts
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| radius | number | 96 | How far the options sit from the press point. Only the drawing distance — selection is angular, so a wide radius costs nothing in accuracy and a tight one buys none. |
| startAngle | number | 180 | Where the first option lands. 0 is right and 90 is down, following screen coordinates rather than the maths convention — the y axis on a page points the other way and pretending otherwise makes every later value read backwards. |
| sweep | number | 180 | Total arc the options are spread across. At a full turn the last option would land on the first, so the spacing switches from end-to-end to evenly-around at 360 — the one place this component has two layout rules. |
| itemCount | number | 6 | How many options to show. Past about seven the wedges get narrower than the flick they are meant to catch, which is the point at which a list would serve you better. |
| holdDelay | number | 220 | How long the press has to be held before the fan opens. Releasing sooner is treated as a plain click on whatever is underneath, so the surface stays usable for its normal purpose. At 0 the menu opens on contact and that normal purpose is gone. |
| stagger | number | 0.03 | Delay between one option arriving and the next. Small values read as the fan unrolling; large ones make you wait for the option you already know you want. |
| stiffness | number | 380 | How hard the options spring out to their positions. |
| damping | number | 26 | How fast that spring settles. Low values overshoot the arc and snap back, which reads as the options being flung rather than placed. |
| centerCancel | number | 28 | Radius of the dead zone around the press point. Release inside it and nothing commits. At 0 a press that never really moved still resolves to whichever option is nearest the jitter, and the menu picks something you never chose. |
| accent | string (hex) | "#a855f7" | Highlight on the option the pointer is aimed at, and on the label echoing it back at the centre. |
What It Demonstrates
- Hold to confirm
- A progress effect that fills up while the user holds a button.
- Press / Tap feedback
- A subtle scale-down when an element is clicked, so it feels physical.
- Stagger
- Animate several items one after another with a small delay between each, creating a cascade.
- 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.
- Spring
- Motion driven by physics (tension, mass, damping) rather than a set duration.
- Enter / Exit
- The animation an element plays when it's added to or removed from the screen.
- Direction-aware transition
- Content slides one way going forward and the opposite way going back, so navigation has a sense of direction.
Related Components
Stagger Menu
A menu overlay that blooms open as a clip-path circle spring while items stagger in with blur and rotation, then collapses back to its pill.
Tether
A popover that grows out of the corner nearest its trigger, and moves that origin when it flips.
Blueprint Card
A technical-drawing card. Dashed envelope, accent rules, corner nodes, and a soft glow that draw in on mount.
Corner Letters
Four glyphs pinned to the container corners that blur-and-scale in on mount and dissolve out on exit.
Magnetic Button
A button that leans into your cursor. Caught in a magnetic field it slides toward the pointer while an amethyst aura swells with proximity, then snaps home on a spring and answers every click with a dark ripple bursting outward from the point of contact.
Dissolve
An element disintegrates into drifting shadow-motes on dismiss, and reforms on command.