Skip to content
animorio
IT
All components

Font picker

Pickers, Hover, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 8.2 KBGSAP 28 KBFreeDownload the zip

The font picker of a text editor: the «Typeface» field shows the chosen typeface set in itself, the panel opens inside the card with a search and the list of typefaces, each set in its own letters (Inter, Hanken Grotesk, Fraunces, Newsreader, Bricolage Grotesque, Unbounded, JetBrains Mono) with its category beside it, the search folding away the rows that do not match while the others slide up, the pill gliding under the row you point at and the tick drawing itself; once a typeface is picked the preview sentence re-sets itself letter by letter, and the three weight segments (Light, Regular, Bold) move the weight axis live. On white, a single accent.

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>
<!--
  "Font picker" 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>Font picker</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/inter@5.3.0/index.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/hanken-grotesk@5.3.0/index.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/index.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/newsreader@5.3.0/index.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/bricolage-grotesque@5.3.0/index.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/unbounded@5.3.0/index.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/jetbrains-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage">
    <!-- the typeface picker of a document editor: the field shows the chosen typeface written in itself, the panel
         lists every typeface written in its own letters, the search filters them, and the preview sentence
         re-sets itself in the new typeface; the weight is picked on three segments -->
    <section class="card" data-card aria-label="Text style">
      <span class="card__edge" aria-hidden="true"></span>
      <span class="card__glow" aria-hidden="true" data-glow></span>

      <header class="head">
        <span class="head__title">Text style</span>
        <span class="head__meta">Heading 1</span>
      </header>

      <span class="label" id="lbl-face">Typeface</span>
      <button class="field" type="button" aria-haspopup="listbox" aria-expanded="false" aria-labelledby="lbl-face" data-field>
        <span class="field__name" data-field-name>Inter</span>
        <span class="field__cat" data-field-cat>Sans</span>
        <svg class="field__chev" viewBox="0 0 16 16" aria-hidden="true" data-chev><path d="M4.2 6.3 8 10.1l3.8-3.8"/></svg>
      </button>

      <div class="preview" data-preview>
        <span class="preview__label">Preview</span>
        <p class="preview__text" data-text aria-live="polite">Sphinx of black quartz, judge my vow.</p>
      </div>

      <div class="weight">
        <span class="label" id="lbl-w">Weight</span>
        <div class="seg" role="radiogroup" aria-labelledby="lbl-w" data-seg>
          <span class="seg__pill" aria-hidden="true" data-seg-pill></span>
          <button class="seg__opt" type="button" role="radio" aria-checked="false" data-w="300"><span>Light</span></button>
          <button class="seg__opt" type="button" role="radio" aria-checked="true" data-w="400"><span>Regular</span></button>
          <button class="seg__opt" type="button" role="radio" aria-checked="false" data-w="700"><span>Bold</span></button>
        </div>
      </div>

      <div class="panel" data-panel aria-hidden="true">
        <label class="search">
          <svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="7" cy="7" r="4.3"/><path d="m10.2 10.2 3.2 3.2"/></svg>
          <input type="text" placeholder="Search typefaces" autocomplete="off" spellcheck="false" aria-label="Search typefaces" data-search>
        </label>
        <div class="list" role="listbox" aria-label="Typefaces" data-list>
          <span class="list__pill" aria-hidden="true" data-list-pill></span>
        </div>
        <p class="empty" data-empty>No typeface matches</p>
      </div>
    </section>
  </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.

27 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Font picker” 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

The card arrives and a thread of light runs along the top edge; the preview sentence rises letter by letter. Tap the field and the chevron turns half a turn on a spring while the panel opens below it, inside the card, its rows coming in one after another, each set in its own typeface. Typing «ser» in the search folds away the rows that do not match and Fraunces and Newsreader slide up into place, the pill gliding under the one you point at. Pick Fraunces and the tick draws itself, the panel closes and the sentence leaves letter by letter to come back in the new face, re-measured so it always fits its box. On the weight segments the white pill slides to Bold and then to Light, and the sentence changes weight live. Then Bricolage Grotesque, picked by walking down the list, and back to Inter by searching for its name.

How it works

Seven real variable typefaces

Each typeface comes from @fontsource-variable with its weight axis: the list row, the field, the segments and the sentence share the same font-family, so you really see the face before you pick it.

The panel inside the card

The card has a fixed height and the panel opens absolutely positioned under the field, over the preview: nothing below moves and everything stays inside the phone box. It comes in with a vertical scale from 0.94 and a back.out, the rows arriving 35 thousandths apart.

The search that folds the rows

The rows that do not match go to zero height and the others slide up into their places by themselves; the pill under the row you point at follows its position every frame, so it never floats over empty space.

The sentence that re-sets itself

Each word is a block that never breaks in the middle, each letter an inline-block: the letters rise and vanish a few thousandths apart, the face changes, the size is re-measured until the sentence fits its box, and the letters come back from below on a spring.

The weight, live

The weight is a number GSAP carries from one value to the other and writes into the sentence’s font-weight every frame: with variable typefaces even the in-between weights show.

Values to change

NameFileDefaultWhat it changes
SENTENCEscript.js"Sphinx of black quartz, judge my vow."The preview sentence.
START_FONTscript.js0The typeface chosen at the start, from 0 (Inter) to 6 (JetBrains Mono).
START_WEIGHTscript.js400The weight at the start: 300, 400 or 700.
LETTER_STAGGERscript.js0.014Seconds between two letters when the preview re-sets itself.
SPRINGscript.js0.6How springy the panel, the pills and the letters are (lower means more bounce).
TYPE_SPEEDscript.js0.13Seconds per letter when the demo types in the search.
IDLEscript.js7Seconds after your last touch before the demo plays by itself again.

Try them in the Playground

When to use it

In the text settings of a document editor, a site builder or a design app: you pick the typeface while seeing it, search by name or category and try the weight on the sentence.

On phones

Everything is in em and the size depends on both the width and the height of the window; the card has a fixed height and the panel opens inside it, so everything fits the phone box, and the sentence shrinks by itself for the wide faces.

With reduced motion

No springs or flying letters: the panel and the rows fade in, the sentence changes face with a fade and the weight changes without long transitions.

Pitfalls

  • The panel sits inside a fixed-height card: if the card grew on opening, on phones its bottom would leave the box and the field would move under your finger.
  • The letters are inline-blocks inside words that never wrap: without the word block, changing the face would break a word in half.
  • The sentence size is re-measured after every face change: Unbounded is twice as wide as Newsreader.
  • With autoRound off the pathLength 1 tick really draws instead of appearing at once.

Libraries

GSAP 3.15.0, Mona Sans, Inter, Hanken Grotesk, Fraunces, Newsreader, Bricolage Grotesque, Unbounded, JetBrains Mono (font variabili) 5.3.0.

Compressed with gzip, the three demo files weigh 8.2 KB; the libraries: GSAP 28 KB.

Testing

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