Using Component Variants and Properties
Clean up your component library by using Variants and Properties. This lesson covers how to group similar components and simplify instance management.
Lesson Video
Lesson Content
Learning Objectives
- •Combine multiple components into a single Variant set
- •Define properties like state (hover, disabled) and size
- •Implement boolean properties for showing/hiding elements
- •Utilize instance swap properties for icons and other sub-components
What You'll Learn
- Setting up a Variant set for UI elements
- Configuring properties (Toggle, Text, Instance Swap)
- Simplifying the user experience for other designers
- Best practices for naming variant properties
Key Concepts
Key Takeaways
- ✓Variants group related components (e.g., Primary, Secondary, Hover buttons).
- ✓Component properties reduce the need for dozens of specific variants.
- ✓Boolean properties allow for easy toggling of UI elements like icons or labels.
- ✓Well-structured components make the design system intuitive for the entire team.
Practice Tasks
Button Variant Set
Group related buttons into a variant set and define their states.
- Create two buttons: 'Primary' and 'Secondary'
- Select both and click 'Combine as Variants'
- Rename the property to 'Type' and the values to 'Primary' and 'Secondary'
- Add a second property called 'State' and create 'Hover' and 'Default' values
Component Properties Management
Reduce variant complexity by using boolean and instance swap properties.
- Select an icon inside your button component
- Create a 'Boolean' property named 'Show Icon' to toggle visibility
- Create an 'Instance Swap' property to easily change icons in instances
- Verify properties appear clearly in the right sidebar when selecting an instance
Knowledge Check
Pass with 70% or higher
1. What is the primary purpose of 'Variants' in Figma?
2. When using 'Boolean' component properties, what kind of control does the user see in the sidebar?
3. What is an 'Instance Swap' property used for?
4. How should you name variants to ensure they are properly organized in the UI?
Lesson FAQ
We highly recommend opening your own Figma workspace in a side window and repeating the steps shown in the video. Utilize the tasks checklist above for specific practice targets.
Double-check parent-child constraints and resizing values (e.g. Hug vs Fill). Ensure Auto Layout direction is correct and check the related guidebooks below for step-by-step visual references.
Lesson Resources & Connections
Prerequisites
No prerequisites required. This is a foundational starter lesson.
Related Guidebook
How to create button states in Figma using variants
Read Guidebook →Relevant Design Tool
Lesson Navigation
Next Lesson
Building and Organizing a Design System