Skip to content
animorio
IT
All components

Press-and-hold radial menu

Menus, HoverGSAP, CSS onlyMediumCompressed weight: Demo 8.8 KBGSAP 28 KBFreeDownload the zip

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.

The code

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>

Playground

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

Or ask your AI assistant for it

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 site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On the palest grey sits the card of an album in Shutterbox, an invented photo app: the mark, «Lisbon, October», the photo count and nine real square photos from the trip (sunset over the river and the bridge, a beach, green hills, a pink wall with a green shutter, blue sky with the sun, a dry stone wall, dusk over a church tower, a hill at sunset, a green valley). Press and hold a photo: it sinks slightly and a thin ring closes around the finger in under half a second. Then the photo lifts with its shadow, the others dim and shrink a little, a small white circle appears in the middle and five actions come out of the finger in a fan, one after another, turning and settling in a circle on a spring: Favorite at the top, then Share, Copy, Move to Trips and Delete. As you slide, a thin line runs from the centre towards the finger, the nearest action lights up in black (Delete in red), leans out and swells with a small snap, the others get smaller, and the centre circle widens into a pill with its name. Let go and the chosen action swells for a moment and goes back in, the menu folds back into the finger and the photo returns to its place. Favorite puts a heart in the corner of the photo, Delete makes it vanish leaving a dashed square and changes the count, with the toast «Photo deleted» and Undo; the other actions have their own toast. Letting go in the middle does nothing. A drawn pointer shows everything by itself; you can use it by hand with a finger or a mouse.

How it works

The press ring

On 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 centre kept inside the card

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.

The fan on a spring

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.

The nearest action

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.

Values to change

NameFileDefaultWhat it changes
BRANDscript.jsShutterboxThe name of the invented photo app, at the top of the card.
ACCENTscript.js#e5484dThe colour of the favourite heart and of the Delete action.
HOLD_TIMEscript.js0.45The seconds to press and hold before the menu opens.
RADIUSscript.js74The distance in pixels between the finger and the five actions.
SPREADscript.js0.05The seconds between one action and the next as they fan out.
BOUNCEscript.js1.8How much the actions bounce as they reach their place.
PAUSEscript.js1.1The seconds the autopilot waits between one gesture and the next.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • The menu opens where you press, but near the edge the actions would leave the card: the centre is moved inwards and the line joins the centre to the finger, instead of letting the circle spill out.
  • The choice is made on the angle, not on the distance to each button: so you can slide in a direction without reaching right over the action, which is the natural thumb gesture.
  • On phones a long press opens the browser menu and text selection: you need touch-action none, user-select none and the contextmenu cancelled.
  • The photos are real and cut square at 480 pixels: they sit in the tile with object-fit cover, and the image has pointer-events none and draggable false, otherwise on a phone the long press opens the browser’s save-image menu instead of the radial menu.

Libraries

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.

Testing

Tested on 8 November 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

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.

All components