Variant
A version of a component, such as size or state.
See it on the 3D treeGoing deeper
Variants are alternatives within one component, organised by properties such as type, size or state. A button might have primary and secondary types, each with default, hover and disabled states. In Figma they are grouped into a set; in code they are usually selected through props. Every combination multiplies upkeep.
Why it matters
A clear set shows which options are supported, so people choose one instead of detaching or inventing their own.
In practice
You add a destructive variant to the button for deleting accounts, defining its hover, focus and disabled appearance too.
Common mistake
Creating a new variant for every one-off request until the set is too large to maintain or understand.
Connected terms
- Component LibraryVariants group a component's sizes, styles and states within the library.
- PropsProps are the settings that select which variant appears.
- ComponentA variant is one configuration of a component, sharing its purpose and structure.
- Focus StateInteractive variants need a visible focus appearance for keyboard users.