What Is Variant in Figma: Simple Explanation and Uses
variant is a way to group similar components together under one set, making it easier to manage and switch between different versions like buttons with different states. Variants help designers organize related designs in one place and quickly change properties without creating separate components.How It Works
Think of variants in Figma like a wardrobe where you keep all your shirts together, but each shirt has different colors or patterns. Instead of having separate closets for each shirt, variants let you store all these options in one organized place.
When you create a variant, you combine similar components that differ by some properties, such as color, size, or state (like normal, hover, or disabled). This grouping allows you to switch between these options easily by changing variant properties, saving time and keeping your design tidy.
Example
This example shows how to create a button component with variants for different states: default, hover, and disabled.
Component Button {
Variant State: Default, Hover, Disabled
Properties:
- Background Color
- Text Color
}
// Usage:
Button(State=Hover) => Shows button with hover colors
Button(State=Disabled) => Shows button with disabled colorsWhen to Use
Use variants when you have multiple versions of a component that share the same structure but differ in appearance or behavior. For example, buttons with different states (normal, hover, pressed), icons with different colors, or cards with various layouts.
This helps keep your design system clean and makes it easier to update or switch between component versions without duplicating work.
Key Points
- Variants group similar components with different properties into one set.
- They simplify switching between component versions in designs.
- Variants improve organization and reduce duplication.
- They are essential for building scalable design systems.