Skip to content

Figma Components That Scale Without Breaking Your Files

Master figma components with variants, auto layout, and the slots pattern. Learn when to split, when to combine, and how to keep libraries maintainable.

· · 5 min read
Abstract colorful squares in a geometric grid representing modular Figma component systems

Most Figma libraries do not fail because of bad taste. They fail because of duplication. Figma's own guidance shows that component properties can collapse dozens of near identical layers into one flexible component (Figma - Create and manage component properties). I have rebuilt libraries where a single button existed as 60 separate frames. Sixty. After a properties rewrite it was one component set with two variants and three properties. Same coverage, a fraction of the maintenance.

This guide is about the four tools that decide whether your components scale: variants, auto layout, component properties, and the slots pattern. Get the split right and updates take minutes. Get it wrong and every design token change becomes a scavenger hunt.

Designer working on interface layouts at a laptop on a desk
Photo by Procreator on Unsplash

When should you use variants versus separate components?

Use variants for states of the same object, and separate components for genuinely different objects. Figma lets a single component set hold many variants organized by named properties like Size or State (Figma - Create component variants). That power gets abused constantly. A variant set should read like a small, obvious grid, not a junk drawer.

Here is the test I run. Could these two things ever swap into the same spot on a screen? A primary and secondary button, yes. A button and a dropdown, no. If the answer is no, split them.

  • Same object, different state: use variants (default, hover, disabled)
  • Different content, same shape: use a component property
  • Genuinely different UI element: separate components entirely

I once inherited a set called "Element" with 84 variants. Cards, chips, and tags all crammed together. Nobody could find anything. We broke it into three components and the panel finally made sense.

How do component properties cut duplication?

Component properties let one variant carry variable content, which is where the real duplication savings live. There are four types worth knowing: boolean, text, instance swap, and variant. On a typical button I use a boolean to toggle a leading icon, a text property for the label, and an instance swap so the icon itself is exchangeable without a new draw.

Boolean and text properties

Booleans show or hide layers. Text properties expose editable strings directly in the right panel, so nobody double clicks four layers deep to change a label. Small thing, huge time saver. On a notification component I expose the title text, the body text, and a boolean for the dismiss button. That single component covers what used to be nine frames.

Instance swap properties

Instance swap is the quiet hero. It lets a consumer replace a nested instance from a dropdown, so one card can host any icon in your set. This is also the mechanism behind slots, which I will get to.

MacBook Pro beside an external monitor used for UI design work
Photo by Andreas Palmer on Unsplash

How does auto layout keep components responsive?

Auto layout is the resizing engine that makes a component adapt instead of shatter when content changes. Set a frame to hug or fill, define padding once, and children reflow automatically. My default button uses 12 pixels vertical and 16 horizontal padding, hug height, and a label set to fill.

Nesting is the part people skip. A card is really three stacked auto layout frames: header, body, footer, each with its own gap. Set each child's resizing on purpose.

  • Fixed: avatars, icons, anything with a locked dimension
  • Hug: labels and tags that should shrink to their content
  • Fill: text blocks and containers that should stretch

Do you really need a 320 pixel and a 480 pixel version of the same card? Usually not. One auto layout card handles both widths.

What is the slots pattern and why does it matter?

The slots pattern uses an instance swap on a placeholder frame so a wrapper component owns layout while consumers supply content. Think of a modal that controls padding, max width, and shadow, but exposes a Content Slot you fill with anything. I build one shell instead of a dozen modal variants.

This is my favorite pattern for maintainability at scale, and I will say something a little contrarian: most teams over build variants and under use slots. Slots keep wrapper logic in exactly one place. Change the modal shadow once, every modal follows. The cost is discoverability, so name the property clearly and ship two or three starter instances.

Nesting slots inside slots gets fragile fast, though. I cap it at two levels. Beyond that, debugging why a padding value is not applying eats an afternoon, and I have lost that afternoon more than once.

Keeping libraries maintainable

Maintainability comes down to fewer, smarter components rather than more clever ones. Every extra variant is a future edit multiplied across the file. Before adding one, ask whether a property covers it. Before adding a component, ask whether a variant covers it.

The libraries I trust share three habits. Named properties that read plainly. Auto layout on every container. Slots for wrappers instead of endless variants. Do that and your files stop breaking under their own weight, and a design token update ripples through your whole product in one pass, not fifty.

Components are the layer your tokens ride on, so wire them into a real pipeline with design tokens from Figma to code. If you're assembling the whole library from scratch, the step-by-step design system guide covers the structure around them, and a handful of Figma plugins that save time speed up the repetitive parts of building variants. If a stakeholder is pushing a simpler tool instead, the Canva vs Figma comparison shows why components like these don't exist there. And once the library is built, the designer to developer handoff playbook turns those variants into specs engineers can ship.

Frequently Asked Questions

When should I use variants instead of separate components?
I use variants when things are the same object in different states. A button that is default, hover, disabled, or loading? One component set with variants. A button versus an avatar? Those are separate components, full stop. My rule of thumb: if two things would never appear in the same slot in a real screen, they should not live in the same set. Variants exist to swap states, not to bundle unrelated shapes into one crowded panel. When I see a set with 40 variants and five unrelated properties, someone forced navigation into a component set that should have been three components. Keep sets small. If the property matrix stops making sense at a glance, split it.
Do component properties replace variants entirely?
No, and I have watched teams try. Properties and variants solve different problems and I use them together on almost every component. Variants handle discrete visual states you draw once, like size or emphasis. Component properties handle the content and toggles inside a single variant: a boolean to show or hide an icon, a text property for the label, an instance swap to change which icon appears. On a real button I might have two variants for size, plus a boolean for the leading icon, plus a text property for the label. That is roughly 90 percent less duplication than drawing every combination. Reach for a property when the change is content. Reach for a variant when the change is layout you cannot express as a simple toggle.
How does auto layout make components responsive?
Auto layout is what lets one component instance stretch, hug, or fill without you resizing every child by hand. I set the frame to hug contents vertically and fill container horizontally, then set padding once, usually 12 by 16 pixels for a standard button. When the label text grows, the whole component grows with it. Nested auto layout is where it gets powerful: a card with a header, body, and footer stack, each with its own spacing, all reflowing when content changes. Set resizing behavior deliberately per child. Fixed width for an avatar, fill for a text block. Get those two behaviors right and a single card component handles a 20 character title and a 200 character one without a second draw.
What is the slots pattern and when do I use it?
The slots pattern uses an instance swap property on an empty or placeholder frame so consumers can drop any content inside a wrapper you control. I use it for layout shells: a modal that owns padding, shadow, and max width, but does not care what goes in the body. Instead of building 15 modal variants, I build one modal with a content slot, then swap in whatever the screen needs. It keeps the wrapper logic in one place. Update the shadow once and every modal updates. The tradeoff is discoverability, since a slot is less obvious than a labeled variant, so I name the property clearly, like Content Slot, and ship a couple of ready made instances people can start from.