<?xml version="1.0" encoding="utf-8"?>
Open full project

Designing a lean, future-proof component that scales without the bloat

Background & Challenge

Memory errors

When a product design system/library crossed a few hundred components, every additional button variant starts to hurt, a lot. Figma’s memory ceiling of 2GB (and sluggish variant-picker UI) turned routine updates into five-second waits. And if you don't have a plan to move out of it, your entire design system will break Figma, something I've experienced.

Headless UI

There is a concept called Headless UI within code, where you abstract the visual styling of a component and its properties. That is in some cases called theming. To create that within Figma, with consistency is a very, very time to consuming exercise.

🎛️ Headless Button System 1

Maintaining variants

Maintaining a matrix of style × state × size × color × brand is daunting when your library starts to grow. So the goal for this exercise was clear:

  • Keep every visual possibility designers need.
  • Slash the variant count so files stay lightning-fast.
  • Hand developers a component they can wire-up without digging for specs.

Solution Overview

I rebuilt the buttons as a headless system: a single base component whose appearance is controlled entirely by Variables & Modes, not by duplicating frames.

Palette (Transparency)

  • Full
  • Primary
  • Secondary
  • Disabled

Branding

  • 1
  • 2
  • 3
  • 4

Brand

  • Brand
  • Neutral

Semantic

  • Success
  • Warning
  • Error
  • Info

Color Mode

  • Light
  • Dark

Type

  • Filled
  • Outlined
  • Link

Style

  • Flat
  • Gradient

Size

  • Small
  • Medium
  • Large
  • XLarge

Comparison & impact

If I would create the button above with variants, that would've taken me:

4 x 2 x 3 x 2 x 4 x 2 x 4 x 4 = 6,144 variants to maintain

With the variable system I've created, I only have 6 variants.

🎛️ Headless Button System 2

Here I'm using the Figma plugin Variable visualiser to visualise the relationships between all variables & modes.

🎛️ Headless Button System 3

Automatic Stickersheet creation

Using this wonderful plugin, I can automatically create sticker sheets if the team/organisation I'm working doesn't want to pay for Dev Mode for the developers.

🎛️ Headless Button System 4

Dev mode

During all my years, something I've noticed is that most designers have no idea what a developer actually needs from us. Also, if not done correctly, you will have to extend onboarding for both designers and developers.

So in this project I applied good handover techniques:

  • 📝 Added a comprehensive description with examples. If you don't know what to write, seek help from LLM, here is an example I made for you.
  • 🔖 Annotations (add more context around the component). Inline call-outs explain which variables map to token names in code.
  • 📐 Rulers & redlines (around each state). Auto Layout rulers appear on hover, so devs can grab spacing without opening Inspect.
  • 💾 Dev resources section (top right corner). Links to Storybook stories, Chakra UI tokens, and a ready-to-drop React snippet live inside the component description for one-click access.

🎛️ Headless Button System 5

Variables → Design tokens

For this project I exported all my Figma Variables into Design Tokens, using this plugin, which outputs an json file; something I would then provide to the developers in my team.

🎛️ Headless Button System 6

States & Animations

There are some minor micro animations when going from different interaction state: default → hover → focus, and back again.

🎛️ Headless Button System 7

Prototype & changing modes on click

You can as user of this prototype change and modify the stylistic appearance of the components as easy as just clicking.

🎛️ Headless Button System 8

Bugs in Figma

There seems to be bugs in Figma when pressing these buttons. They work well in Design mode of Figma. But in Prototype mode, the seem to not behave as intended. Which can be seen in the image below:

🎛️ Headless Button System 9

Lessons & Next Steps

  1. Variables ✨ magic: They need naming discipline; a rogue “Primary 2” color can wreck themes. So, the maintenance of variants are moving towards the variable system in such a case that I've presented.
  2. Document the headlessness: New team-mates may look for variants that aren’t there. An onboarding loom video saved hours.
  3. Extend the pattern: The same headless approach should then be applied and rolled out to inputs, badges, and tabs.
Share your insights — leave a project review and help others grow their skills

Reviews

6 reviews


Really solid work on the Headless Button System! Love how you’ve structured the different states—default, hover, disabled—it’s super clean and dev-friendly. The consistent spacing and clear labels make it easy to scale across projects. Maybe adding usage examples in context (like within a form or modal) would make it even stronger, but overall, great system! 🔘✨


Excellent work! I really liked how you handled the styles and components, it’s clean and well-structured. I especially appreciate your attention to memory usage and accessibility. These details show a thoughtful approach to user experience and performance."


This is amazing! I definitely wouldn't mind taking a crack at it especially seeing as it simplifies design to dev handover! Not to mention the memory usage you save with Figma.

Thank for the kind words. I will explain, in more detail how I did this on my YouTube channel soon: https://www.youtube.com/@jonasbroms

Good job


Great Job


Looks good, you really have a good understanding of design systems clearly


47 Claps
Average 4.3 by 11 people
5 claps
4 claps
3 claps
2 claps
1 claps
<?xml version="1.0" encoding="utf-8"?>