Figma for Product Teams · 18 min · 130 XP
Component properties and slots
Boolean, text, instance-swap and variant properties: the cure for a component set with forty variants.
Variants describe what a component is: primary or ghost, large or small. Component properties describe what a particular instance shows. Confusing the two is how a button ends up with forty variants, one for every combination of leading icon, trailing icon and badge.
There are four kinds: - Boolean: show or hide a layer. One checkbox replaces the “with icon / without icon” variant split. - Text: expose a text layer's content in the properties panel, so it's editable without hunting through the layer tree. - Instance swap: let the instance choose which component sits in a slot. This is how you build a card that accepts any icon, or a list that accepts any row. - Variant: the dropdowns from the last lesson, for genuinely different states.
Before: 24 variants Type × Size × HasLeadingIcon × HasTrailingIcon After: 4 variants + 3 properties Type=Primary|Ghost, Size=Large|Small ⊕ Leading icon boolean ⊕ Trailing icon boolean ⊕ Label text
Instance swap is the one worth learning properly. Give a slot a default instance, expose it as a swap property, and point its preferred values at the component set it should offer. The designer using it gets a short, correct menu instead of a search across every component in the file. Nested instances can also be exposed, so a card's inner button shows its own properties on the card's panel without anyone selecting into it.
A rough test for whether something should be a variant or a property: if the two options would ever appear in the same design side by side, and the difference is what's in it rather than what it is, make it a property. States (hover, disabled, selected) are variants. Optional pieces are booleans. Interchangeable pieces are swaps.
Do it in Figma: take a button with leading and trailing icons, and delete every variant that exists only because an icon is present or absent. Replace them with two boolean properties and one instance swap. Count the variants before and after.
Loading your workspace…