Level 2 · Reusable, systematic design · about 10 minutes · free
Variants: one component, many states
Buttons have hover and disabled states; cards can be default or featured. Variants keep every version in one tidy set with simple switches.
Start the interactive lesson: narrated demo, steps and quiz →
What you’ll learn
- Add variants to a component
- Name properties as property=value
- Switch an instance's variant
Step by step
- Go to the Components page and select the main Profile card.
- Click + Add variant. FigCraft wraps it in a set and adds Variant2.
- Select Variant2. Set its fill to E6F4EE and its stroke to 1 px 8CCBB4.
- Rename the variants: double-click and type Style=Default and Style=Featured.
- Select the set. The right panel shows a property Style with two values.
- Back on Screens, select Jonah's instance.
- A Style menu appears. Choose Featured.
- The look changes; Jonah's name stays.
- Add a third variant Style=Muted with fill F2F4F3 and no shadow.
- Set Mara's instance to Muted and back to Default. Save.
Tips
- Plan the matrix. Size × State × Type multiplies fast: 3 × 4 × 2 = 24 variants. Keep only what the product uses.
- Use the words developers use. State=Disabled, not ‘greyed-out version’. Your property names become their code props.
- Boolean and text properties. Not every difference needs a variant. ‘Show icon’ (true/false) and ‘Label’ (text) are simpler.
Check yourself
Why not just make two separate components, Card and Featured card?
Variants keep them in one set, so any instance can switch with one click and keep its content.
FigCraft is an open-source project by its own authors. Craftpath is an independent, free learning resource.