Visual States
Every interactive element needs a defined appearance for every state it can be in, and most designs specify only two.
Definition
Visual states describe how a component looks in each condition: rest, hover, focus, active, selected, disabled, loading, error and read-only. Undefined states become implementation decisions, which is how inconsistency enters a product.
Craft convention. True because the industry converged on it. Breaking it costs familiarity, not correctness.
On this plate
Reach for this when
- Specifying any interactive component.
- Reviewing keyboard accessibility.
- Writing design system documentation.
- Specifying a component for a design system, where the states will be implemented once and used everywhere.
Common mistakes
- Removed focus indicators.
- Hover as the only interactivity cue.
- Undefined combined states.
- Disabled styling that fails contrast and offers no explanation.
The states to specify
| State | Trigger | Notes |
|---|---|---|
| Rest | Default | Must already signal that the element is interactive. |
| Hover | Pointer over | Does not exist on touch. Never the only cue. |
| Focus visible | Keyboard focus | Mandatory. WCAG 2.4.7, with appearance requirements in 2.4.11. |
| Active or pressed | During the press | Brief. Confirms the input was received. |
| Selected | Persistent choice | Must differ from hover and from focus. |
| Disabled | Unavailable | Explain why. Frequently fails contrast, so do not rely on it alone. |
| Loading | Operation in progress | Prevent double submission and announce to assistive technology. |
| Error | Validation failure | Needs text, not only colour. |
| Read-only | Viewable, not editable | Different from disabled: content should still be selectable. |
Combined states are where bugs live
- Selected and disabled together.
- Focused and in error together.
- Hovered and loading together.
- Selected and hovered, where the two treatments can cancel out.
- Specify the precedence order explicitly, or each implementation will invent its own.
Specifying states so they are not invented later
Do
- Specify default, hover, focus, active, disabled, loading, error and selected for every interactive component.
- Define the combinations that can occur, such as focused and disabled, or selected and hovered.
- Make focus visible against every surface the component can appear on.
- Say what disabled means in words nearby, so it is not a dead end.
Do not
- Remove the focus outline to tidy the design.
- Use hover as the only way to reveal an action.
- Let loading states borrow the disabled styling, so nobody can tell which is which.
- Leave the empty and error states of a component to be discovered during build.
In practice
- i.
Disabled buttons with no explanation
FormsA disabled submit button tells the user nothing about what is missing. Either keep it enabled and show specific errors on submission, or state the blocking condition next to it.
- ii.
Focused and disabled at once
Where the bugs liveA disabled button that can still receive focus, styled so that focus is invisible against the faded fill, leaves a keyboard user stranded with no indication of where they are. Combinations are where state specifications usually stop.
Local chart
FND·053 · Region II · Grid D1
This entry and the entries it is stated to connect with. Each line is labelled with what the connection means.
Sources
Where a source establishes something narrower than the popular reading of it, the note says so.
- [1]
- [2]
MDN Web Docs
Continue from here
Each link says what the connection is, so you can tell a principle from an alternative from a thing people mix this up with.
Principles behind this
The reasoning this solution is an application of.
- Affordances and SignifiersPRIN·007 · Principle
- ConstraintsPRIN·009 · Principle
- FeedbackPRIN·004 · Principle
Often used with
These usually appear in the same screen or the same decision.
- Product SpecificationTPL·011 · Template
- User FlowTPL·005 · Template
- Figma Dev ModeTOOL·042 · Tool
- StorybookTOOL·037 · Tool
Short definition
The one-paragraph version, for when that is all you need.
- Acceptance CriteriaTERM·095 · Term
- Design QATERM·113 · Term
- HandoffTERM·112 · Term
- MicrointeractionTERM·035 · Term
- SignifierTERM·005 · Term
- StateTERM·036 · Term
Related concept
Connected closely enough to change how you apply this.
- Focus IndicatorsA11Y·003 · Accessibility
- Keyboard NavigationA11Y·002 · Accessibility
- Design System to DocumentationAI·007 · AI workflow
- Feature Idea to UX SpecificationAI·004 · AI workflow
- Component Anatomy, States and VariantsSYS·009 · Design system
- Component API DesignSYS·002 · Design system
- Design System DocumentationSYS·003 · Design system
- Design TokensSYS·001 · Design system
- MotionFND·052 · UI foundation
- SimilarityFND·005 · UI foundation
- Error MessagesWRT·002 · UX writing
- Design HandoffFLOW·002 · Workflow
- Design QAFLOW·003 · Workflow