Platform
VaultVault
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
ButtonsPart of ProButtons
IconsPart of ProIcons
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
SavedPart of ProSaved
Support
DocumentationDocumentation
MCP serverMCP server
SettingsSettings
VaultTextVariable Font Cursor
Draw-In Underline LinkBrowse all 182Wheel Arc Slider
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
Sign inSign in

Start free. The code for 15 components, no card needed.

Get 15 free

Variable Font Cursor

This one is locked. Become a member to open the code for it and the rest of the Vault.

See plansTry the 15 free ones

What you'll need.

Install

    Setup

    npm i gsap

    Features.

    • One huge word in Roboto Flex, sized to fill the section's width exactly and capped so it never takes more than 45% of the screen's height
    • Letters near the pointer swell towards black and extended; the rest thin and condense to make room, so the line never overflows
    • Each letter moves along weight 150 → 600 → 1000 and width 25 → rest → 151, with a smooth falloff round the pointer
    • The effect fades as the pointer moves away from the word, over half a screen's height
    • Two rows of 1px ruler ticks above and below the word snap a ±3 falloff to the pointer
    • A live readout shows the boldest letter and its weight and width
    • A 1.4s sweep across the word when it first appears
    • Touch screens get a slow idle sweep (7s there and back) instead of pointer tracking
    • One animation loop that sleeps once everything has settled
    • Respects prefers-reduced-motion: the fitted word at its resting weight, nothing moves
    • No dependencies; the font is self-hosted (SIL Open Font License)

    How to get it right.

    Use capitals and one or two short words

    The width swing is what makes the effect, and it shows best on capitals. 8 to 14 characters fill a desktop screen well. Very short words get capped by the height limit and stop filling the width; very long ones get small.

    Host the font with the licence

    The CSS loads /library/variable-type-ruler/RobotoFlex-Variable-latin.woff2. Copy that file and OFL.txt to your site and update the src path in the @font-face rule. The font is under the SIL Open Font License 1.1: keep the licence file alongside it.

    Give it a full screen

    The section is min-height: 100svh with the word pushed to the bottom. On a short band the word still fits the width, but the readout crowds it.

    Tune reach before response

    data-au-reach sets how many letters swell at once (2.4 letter widths either side). Lower it for a sharp spotlight, raise it for a broad wave. data-au-ease is how quickly letters follow: 7.5 feels like liquid, 14 feels instant.

    Variations.

    • Default — reach 2.4, response 7.5, ticks on
    • Spotlight — data-au-reach="1.2": one or two letters bulge at a time
    • Wave — data-au-reach="4" data-au-ease="4": a broad, slow swell
    • Type only — data-au-ticks="false" hides both ruler rows
    • Your colours — override --vtr-text, --vtr-muted and --vtr-tick on the section

    Where it fits.

    • Studio or brand heroes — the name as a living specimen
    • Type foundry and font pages — the readout doubles as a specimen label
    • Event or product names — one word, full width, at the top of a launch page
    • Section breaks — a full-screen word between long sections

    Frequently asked.

    The script measures whatever font the @font-face provides, but the numbers (weight 150–1000, width 25–151, cap height 0.719em) are Roboto Flex's. Another variable font needs both a wght and a wdth axis with similar ranges, and the FONT name in the script changed to match.

    Yes, but the width axis does much less on lower case and the line box is tuned to capitals, so descenders can be clipped.

    Screen readers get the text in the visually hidden vtr_sr span. The animated letters and the readout are hidden from them.

    The letters stay hidden until the font has loaded (so the line is measured in the right font), then fade in over 0.4s.

    Related components.

    Pro

    Multi-Cursor Typing

    Load

    Pro

    Scroll-Lit Word List

    Scroll

    Pro

    Glitch Wipe Reveal

    Scroll