Visual design · Step 6 · 8 min read
Visual states: hover, focus and disabled
Hover, focus and disabled are not decoration. They are the visual layer of feedback that tells users what is interactive, where they are, and what they cannot do. This lesson defines the four visual states and shows how each should look — and why the focus ring is a legal requirement, not a style choice.
Visual states — hover, focus and disabled — are not decoration. They are the feedback that tells users what they can do.
What you'll be able to do after reading:
- Name and describe the four visual states in the model
- Decide how each state should look for a given component
- Write CSS that shows a visible focus ring only on keyboard navigation
- Explain why the disabled state is more than setting opacity to 50%
1. The four states
The model for this lesson has four parts:
| State | Signal | Triggered by |
|---|---|---|
| Default | The resting appearance — interactive, nothing happening | — |
| Hover | Interactivity acknowledged — "you're pointing at something you can click" | Mouse or pointer enters the element |
| Focus (ring) | Location confirmed — "keyboard focus is here" | Keyboard navigation or programmatic focus |
| Disabled | Unavailable — "this cannot be used right now" | The parent context removes the interaction |
These four states appear on nearly every interactive component: buttons, inputs, links, checkboxes, selects, chips. The visual design job is to decide what each state looks like — not when it fires. The logic of when to disable, when to show loading, when to show error belongs to States and edge cases (Design systems) and Interface states: empty, loading, error, success (UX Foundations). This lesson is about the visual layer.
2. Default state
The default state is the resting appearance. It needs to signal interactivity without any additional cue. For a Gale Console primary button, that means:
- A filled background in Gale Blue (
oklch(0.52 0.16 240)) - White label text
- 4px border radius
- No shadow at rest (elevation is added when it overlays something)
The default state is the reference point for all other states. Everything else is a delta from it.
3. Hover state
Hover answers the question: "is this thing interactive?" It needs to change enough to be noticeable, not so much that it feels like something important changed.
For a filled primary button, the hover convention is to darken the background slightly — about 10–15% reduction in OKLCH lightness:
button:hover {
background-color: oklch(0.44 0.16 240); /* from 0.52 → 0.44 */
}
For a ghost button (outline only), hover typically adds a tinted background fill. For a text link, hover adds an underline or changes colour. The rule is the same everywhere: hover = one clear, reversible visual shift.
Hover does not apply on touch screens. Mobile interfaces skip hover states entirely — a tap goes straight from default to the action result. Design hover as enhancement, not as the only signal.
4. Focus state: the ring
The focus ring is not optional. It is the visual confirmation that keyboard focus is on a specific element.
WCAG 2.1 Success Criterion 2.4.7, "Focus Visible" (Level AA), requires that any keyboard-operable interface has a visible focus indicator (W3C, WCAG 2.1 SC 2.4.7). WCAG 2.2 added SC 2.4.11, "Focus Not Obscured (Minimum)" (Level AA), which ensures the focused component is not fully hidden behind sticky headers or overlays (W3C, WCAG 2.2 SC 2.4.11). And SC 2.4.13, "Focus Appearance" (Level AAA), specifies that the focus indicator must be at least 2 CSS pixels thick and have a contrast ratio of at least 3:1 between focused and unfocused states (W3C, WCAG 2.2 SC 2.4.13).
The practical minimum: a 2px solid outline, 2px offset from the element's edge, in a colour with sufficient contrast against the background. For Gale:
button:focus-visible {
outline: 2px solid oklch(0.52 0.16 240);
outline-offset: 2px;
}
The :focus-visible pseudoclass (MDN, :focus-visible) is key: it shows the outline only when the browser determines that the user is navigating by keyboard, not on a mouse click. This is the right default for most interactive components — the ring appears where it matters and stays invisible where it would only distract a mouse user.
One exception: for form inputs (text fields, textareas), the focus ring is appropriate on click too. Users need to see where their typing will go.
The ring colour does not have to match the brand's primary colour. It just needs to be visible. Many design systems use the same blue as the brand; others use a high-contrast black or a bright complementary colour. The constraint is contrast, not aesthetics.
:focus-visible — it appears on keyboard navigation, not on mouse click. The disabled state uses opacity on the original colour, not grey, so the form stays recognisable. Gale is fictional.Diagram: Marcus Andrey, CC BY 4.0.5. Disabled state
The disabled state has two parts: opacity and cursor.
button:disabled,
button[aria-disabled="true"] {
opacity: 0.4;
cursor: not-allowed;
pointer-events: none;
}
The opacity drop (typically 0.38–0.5, depending on the base contrast of the component) communicates visually that the element is inactive. The cursor change signals it at the pointer level. Taken together, they tell users: "this exists but cannot be used right now."
Two things to avoid:
Removing all colour. A common mistake is converting disabled elements to grey. For a primary blue button, grey-on-grey may read as a different component entirely — a secondary or ghost button. Lowering opacity on the existing colour is usually clearer: the form stays the same, only the weight drops.
Hiding the disabled state entirely. Elements that are disabled should still be visible. A planner in Gale Console needs to see that the "Assign crew" button exists, even when it cannot be used yet — it confirms that the action is available in the right context. If you hide disabled elements, users cannot understand what the product can do.
A note on pointer-events: none: this removes all mouse and touch interaction, which is the right behaviour for disabled elements. But keep the element in the focus order if users need to discover it; use aria-disabled="true" and handle the click event yourself if you need a disabled element to be reachable by keyboard.
6. Visual states vs. state logic
This lesson covers how the four states look. Two other lessons cover the logic of when they fire:
- Interface states: empty, loading, error, success (UX Foundations) defines the types of screen states a UI can be in — empty, loading, partial, error, success — and when to use each.
- States and edge cases (Design systems) covers how components handle the full range of states in a component library, including how to design for edge cases.
The two levels work together. Visual states (this lesson) tell users what is happening right now on a specific element. Screen states tell users where the whole interface is in a task flow. Neither replaces the other.
States resolved. The step 6 ends with polish: the adjustments that make a screen look professional.
7. Common mistakes
- Removing the focus ring because "it looks bad." The ring is a legal accessibility requirement in many jurisdictions (via WCAG conformance). Remove the browser default only if you replace it with a custom ring that meets the contrast requirement.
- Hover = disabled colours. Some teams colour the hover state with the same muted grey as the disabled state. The two states now look identical and users cannot tell whether a briefly-greyed button is hovered or disabled.
- Full opacity on disabled. An element that looks fully active but does nothing on click is more confusing than one that looks clearly inactive.
:focuswithout:focus-visible. Using:focusalone shows the outline on every click, including mouse clicks, which looks jarring. Prefer:focus-visiblefor buttons and links; use:focusfor inputs.- Missing disabled cursor. Lowering opacity without changing the cursor leaves the pointer as a hand/pointer — users try clicking and nothing happens.
8. Try it
Open any web app that has a primary button (most web apps do — a login page works well).
- Tab to the button using the keyboard. Does a visible focus ring appear? Describe it in one sentence: outline vs. box-shadow, colour, thickness.
- Mouse over the button. Does it change? Describe the hover state: colour change, shadow, scale.
- Find a form with a disabled submit button (or one that starts disabled before you fill the form). What does the disabled state look like? Is the cursor different?
What to produce: three sentences — one per state — describing what you see, plus one sentence noting if any state is missing or hard to see.
How to know it's good: you can describe the focus ring with enough precision that someone could reproduce it in CSS without seeing the original.
9. If you already practise
- Run through your current project using only the keyboard (Tab, Shift+Tab, Enter, Space). Note every place where focus disappears or becomes invisible.
- Check whether your project uses
:focusor:focus-visible. The latter is supported in all modern browsers (MDN, :focus-visible) and is the right default for most interactive elements. - Read the WCAG 2.2 understanding document for SC 2.4.11 (Focus Not Obscured, Minimum). Check whether any sticky navigation in your product hides the focused element.
Checklist
Learn more
- W3C, WCAG 2.1 SC 2.4.7 — Focus Visible
- W3C, WCAG 2.2 SC 2.4.11 — Focus Not Obscured (Minimum)
- W3C, WCAG 2.2 SC 2.4.13 — Focus Appearance
- MDN — :focus-visible
- Material Design 3 — States: how Material implements the state layer model
Books, courses and videos to go deeper
Book links go to Amazon. As an Amazon Associate I earn from qualifying purchases, at no extra cost to you.
Related
Visual consistency across components · The last 10 percent · States and edge cases · Interface states: empty, loading, error, success · Accessible components · Contrast ratios and WCAG