
The layered button
Buttons, Hover, Physics
Free
The Pause notifications button of a team chat app, with a living leaf of mimosa pudica inside, the plant that folds its leaflets when you touch it. A pointer brushing it makes the pairs of leaflets round it fold shut, in a wave that runs along the leaf and dies out on the way. At a click the signal runs down the whole leaf: every pair folds in turn, the leaf droops, evening falls on the pill and the notifications are paused. Then the leaf wakes, one pair after another.
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>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>The sensitive plant button</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/rosario@5.3.0/index.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage">
<!-- the sensitive plant button: the Pause notifications button of a team chat app, with a living leaf of mimosa
pudica inside, the plant that folds its leaflets shut when it is touched. Its two pinnae wrap round the words;
the pointer brushing them makes the leaflets fold away in a ripple, and a click sends the signal down the
whole leaf: every pair folds shut, the leaf droops, and the notifications are paused -->
<div class="mimosa" data-mimosa>
<button class="mimosa__btn" type="button" data-btn data-autoclic>
<canvas class="mimosa__shade" aria-hidden="true" data-shade></canvas>
<canvas class="mimosa__leaf" aria-hidden="true" data-leaf></canvas>
<canvas class="mimosa__leaf mimosa__ghost" aria-hidden="true" data-ghost></canvas>
<span class="mimosa__dusk" aria-hidden="true" data-dusk></span>
<span class="mimosa__label" data-label>
<span class="mimosa__words" data-words>Pause notifications</span>
</span>
</button>
<p class="sr" aria-live="polite" data-live></p>
</div>
</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.
24 values to change
With the Animorio connector, Claude Code takes it from here, guide included, and fits it into your project. Paste this request:
Take “The sensitive plant button” from Animorio and fit it into my siteThe stalk comes in from the left and splits at the joint into two pinnae. The rib of each pinna leaves at 27 degrees and bends on a quadratic curve until it runs along the pill, then curls in a pixel and a half towards the tip. The pairs of leaflets sit every SPACING pixels from 9 pixels past the joint: 138 pairs in a pill 340 wide. The leaflets are a little smaller near the joint and much smaller at the tip. The rib runs where the inner leaflets leave the band of the words free, and the words go in the longest stretch where both pinnae, with leaflets of their real size at that point, let them through.
A touch is a signal with an energy of its own, at a place on the leaf. Distance is measured along the leaf: on the same pinna along the rib, between the two pinnae down one and up the other through the joint. Every pair reached with energy − distance / 150 ≥ 0.1 folds at the moment the signal gets there, at SPEED pixels a second; if at the joint the energy is still 0.9, the whole leaf droops. A pair that has folded cannot fold again until it has opened past half. The pointer gives an energy that grows with its speed up to 900 pixels a second, 0.1 + REACH · (0.07 + 0.8 · v / 900); a press 0.42; a click 99, which reaches everywhere and folds even the pairs that are opening again.
A leaflet is a blade that turns about the rib by an angle from 0 to 92 degrees, while its axis leans towards the tip of the pinna from 70-78 degrees (open) to 42. That gives three vectors: along the leaflet, across it towards the tip, and the normal of its upper side. The view is from above but a little from the front (a point h high rises on the screen by 0.34 · h), and the leaflet is drawn on the canvas with its own setTransform, an affine made of two of those vectors. Its shadow is the same shape projected on the pill along the direction of the lamp, on a second canvas blurred by the CSS.
It works out which side the eye sees and how much light reaches it from the lamp at the upper left: the upper side is full green, the underside paler. A side seen from away from the lamp is lit from behind, yellow-green, like a thin leaf against the light: that is what makes the closed feathers glow. The shading is 40 levels of light for each of the three colours, made once as gradients in the leaflet's own units, so the gradient follows it through its transform. Every leaflet has a small fixed shift of tint of its own.
Every leaflet follows its target on a spring: to fold, a quick spring with a little bounce (damping 0.58, frequency 2.5 / SNAP), to open, a slow one with no bounce (4.6 / WAKE). The spring is chosen by the target, not by the position, so the bounce of the fold comes back quickly. The sums run on GSAP's ticker in steps of 1/240 of a second, with the frame capped at 1/30. The whole leaf too drops on a spring with a bounce and rises on a slow one; drooping, the height it casts its shadow from goes down and, seen from above, it gets a little shorter towards the stalk.
At rest, closing, paused, waking. While paused the times for opening again are held; waking, the leaf rises and the pairs start to open one after another, from the joint to the tips, over three quarters of a second. The evening is a veil in multiply over the leaf and under the words. The words change with a blur and a slide, their weight goes from 560 to 470 while paused, and they keep the width of the longest of them; the button has aria-busy while it closes, and an aria-live region says Notifications paused for 1 hour and Notifications on. When nothing moves the canvas is not drawn again.
| Name | File | Default | What it changes |
|---|---|---|---|
BUSY | script.js | Pausing | The words while the leaf folds shut. |
DONE | script.js | Paused for 1 hour | The words once the leaf has closed. |
HOLD | script.js | 4 | The seconds it stays paused before the leaf wakes by itself (a click wakes it sooner). |
SPEED | script.js | 320 | How fast the signal runs along the leaf, in pixels a second: lower, the wave of closing is seen passing more slowly. |
REACH | script.js | 1 | How far a touch of the pointer carries along the leaf: 0, the leaf takes no notice. |
SNAP | script.js | 0.15 | The seconds a leaflet takes to fold shut. |
WAKE | script.js | 2.2 | The seconds a leaflet takes to open again. |
LINGER | script.js | 1.3 | The seconds a touched leaflet stays shut before it starts to open. |
LEAFLET | script.js | 8.6 | The length of the leaflets, in pixels: the pinnae spread or close in to always leave room for the words. |
SPACING | script.js | 3.9 | The room between one pair of leaflets and the next, in pixels: wider, the feather turns into a fishbone. |
DROOP | script.js | 1 | How far the whole leaf droops when it closes: 0, not at all. |
For the action that silences, holds or puts something to sleep: pausing notifications, do not disturb or focus mode, snoozing a reminder, quiet hours, the night setting of a smart home. It belongs in wellness and meditation apps, nurseries and plant shops, botany sites and wherever calm is the product. It is a button to show off, one to a page, not one for a toolbar.
The pill is 60 pixels tall and 340 wide, or the screen less 32; the leaf is built again at the real width, with fewer pairs (112 on a 320 phone) and the words always between the two pinnae, smaller only if they do not fit. A finger drawn over the leaf touches it like the mouse (touch-action: pan-y, so up and down the page still scrolls); a tap folds the pairs under the finger and pauses starting from there.
No waves, no leaflets moving, no drooping leaf, no breath on focus, and the pointer folds nothing. At a click the open leaf fades away in half a second over the closed one, while the evening falls; the words change in a fade, and waking is the same fade backwards. Pressed, the pill darkens a little instead of shrinking.
GSAP 3.15.0, Rosario (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 13 KB; the libraries: GSAP 28 KB.
Tested on 6 October 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.
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.