Design7 min

Variable fonts in UI design: typography as interaction

How to use variable fonts in UI design: weight, width and optical size axes, interactive type for hover and scroll, performance gains and accessibility limits.

Saurabh YadavFounder, Design Studio by Saurabh
DesignOptical size axis
Share

For most of the history of digital type, a font was a box of fixed options. Regular, Medium, Bold, maybe a Light if you were lucky. Each one was a separate file, and if you wanted something between Medium and Bold, tough.

Variable fonts change that. One file holds a whole range of styles, and you can pick any point along it: weight 437, width 92, optical size tuned exactly to the text size on screen. That sounds like a typographer's toy. In practice, it turns type into something you can design with the way you design colour or motion.

This post is about using variable fonts in UI design: what they are, where they genuinely improve an interface, and where all that flexibility becomes a trap.

What a variable font actually is

A variable font is a single font file that contains one or more axes of variation. Instead of jumping between fixed styles, you can set any value along each axis. The format came from a joint effort by Apple, Google, Microsoft and Adobe as part of the OpenType specification in 2016, and it's now supported across modern browsers and operating systems.

There are five registered axes, which have standard names and map to familiar CSS properties:

Axis Tag What it changes CSS property
Weight wght Thin to black font-weight
Width wdth Condensed to expanded font-stretch
Italic ital Upright to italic font-style
Slant slnt Angle of the letters font-style: oblique
Optical size opsz Detail and spacing tuned for size font-optical-sizing

Type designers can also add custom axes, written in capital letters. Some fonts include a grade axis (GRAD) that changes stroke thickness without changing letter width, or playful axes for roundness or "casualness". Custom axes are set with font-variation-settings.

Note

Use the standard CSS properties for registered axes whenever you can, and save font-variation-settings for custom axes. Mixing the two carelessly can lead to settings that override each other in confusing ways.

Why variable fonts matter for UI, not just branding

Finer hierarchy

With static fonts, your type scale is limited to the weights you loaded. With a variable font, you can pick exactly the weight that balances a heading against body text, or make a small label one notch heavier so it holds up on a low-quality screen.

Optical sizing

This is my favourite. Text at 12px needs looser spacing, sturdier strokes and simpler details than text at 48px. Fonts with an optical size axis adjust automatically, so small text stays readable and large headings stay elegant, all from one family.

Performance

One variable file can replace several static files. If your design uses four or more weights of a family, a variable version is often lighter overall and means fewer network requests. If you use only one or two weights, static files may still be smaller, so check before switching.

Responsive typography

Width and weight can respond to screen size. A slightly condensed width on narrow phones fits longer headlines without awkward wraps, and a touch more weight on small screens can improve legibility.

From my work

On Pukaar.ai, the design system used Satoshi in four weights: Regular, Medium, Bold and Black. That's the kind of multi-weight setup where, if a family offers a variable version, one file can replace several while keeping the same hierarchy.

Typography as interaction

This is where variable fonts become UI rather than just type. Because axis values can be animated smoothly, text can respond to the user.

Ideas that work well:

  • Hover and focus states. A link or button label can gain a little weight on hover. If the font has a grade axis, use it instead of weight, so the text gets bolder without changing width and pushing the layout around.
  • Pressed states. A subtle weight drop on press can make a button feel physical, similar to a micro-interaction.
  • Scroll-linked type. A large heading can shift weight or width as it scrolls into view. Use sparingly; it's a storytelling device, not a default.
  • Data emphasis. In dashboards, a value can get heavier as it crosses a threshold, adding emphasis without another colour.
  • Loading and progress. Weight or width can ease in as content loads, a gentle alternative to spinners.

Coming from motion design, this is a natural fit for me. The same rules apply as with any UI animation: purposeful, quick and eased properly. My post on kinetic typography for the web goes further into expressive type motion.

Watch out

Animating weight on a regular font changes letter widths, which makes surrounding text jump. That's layout shift, and it feels broken. Either use a grade axis, reserve space for the widest state, or only animate type in isolated elements like large headings.

Where variable fonts go wrong

Flexibility has a cost.

  • Too many values. If every screen uses a slightly different weight, you've lost your system. Define a short list of named styles (for example, body at 400, label at 520, heading at 680) and stick to it.
  • Motion overload. Text that changes shape constantly is hard to read. Keep animated type for small moments.
  • Accessibility gaps. Animated text must respect reduced motion settings. Very light weights at small sizes can fail readability even if colour contrast passes.
  • Rendering differences. Variable fonts can render slightly differently across browsers and operating systems, especially at unusual axis values. Test on real devices.
  • Licensing. Not every family has a variable version, and licences for web, app and desktop use can differ. Check before committing.

Setting up variable fonts in your workflow

  • Choose a family with the axes you actually need (weight and optical size cover most UI work).
  • Check licence terms for web and app use.
  • Define a small set of named text styles with exact axis values.
  • Set them up as text styles in Figma, which supports variable font axes in the type panel.
  • Document the axis values in your design system so developers use the same numbers.
  • Decide which interactions, if any, animate type, and note the duration and easing.
  • Add reduced motion fallbacks for any animated text.
  • Test rendering on iOS, Android and desktop browsers.

If you're setting up a type system from scratch, choosing colour and typography for apps and setting up a design system in Figma cover the foundations.

Work with us

Want a team to design it with you? Our UI/UX design agency for startups and SaaS takes products from research to developer handoff.

FAQ

What are variable fonts in UI design?

Variable fonts are single font files that contain a range of styles along axes like weight, width and optical size. In UI design, they allow finer hierarchy, automatic optical adjustments, responsive type and smooth animated text states, often with fewer files to load than a set of static weights.

Are variable fonts good for performance?

Often, yes. One variable file can replace several static weights, which can reduce total file size and network requests. But if you only use one or two weights, static files can be smaller, so compare the actual file sizes for your design.

Can I use variable fonts in Figma?

Yes. Figma supports variable fonts, and you can adjust supported axes such as weight and width in the type settings. Save the exact values as text styles so your designs and your code use the same numbers.

Key takeaways

  • Variable fonts hold a whole range of styles in one file, controlled by axes.
  • Weight and optical size are the most useful axes for everyday UI work.
  • Type can become interactive through hover, press and scroll states, used sparingly.
  • Avoid layout shift by using a grade axis or isolating animated type.
  • Keep a short list of named styles so flexibility doesn't break your system.

What to do next

Look at your current type scale and count how many font files you load. If it's four or more weights of one family, try its variable version and compare. Then pick one interaction, like a hover state, and see whether type can do the job instead of colour. If you'd like help building a type system that feels alive but stays consistent, tell me about your project.

Saurabh Yadav's Memoji

Written by

Saurabh Yadav

Founder of Design Studio by Saurabh, a UI/UX design studio in India. We design apps and websites that feel effortless, from research to shipped pixels. Most recently: Pukaar.ai, as seen on Shark Tank India, and the Demerara Bank app.

Keep reading

All articles →