Design7 min

Figma design system setup: variables, components and tokens

A practical Figma design system setup: how I structure variables and tokens, build components with variants, and organise a library developers trust.

Saurabh YadavFounder, Design Studio by Saurabh
DesignFigma variables
Share

Opening a blank Figma file to "build the design system" is a strange feeling. There are a hundred tutorials, a dozen plugins and several naming philosophies, and most of them assume you have a dedicated design systems team. You probably don't.

I build and maintain a design system and component library as part of my work at Ksolves, and I set up the shared system behind Demerara Bank's mobile app and web banking. What I've learned is that the order you build things in matters more than any individual technique. Get the foundations right and components almost build themselves. Get them wrong and you'll be detaching instances for the rest of the project.

This is the setup I actually use, step by step.

Decide the scope before you open Figma

A design system for a two person team doesn't need the same structure as one for a bank with forty screens across two platforms. So I answer three questions first:

  • What products will use it? One app, or app plus web? Demerara needed one system shared across iOS, Android and a web banking revamp, so naming had to work for all three.
  • Do we need themes? Light and dark, multiple brands, or white label clients. This decides how many modes your variables need.
  • Who maintains it? If the answer is "whoever has time", keep it small. I wrote a whole post on design systems for small teams because this is where most systems quietly die.

Write the answers at the top of your library file's cover page. Future you will be grateful.

Build foundations with variables, in two layers

Figma variables are the closest thing Figma has to native design tokens. A variable stores a single value (a colour, a number, a string or a boolean), and variables live in collections that can have multiple modes, such as light and dark.

The setup that has saved me the most pain is splitting tokens into two layers.

Layer 1: primitives

Primitives are the raw palette. They describe what a value is, not where it's used:

  • green/900, green/500, gold/500, grey/50 to grey/900
  • space/4, space/8, space/12, space/16, space/24, space/32
  • radius/4, radius/8, radius/16, radius/full

I put these in a collection called "Primitives" and hide it from publishing, so designers can't pick green/500 directly on a button.

Layer 2: semantic tokens

Semantic tokens describe what a value does. They point to primitives:

  • color/bg/primary → green/900
  • color/text/default → grey/900
  • color/text/muted → grey/600
  • color/border/subtle → grey/200
  • color/feedback/error → red/600

This is where modes earn their keep. In a "Light" mode, color/bg/surface points to white. In a "Dark" mode, it points to a dark grey. Every component built on semantic tokens switches theme for free. (Dark mode needs more than swapping values, which I cover in designing dark mode properly.)

On Demerara, the brand was three colours: Demerara Green #004E32 as primary, Growth Green #00A155 and Heritage Gold #D09106. Three primitives families, mapped to a short list of semantic roles, carried both the app and the web product.

Spacing and type

I use a 4 point spacing scale and resist adding odd values. If someone needs 14px, the answer is usually 12 or 16.

For typography, I still create text styles for each role (Display, Heading, Body, Caption, Label), and I bind their size and line height to number variables where it helps responsive variants. Keep the list short. Demerara used one typeface, Red Hat Display, partly because its figures are clear for balances on budget phones. Pukaar.ai used Satoshi in four weights. One family, a handful of sizes, done.

Name things so developers can read them

Naming is where design and code either meet or drift apart. My rules:

  • Use slashes to group: color/text/muted, not MutedTextColour.
  • Name by role, not appearance: color/feedback/success, not color/green-light.
  • Agree on names with a developer before you build 200 of them. Ten minutes of conversation saves weeks of mapping.
  • Avoid numbers in semantic names. color/text/2 tells nobody anything.

Tip

Open the developer's existing CSS or theme file before you name anything. If they already call it text-muted, matching that saves everyone a translation step.

If your developers use a token pipeline, a plugin such as Tokens Studio can sync tokens between Figma and code. I'd only add that once the manual setup is stable. A sync tool won't fix a messy structure, it'll just spread the mess faster.

Build components from the inside out

Once foundations exist, I build components in this order: icons, then small atoms (buttons, inputs, checkboxes, tags), then composed pieces (list items, cards, navigation bars, dialogs).

For each component, my checklist:

  1. Auto Layout everywhere. Padding and gaps use spacing variables, so a change at the token level ripples through.
  2. Bind every colour and radius to a semantic variable. No hex values inside components. Ever.
  3. Variants for real differences only. Size (small, medium, large), type (primary, secondary, ghost) and state (default, hover, pressed, disabled, focus). If two variants differ by one colour, it's probably a property, not a variant.
  4. Component properties for content. Boolean properties to show or hide an icon, text properties for labels, instance swap for icons. This keeps the variant count sane.
  5. All states designed, including focus and error. Focus rings are the most commonly forgotten state, and keyboard users notice.
  6. Test with ugly content. Put a very long label in the button. Put a Hindi string in the input. If it breaks, fix the Auto Layout now.

Build a component when it has appeared on at least three screens. Before that, it's a guess.

Watch out

The quickest way to an unusable library is a variant for every combination. If your button has more than a few dozen variants, move icons and labels into component properties.

Organise the library like a product

A library is something people use daily, so I design its structure too:

  • Cover page with version, owner, last updated date and the scope answers from step one.
  • Foundations page showing every colour role, type style, spacing step and elevation level, with names visible.
  • One page per component group (Inputs, Buttons, Navigation, Feedback), each component with a short usage note: when to use it, when not to.
  • A changelog page. Even three lines per release ("Added error state to Select, renamed color/bg/2 to color/bg/subtle") builds trust.

Publish the library, and keep project files as consumers. Designers should never edit the main component inside a product file.

Note

Publishing isn't the finish line. Each publish is a release, so write the changelog line at the same moment, not later from memory.

Hand it over and keep it alive

The system only matters if it reaches code. I prepare components in Dev Mode with variables visible, so developers see color/text/muted instead of a hex value they'll copy wrongly. My developer handoff checklist goes deeper on that.

To keep it alive, I do three things. I review new screens for detached instances every sprint. I keep a "proposals" page where anyone can drop a component they think is missing. And I remove things that nobody uses, because a smaller system people trust beats a bigger one they ignore.

When a system starts slipping, the signs usually look like this:

Symptom Likely cause Fix
Lots of detached instances Component doesn't cover a real need Add a property or variant, then reattach
Hex values in product files Semantic tokens missing or hard to find Add the role, hide primitives from publishing
Dark mode breaks on some screens Components bound to primitives Rebind to semantic tokens
Developers ask "which grey?" Names describe looks, not roles Rename by role and log it in the changelog
Nobody opens the library No usage notes, unclear owner Add a cover page, owner and short usage notes

Work with us

Want this set up properly? Our design system agency builds Figma libraries, tokens and documentation that scale with your team.

Key takeaways

  • Decide scope, themes and ownership before you build anything.
  • Split variables into primitives (raw values) and semantic tokens (roles), and use modes for themes.
  • Name tokens by role, and agree names with developers early.
  • Build components with Auto Layout, bound variables and only meaningful variants.
  • Treat the library like a product: cover page, usage notes, changelog and regular clean ups.

Need help setting yours up?

A good Figma design system isn't about having the most components. It's about making the right decision once, so nobody has to make it again.

If you're starting a design system for your product, or untangling one that grew messy, tell me about your project. You can also see a shared mobile and web system in action in the Demerara Bank case study.

For the bigger picture beyond Figma, including code, documentation and governance, read how to build a world-class design system.

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 →