Skip to content
animorio
IT
Back to the library

Team role permissions

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

The roles panel in a workspace’s settings: a selector with Viewer, Editor and Admin and below it the list of what each role can do. Changing role, the white thumb slides and settles, and the boxes change one after the other: the purple ticks light up in a cascade going down, or close into a lock going back up.

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>
<!--
  "Team role permissions" 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>Team role permissions with the ticks that light up in cascade</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">
    <!-- the roles panel of a team workspace's settings: a selector with three roles and the list of what each
         one can do. Choosing a role slides the thumb, and the ticks light up (or close into a lock) one after
         the other down the list, while the count at the bottom rolls -->
    <article class="card" data-card>
      <header class="head">
        <p class="head__title">Role permissions</p>
        <p class="head__count"><span data-count>3 of 5</span></p>
      </header>

      <div class="seg" role="radiogroup" aria-label="Role" data-seg>
        <span class="seg__thumb" data-thumb aria-hidden="true"></span>
      </div>

      <ul class="rows" data-rows></ul>

      <p class="foot"><span data-note>Can change content, not the team</span></p>
    </article>

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

15 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 “Team role permissions” 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 a light grey background, a white card: the title “Role permissions” and a purple tag saying how many permissions the chosen role has, “3 of 5”. Below, a three-way selector (Viewer, Editor, Admin) with a raised white thumb under the chosen one. Then five rows, from the lightest permission to the heaviest: View projects, Comment, Edit content, Invite members, Manage billing; to the right of each a box, purple with a white tick if the role can, empty with a grey lock if it cannot. Choosing Admin, the thumb slides right squashing for a moment, and the two missing boxes light up one after the other: the lock goes in, the purple fill swells, the tick draws itself, the box bounces. Choosing Viewer the opposite happens from the bottom up: the tick withdraws, the purple closes, the lock drops into place with a shake and the permission’s name dims. At the bottom a sentence says in words what that role can do.

How it works

The selector

Three buttons in a grid and under them an absolutely positioned thumb: on choice the button is measured with getBoundingClientRect and GSAP takes the thumb’s x and width there with back.out, while a scaleY squashes it and lets it settle. It is a radiogroup: the arrow keys change role.

The cascade

choose(i) compares, row by row, the new state with the old and animates only the boxes that change, each with CASCADE more seconds of delay. If permissions grow the order goes top to bottom, if they shrink bottom to top.

The box

Four layers: the grey ring, the purple fill scaling from zero with back.out, the tick drawing itself with stroke-dashoffset and the lock coming in from above. On closing, the box makes a small horizontal shake.

Values to change

NameFileDefaultWhat it changes
ROLESscript.jsViewer:2:Can look and comment, nothing else | Editor:3:Can change content, not the team | Admin:5:Can do everything, billing includedThe roles, separated by a bar: name:how many permissions it has (counted from the top):the sentence below.
PERMISSIONSscript.jsView projects, Comment, Edit content, Invite members, Manage billingThe permissions, from the lightest to the heaviest.
STARTscript.js1The role chosen at the start (0 is the first).
ACCENTscript.js#5b5bf0The colour of the ticks.
CASCADEscript.js0.07The seconds between one row and the next.
RESTscript.js1.7On its own: how long it stays on each role.
LOOPscript.jstrueLeft alone, a pointer tries the roles.

Try them in the Playground

When to use it

For the settings of a product used by several people: a workspace, a back office, a CMS, a team tool. It shows at a glance what changes between one role and another, on the members page, when inviting someone new or on the pricing page.

On phones

The same card, as wide as the screen minus the margins and with slightly lower rows: the roles are tapped with a finger.

With reduced motion

The thumb moves without sliding and the boxes change with a fade, still one after the other, with no bounces or shakes.

Pitfalls

  • On desktop the card is enlarged with zoom: distances measured with getBoundingClientRect must be divided by the zoom before giving them to GSAP, or the thumb ends up further than the button.
  • Only the rows that change state are animated: re-animating all of them on each choice makes the unchanged ones blink too.
  • The selector is a radiogroup with aria-checked and a single button reachable with Tab: the real permissions, though, are decided by the server, this panel only shows them.

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