Skip to content
animorio
IT
All components

Notification checkboxes

Forms, Hover, SVGGSAP, CSS onlyEasyCompressed weight: Demo 5.8 KBGSAP 28 KBFreeDownload the zip

A group of checkboxes for an app’s settings, with the ‘All notifications’ checkbox on top: each box fills from its middle on a spring while its tick draws itself and a ring leaves it; the select all box shows a dash while only some are on, and the same stroke bends into a tick when the last one joins. Pressed, it switches them all on or off one after the other, and the number beside it rolls.

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>
<!--
  "Notification checkboxes" 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>Notification checkboxes with a select all box that goes from dash to tick</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 group of checkboxes with a parent on top: each box fills from its middle on a spring while its tick draws
         itself and a ring leaves the box; the parent shows a dash while only some are on, and the same stroke bends
         into a tick when the last one joins; pressed, the parent switches them all one after the other -->
    <fieldset class="group" data-group>
      <legend class="sr">Notifications</legend>

      <label class="row row--all" data-row>
        <input class="row__input" type="checkbox" data-all>
        <span class="box" data-box aria-hidden="true">
          <span class="box__ring"></span>
          <span class="box__fill"></span>
          <svg viewBox="0 0 22 22"><path pathLength="1"></path></svg>
        </span>
        <span class="row__text"><span class="row__name">All notifications</span></span>
        <span class="count" aria-hidden="true"><span class="count__n" data-count>1</span> selected</span>
        <span class="row__sheen" aria-hidden="true"></span>
      </label>

      <div class="rows">
        <label class="row" data-row>
          <input class="row__input" type="checkbox" data-item checked>
          <span class="box" data-box aria-hidden="true">
            <span class="box__ring"></span>
            <span class="box__fill"></span>
            <svg viewBox="0 0 22 22"><path pathLength="1"></path></svg>
          </span>
          <span class="row__text"><span class="row__name">Mentions</span><span class="row__note">When someone tags you</span></span>
        </label>
        <label class="row" data-row>
          <input class="row__input" type="checkbox" data-item>
          <span class="box" data-box aria-hidden="true">
            <span class="box__ring"></span>
            <span class="box__fill"></span>
            <svg viewBox="0 0 22 22"><path pathLength="1"></path></svg>
          </span>
          <span class="row__text"><span class="row__name">Comments</span><span class="row__note">Replies on your files</span></span>
        </label>
        <label class="row" data-row>
          <input class="row__input" type="checkbox" data-item>
          <span class="box" data-box aria-hidden="true">
            <span class="box__ring"></span>
            <span class="box__fill"></span>
            <svg viewBox="0 0 22 22"><path pathLength="1"></path></svg>
          </span>
          <span class="row__text"><span class="row__name">Weekly digest</span><span class="row__note">Every Monday morning</span></span>
        </label>
        <label class="row" data-row>
          <input class="row__input" type="checkbox" data-item>
          <span class="box" data-box aria-hidden="true">
            <span class="box__ring"></span>
            <span class="box__fill"></span>
            <svg viewBox="0 0 22 22"><path pathLength="1"></path></svg>
          </span>
          <span class="row__text"><span class="row__name">Product news</span><span class="row__note">Releases and tips</span></span>
        </label>
      </div>
    </fieldset>
    <p class="sr" data-live aria-live="polite"></p>

    <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>

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.

26 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 “Notification checkboxes” 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

In the middle, on white, a panel with round corners and a soft shadow. On top the ‘All notifications’ row with its box and, on the right, the ‘1 selected’ pill; under a thin line, four items, each with a name and a small line: Mentions, Comments, Weekly digest, Product news. At first only Mentions is on, and the select all box shows a white dash on orange. The pointer presses Weekly digest: the box tightens for a moment, the orange fill grows from the middle and overshoots, the white tick draws itself, a thin ring widens and fades, the name gets heavier and the number in the pill rolls to 2. Then it presses the select all box: the items that were off switch on one after the other from the top, the dash bends into a tick with a small nod of the box, a pale light crosses the row and the pill takes the colour, ‘4 selected’. Pressed again, the ticks pull back one after the other, the fills close and the number drops to 0. Finally Mentions comes back on and the round starts again. With a real finger, mouse or keyboard the fake pointer goes away and the boxes follow the hand; over a row, the row darkens slightly and the edge of the box gets firmer.

How it works

Real checkboxes underneath

Each row is a label with its own checkbox input, invisible but real: keyboard, screen readers and forms work on their own. The drawn box is a span next to it, with a fill, a ring and an SVG stroke. The select all box uses the indeterminate property while only some are on.

One stroke of three points

Tick and dash are the same stroke: three points, written into the d attribute every frame. To go from dash to tick GSAP takes each coordinate from one shape to the other with back.out, so the stroke bends and slightly overshoots.

The fill on a spring

On press the box drops to 0.86 and comes back with back.out; the fill grows from 0.2 to 1 with the same bounce (BOUNCE), the tick draws itself in DRAW seconds with stroke-dashoffset and pathLength 1, and a ring of the same colour widens to RING and fades.

All of them, one after the other

The select all box changes the real state of every input at once, but each one’s animation starts CASCADE seconds after the one before: the data is right immediately, the movement cascades down.

The rolling number

The old number leaves upwards when the count rises and downwards when it falls, the new one comes in from the other side with back.out. When all are on a light crosses the row and the pill takes the colour with color-mix.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#f2542dThe colour of the checked boxes.
DRAWscript.js0.32How many seconds the tick takes to draw.
BOUNCEscript.js2.4How far the box overshoots when it fills: 0 = no bounce.
CASCADEscript.js0.07How many seconds between one box and the next when all are selected.
RINGscript.js1.9How far the ring leaving the box widens: 1 = hidden.
LOOPscript.jstrueLeft alone, the boxes try themselves out.

Try them in the Playground

When to use it

For the settings of an app or a dashboard, notification preferences, the consents of a sign up form, the filters of a list: wherever several items can be chosen and one box takes them all.

On phones

The same component: the panel takes the screen width minus the margins, the rows stay at least 44 pixels tall and the height also follows the window’s. The whole row can be tapped, not just the box.

With reduced motion

No springs and no movement: fill and tick fade in, the dash becomes a tick without bending, all the boxes change together and the number updates in place.

Pitfalls

  • GSAP writes the transform inline: the spring scale lives on the box and on the fill, never on the row, which already has its own hover background.
  • With pathLength 1 and round caps, a fully hidden stroke leaves a dot: under 3% drawn the stroke is made invisible.
  • The real state of the inputs changes at once, even if the cascading animation comes later: a form sent mid cascade still sends the right values.

Libraries

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.

Testing

Tested on 13 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