
The elastic button
Buttons, Hover, Text
A photo album in an invented app, on the palest grey: press and hold a photo, a thin ring closes around the finger and five actions fan out around it on a spring (favourite, share, copy, move, delete). Slide towards one and it lights up in black and leans out, while its name appears in the middle; let go and the action runs, with a small toast at the bottom. Let go in the middle and the menu folds back without doing anything.
A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React and Vue tabs hold the same demo as a ready component, which switches its animations off when it leaves the page.
<!doctype html>
<!--
"Press-and-hold radial menu" from Animorio · https://animorio.com
License: free on your own sites and your clients’ sites, paid work included.
Not for resale, redistribution, templates or code collections · https://animorio.com/en/license/
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>The radial menu that opens when you press and hold</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage" data-stage>
<!-- a photo album: press and hold a photo and five actions fan out around the finger; slide towards one to pick it,
let go to run it, let go in the middle to close -->
<section class="album" data-card aria-label="Album">
<header class="album__head">
<p class="album__brand">
<span class="album__logo" aria-hidden="true"><svg viewBox="0 0 24 24"><rect x="4" y="6" width="16" height="12" rx="3"></rect><circle cx="12" cy="12" r="3.2"></circle><path d="M8.5 6l1.2-2h4.6l1.2 2"></path></svg></span>
<span><span data-brand>Shutterbox</span><small>Lisbon, October</small></span>
</p>
<span class="album__count" data-count>9 photos</span>
</header>
<div class="grid" data-grid></div>
<p class="hint" data-hint>Press and hold a photo</p>
<div class="radial" data-radial aria-hidden="true">
<svg class="radial__line" data-line><line x1="0" y1="0" x2="0" y2="0"></line></svg>
<svg class="radial__hold" viewBox="0 0 64 64" data-hold><circle cx="32" cy="32" r="26"></circle></svg>
<span class="radial__core" data-core><span class="radial__name" data-name></span></span>
</div>
<div class="toast" data-toast role="status" aria-live="polite">
<span class="toast__icon" data-toast-icon></span>
<span class="toast__text" data-toast-text></span>
<button class="toast__undo" type="button" data-undo>Undo</button>
</div>
</section>
<svg class="pointer" viewBox="0 0 24 24" aria-hidden="true" data-pointer><path d="M5 3l14 8.2-6.2 1.4 3.6 6.8-2.6 1.4-3.6-6.8L5 18.6z"></path></svg>
</main>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
<script src="script.js"></script>
</body>
</html>Change values, colours and text with the controls and watch the animation respond live. Or write in the code yourself. Then download the folder with your changes.
18 values to change
With the Animorio connector, Claude Code, ChatGPT, Cursor or VS Code take it from here, guide included, and fit it into your project. Paste this request:
Take “Press-and-hold radial menu” from Animorio and fit it into my siteOn press an SVG circle is placed around the finger with its dash as long as the circle and fully offset, and it is brought to zero in HOLD_TIME: the closing ring says how long is left. If the finger lifts earlier, the tween stops and the photo springs back up.
The menu opens where you press, but its centre is kept inside the card at RADIUS plus half a button from the edges: near the edge the circle moves inwards and a thin line joins the centre to the finger, so no action ever goes outside.
All five actions start from the centre, small and turned, and go to their place on the circle (one every 72 degrees from the top) with back.out and a stagger of SPREAD seconds: they come out one after another like a fan.
On every move the angle between the centre and the finger is measured and the action with the nearest angle is chosen, only beyond 26 pixels: closer than that nothing is chosen. The choice lights up, moves a little further out and swells; the centre circle widens to the size of the name, measured on the real text.
| Name | File | Default | What it changes |
|---|---|---|---|
BRAND | script.js | Shutterbox | The name of the invented photo app, at the top of the card. |
ACCENT | script.js | #e5484d | The colour of the favourite heart and of the Delete action. |
HOLD_TIME | script.js | 0.45 | The seconds to press and hold before the menu opens. |
RADIUS | script.js | 74 | The distance in pixels between the finger and the five actions. |
SPREAD | script.js | 0.05 | The seconds between one action and the next as they fan out. |
BOUNCE | script.js | 1.8 | How much the actions bounce as they reach their place. |
PAUSE | script.js | 1.1 | The seconds the autopilot waits between one gesture and the next. |
For quick actions on an item in a grid or a list, on phones and tablets: the photos in an album, notes, files, messages. A single gesture instead of a menu that opens and closes: press, slide, let go.
The card takes the available width but also at most 78% of the height, so the square photos fit in the box. The page has touch-action none and the browser’s long-press menu is switched off, so a finger held still doesn’t open text selection or image saving. The centre of the menu always stays inside the card.
No fan, rotations or springs: the actions appear already in place with a fade, the choice lights up without moving, the photos dim without shrinking and the toasts come in with a fade; the drawn pointer stays hidden.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.8 KB; the libraries: GSAP 28 KB.
Tested on 8 November 2026
Use it in your own projects and in your clients’ projects. Do not resell it or redistribute it as is. GSAP stays under its own Standard license. Full license.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.