Component states and variants
- 01 Feb 2023
- 1 Minute to read
- DarkLight
Component states and variants
- Updated on 01 Feb 2023
- 1 Minute to read
- DarkLight
Article Summary
Share feedback
Thanks for sharing your feedback!
When it comes to states or variants, there are many ways to approach building a component in Sketch.
For components that have designated states—like buttons or input fields—we recommend building unique symbols for each state rather than using overrides to account for states.
We recommend this approach because:
- The states and variants are then accessible through Sketch.
- If you need to change details of a specific state in the future (e.g., updating your primary button hover), you can do so efficiently, knowing that everywhere that state is used, it will be updated.
- It speeds up delivery time for designers. They no longer have to pull down a symbol source and update layer and text styles to account for a specific state.
- It maintains consistency of the system and ensures designers are using a component state properly. When using a single symbol source with overrides, it’s easier for designers to inaccurately build a component’s state or to apply styles they aren’t supposed to use.
- It makes it easier for developers to understand what component state is used in screen design. The symbol name will appear in Inspect when developers inspect a design to build.
Warning: Be aware that the downside of this approach is that editors of the system will need to update all symbols if a property that's shared across all component states changes. For example, if the border radius of the button changes, you'll need to update all button symbols instead of just one.
Was this article helpful?