
The elastic button
Buttons, Hover, Text
A feature flag switch with a gradual rollout: turn it on, drag the share of users and the strip of bars (each a slice of users, in a shuffled order) lights up on a spring. The 1, 10, 50 and 100% stages get there by themselves; switching off is the kill switch.
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>
<!--
"Feature rollout switch" 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>Feature rollout</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">
<!-- a feature flag with a gradual rollout: switch it on, drag the share of users, and the strip of bars
(one bar per slice of users, in a shuffled order) lights up; switching off is the kill switch -->
<section class="fr" data-fr aria-label="Feature flag">
<header class="fr__head">
<span class="fr__icon" aria-hidden="true"><svg viewBox="0 0 20 20"><path d="M5.200 17V3.600"></path><path class="fr__flag" data-flag d="M5.200 4.200c3-1.600 5 1.400 8.600 0v6.600c-3.600 1.400-5.600-1.600-8.600 0Z"></path></svg></span>
<span class="fr__name"><code>new-checkout</code><span class="fr__state"><span data-state>Off</span></span></span>
<button class="fr__switch" type="button" role="switch" aria-checked="false" aria-label="Enable new-checkout" data-switch><span class="fr__knob" data-knob></span></button>
</header>
<div class="fr__body" data-body>
<p class="fr__read">
<span class="fr__pct"><b data-pct>0</b><i>%</i></span>
<span class="fr__users"><b data-users>0</b> of <span data-total></span> users</span>
</p>
<div class="fr__bars" data-bars aria-hidden="true"></div>
<div class="fr__slide">
<span class="fr__track"><span class="fr__fill" data-fill></span></span>
<span class="fr__thumb" data-thumb aria-hidden="true"></span>
<input class="fr__range" type="range" min="0" max="100" step="1" value="0" data-range aria-label="Share of users">
</div>
<div class="fr__stages" data-stages role="group" aria-label="Stages"></div>
</div>
</section>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></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.
20 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 “Feature rollout switch” from Animorio and fit it into my siteThe bars have an order shuffled once from a fixed seed: a bar is in if its place in that order is below the percentage. So the same user stays in as the rollout grows, as with a real flag.
The percentage moves fill, thumb, user count and bars. Underneath sits a real range input; the stages animate the same number with power3.inOut over GLIDE seconds.
Each bar changes height with a transition whose cubic-bezier overshoots and returns, with a random delay of a few hundredths; the --on variable takes switch, flag, status and shadow to purple.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #8b7bff | The colour of the feature when on. |
USERS | script.js | 62000 | How many users the product has. |
START | script.js | 10 | The percentage the rollout starts from, 0 to 100. |
BARS | script.js | 56 | How many bars the users’ strip has. |
GLIDE | script.js | 0.7 | How many seconds the percentage takes to reach a stage. |
HOLD | script.js | 1.5 | On its own: how many seconds it stops at each stage. |
LOOP | script.js | true | Left alone, a pointer switches on, widens the rollout and then kills it. |
In the feature flag panel of a developer tool, in the settings of an experiment or an A/B test, and wherever something new opens to a share of users before everyone.
The same component: the bars narrow with the width, the percentage and the strip shrink with the window’s height, the thumb is 22 pixels wide and is dragged by finger.
No stretching knob, waving flag or runs to the stages: on, off and percentages change at once; only the bars’ short transition remains.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.8 KB; the libraries: GSAP 28 KB.
Tested on 17 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.