All posts

Figma Component Properties and Slots: Build Flexible Components

· Figma, Design systems, UI/UX design

Most component libraries fail in the same way. Someone needs a card with two buttons instead of one, the component does not allow it, so they detach. Six months later half the product is detached instances and the library is decoration.

Figma’s component properties exist to stop that. Used well, one component covers the real cases without exploding into hundreds of variants. Here is how we decide which property to use, and how slots change the picture.

The five property types

Figma has five kinds of component properties:

  • Variant: switches between versions inside a component set, like size=sm/md/lg or state=default/hover/disabled
  • Boolean: shows or hides a layer, like an optional icon or badge
  • Text: exposes a text layer so it can be edited from the right sidebar
  • Instance swap: lets people swap a nested instance, like the icon inside a button, from a curated list
  • Slot: an area inside the component where people can add, remove and reorder content without detaching

Properties do not lock other layers. They make the intended controls easy to find, which is most of what a good component needs.

Variant or boolean? A simple test

Ask: does the change alter the design, or just whether something is there?

  • A different size, state or emphasis changes spacing, colour and type. That is a variant.
  • An icon that is present or absent changes nothing else. That is a boolean.

The classic mistake is a button set with variants for icon=left, icon=right, icon=none multiplied by every size and state. Replace that with two boolean properties (show left icon, show right icon) plus an instance swap for the icon itself. The set shrinks dramatically and does more.

Text properties: separate content from structure

Expose the text a designer should change, and leave fixed labels alone. A toast might keep its “Success” heading fixed but expose the message. A table header might expose every column label.

Name text properties after the content, not the layer: label, helper text, placeholder. Nobody knows what Text 3 means.

Instance swap: curate the choices

Instance swap properties are for nested components that should be replaceable: icons, avatars, illustrations, trailing actions. Always set preferred values. Without them, the swap menu shows every component in every library, and people pick something that almost fits.

A good default: icons in buttons prefer your 20 or 30 most-used UI icons, not the full set of 600.

Slots: the end of “placeholder” hacks

Before slots, libraries faked flexible areas with a placeholder component that designers swapped for a local component they built themselves. It worked, but it was fragile and confusing for anyone new.

A slot is a native flexible area. Inside an instance, you can drop in any layers or instances, edit them and reorder them, without detaching. Slots are now generally available, and they are the right tool for:

  • Repeating items with no fixed count: list items, menu items, form fields, table rows
  • Content areas with varying layouts: card bodies, modal content, page sections
  • Compositions: a modal with header, body and actions, each its own slot

Slots also reduce the number of variants and hidden layers you need, which makes the component easier to maintain.

Slot settings that keep things tidy

When you set up a slot, configure it instead of leaving it wide open:

  • Minimum and maximum items, for example a segmented control that needs two to five options
  • Preferred instances, so the add menu suggests the right components first
  • Only allow preferred instances, when the slot should hold one kind of thing, like checkbox inside checkbox group
  • Display empty by default, so designers see where content goes
  • Fill container, so inserted items stretch to the slot width

Figma flags content that breaks these settings rather than making it impossible to add, so treat them as strong guidance and back them up with documentation and design reviews.

Empty or pre-filled?

Publish a slot empty when every use is different and you want designers to make a choice. Pre-fill it with default content when most uses look the same, so the component works straight from the assets panel. Decide deliberately for each slot.

Naming that scales

  • Properties in lowercase, plain words: size, state, show icon, label, content
  • Variant values that match code where possible: sm, md, lg rather than Small, Medium, Large if that is what developers use
  • Boolean names that read as a question with a yes or no answer: show badge, has divider
  • Slot names that describe what goes in them: items, actions, content, header

If your developers build with React, Vue or web components, slots map naturally to children and named slots in code. Aligning names here pays off at handoff.

When not to use a property

  • Do not add a variant for every edge case. If a combination appears once in the product, a local adjustment in that file is fine.
  • Do not expose everything. A card with 14 properties is harder to use than two simpler components.
  • Do not hide layout problems with booleans. If hiding a layer leaves awkward spacing, fix the auto layout instead.

Checklist before you publish a component

  • Built on auto layout, with spacing and colour bound to variables
  • Variants only for real design differences
  • Booleans for optional elements, text properties for content
  • Instance swaps with preferred values
  • Slots configured with limits and preferred instances
  • A short description and a link to usage notes

Components are the half of a design system people touch every day; variables are the half they rarely see. If you have not set up variables yet, start with our guide to Figma variables. For the bigger picture, read how to build a design system in Figma.

Sources

Need this done well?
We design it for you.

Tell us about your brand, product or pipeline. A 30-minute call is usually enough to know if we are a fit.