Button States: The 7 States With CSS and Accessibility Rules
Last updated: November 18, 2026
Button states are the versions of a button that show what it can do and what it is doing. Most buttons need six: default, hover, focus, pressed, disabled, and loading. Toggle buttons add a seventh, selected. Each state needs its own style, the right HTML or ARIA, and enough contrast to see.
This guide is for the designer drawing the states and the developer building them. It covers what each state means, the CSS and ARIA behind it, and the WCAG 2.2 rules that apply. Button states are one part of a wider UI polish checklist.
The 7 Button States at a Glance
| State | Shows when | CSS or attribute | Rule to meet |
|---|---|---|---|
| Default | The button is ready | button | Label contrast of 4.5:1 (WCAG 1.4.3) |
| Hover | A pointer rests on it | :hover inside @media (hover: hover) | Contrast stays at 4.5:1 or more |
| Focus | Keyboard or voice focus reaches it | :focus-visible | A visible indicator (WCAG 2.4.7) at 3:1 (WCAG 1.4.11) |
| Pressed | While it is being pressed | :active | Feedback within about 0.1 second |
| Disabled | The action is not available | disabled or aria-disabled="true" | No contrast minimum, but say why |
| Loading | The action is running | A spinner beside the original label | Block repeat clicks and announce the result |
| Selected | A toggle is on | aria-pressed="true" | Not shown by color alone (WCAG 1.4.1) |
Default State
The default state, which Material Design calls enabled, is the button at rest. Every other state changes from it, so it has to work on its own: a label that says what will happen, such as “Save changes” instead of “Submit”, text contrast of at least 4.5:1 under WCAG 1.4.3, and a target of at least 24 by 24 CSS pixels under WCAG 2.5.8. Apple asks for a hit region of at least 44 by 44 points.
Use a real <button> element. It responds to Enter and Space and carries the button role without extra code. A div with a click handler only answers the mouse, even with role="button" added, as MDN explains.
Hover State
Hover tells someone using a mouse that the thing under the pointer is clickable. Keep it light: Material Design draws hover as the content color at 8% opacity. Check that the label still meets 4.5:1 after the change, and never put information only in a hover state, because touch screens and keyboards do not hover.
On touch screens a tap can trigger hover styles, so put hover rules inside @media (hover: hover), as Rauno Freiberg’s list of interface details recommends.
Focus State
Focus shows which button the keyboard will act on. WCAG 2.2 success criterion 2.4.7 requires a visible focus indicator, and because a focus ring is not text, success criterion 1.4.11 applies its 3:1 contrast minimum too. Material Design gives every state two visual indicators so the signal does not depend on one cue.
Use :focus-visible, which shows the ring for keyboard focus without drawing it on every mouse click, and give the ring an outline-offset so it sits clear of the button. Never remove the outline without a visible replacement, a rule in Vercel’s interface guidelines.
Pressed (Active) State
The pressed state confirms the click landed. In CSS it is :active, which MDN describes as the element being activated, typically from the moment the primary mouse button goes down. Apple’s Human Interface Guidelines warn that without a press state, a button “can feel unresponsive”, and Jakob Nielsen’s response-time limits put the feeling of an instant response at about 0.1 second.
Keep the change small: darken the background a step, or scale the button to about 0.96, as Freiberg suggests. Order matters in the stylesheet. A later :hover rule with the same specificity overrides :active, so write :active after :hover, the LVHA order MDN describes.
Disabled State
Disabled means the action exists but is not available right now. WCAG 2.2 exempts inactive components from its contrast minimums (1.4.3 and 1.4.11), and Material Design also exempts disabled states from its contrast requirements. In Material, disabled components can’t be focused, dragged, or pressed, and don’t change state on hover.
The harder question is whether people can find the button at all. The HTML disabled attribute removes a button from the tab order. aria-disabled="true" keeps it focusable, but you have to block the action in JavaScript yourself (MDN). The WAI-ARIA Authoring Practices keep a disabled control focusable when people need to discover it, because screen reader users are far less likely to find controls they cannot focus.
Whichever you use, say why the button is unavailable, next to it. For forms, Vercel’s guidelines go further: keep the submit button enabled until the request starts, and let an incomplete form be submitted so the validation errors appear.
Loading State
Loading covers the time between the click and the result. Vercel’s guidelines ask for a spinner that keeps the original label, a short delay before the spinner appears (about 150 to 300ms), and a minimum visible time (about 300 to 500ms), so a fast response does not flicker.
Disable the button once the request starts so a second click cannot send it twice. When the request finishes, announce the result in a live region with aria-live="polite", as Vercel’s checks require for async updates, because a screen reader user cannot see the spinner stop.
Selected (Toggle) State
A toggle button, such as Bold in an editor or Mute in a player, has an on state. Mark it with aria-pressed="true" and keep the label the same in both states. Per the WAI-ARIA button pattern, a screen reader then announces something like “Mute toggle button pressed”. If the label changes from Mute to Unmute instead, leave aria-pressed off.
Show the on state with more than a color change, such as a filled background with a check icon, to meet WCAG 1.4.1. Styling from the aria-pressed attribute keeps the look and what assistive technology hears in step.
CSS for Every Button State
A starting point, in this order so :active comes after :hover. The custom properties stand in for your own design tokens.
| State | CSS |
|---|---|
| Default | .btn { background: var(--btn-bg); color: var(--btn-text); } |
| Hover | @media (hover: hover) { .btn:hover { background: var(--btn-hover); } } |
| Focus | .btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; } |
| Pressed | .btn:active { background: var(--btn-pressed); transform: scale(0.96); } |
| Disabled | .btn:disabled, .btn[aria-disabled="true"] { background: var(--btn-disabled); color: var(--btn-disabled-text); } |
| Loading | .btn.is-loading .btn-spinner { display: inline-block; } |
| Selected | .btn[aria-pressed="true"] { background: var(--btn-selected); } |
How Button States Combine
States stack. A selected toggle can be hovered, and a focused button can be pressed. Material Design lets hover combine with focused, selected, or pressed states, and applies only one state layer at a time. Design the combinations people will actually reach: focused and pressed, selected and hovered, and loading right after a press.
Button States Checklist
- Markup: Every button is a
<button>, or carriesrole="button",tabindex="0", and Enter and Space handlers. - Default: The label says what happens, meets 4.5:1, and the target is at least 24 by 24 CSS pixels (44 on touch screens).
- Hover: Styles sit inside
@media (hover: hover)and keep the label at 4.5:1. - Focus: A
:focus-visiblering at 3:1 against its background, never hidden under a sticky bar. - Pressed:
:activecomes after:hover, and feedback appears within about 0.1 second. - Disabled: The reason is shown next to the button, and it stays focusable wherever people need to find it.
- Loading: The label stays, repeat clicks are blocked, and the result is announced.
- Selected: Toggles use
aria-pressedwith a fixed label and a cue that is not color alone. - Design file: Every state is drawn, including the combinations people reach.
How to Find Missing Button States
The default state looks finished on its own, which is how the others go missing. Two quick checks: press Tab through the page and watch for focus, and in Chrome DevTools select a button, click :hov in the Styles tab, and force :hover, :active, or :focus-visible to see each style without a mouse.
OverlayQA’s Auto Review runs the same check on any page. It flags interactive elements with no CSS :hover rule, elements with no :focus or :focus-visible rule and no default outline, buttons with no :active rule, and pages whose buttons and form controls have no :disabled style. Each finding can become an issue with the element and its captured styles attached.
Frequently Asked Questions
What are button states?
Button states are the versions of a button that show what it can do and what it is doing: default, hover, focus, pressed, disabled, loading, and, for toggles, selected. Each one has its own style and, for focus, disabled, and selected, its own accessibility rules.
How many states does a button have?
Six for most buttons: default, hover, focus, pressed, disabled, and loading. Toggle buttons add selected. Material Design lists six interaction states (enabled, disabled, hover, focused, pressed, and dragged), where dragged applies to things you move rather than to most buttons.
What is the difference between focus and active states?
Focus means the button will receive keyboard input, and it lasts until focus moves elsewhere. Active, the pressed state, lasts only while the button is being pressed. A button can be focused and active at the same time.
Should disabled buttons be focusable?
When people need to discover the button, yes: use aria-disabled="true" so it stays in the tab order, and block the action in code. The WAI-ARIA Authoring Practices note that screen reader users are far less likely to find disabled controls they cannot focus.
Do disabled buttons need to meet color contrast requirements?
No. WCAG 2.2 exempts inactive components from success criteria 1.4.3 and 1.4.11. Keep the label readable anyway, and say why the button is unavailable.
Which CSS pseudo-class is the pressed state?
The :active pseudo-class. Write it after your :hover rule, because a later :hover rule with the same specificity overrides it.
How do you show a loading state on a button?
Keep the original label, add a spinner after a short delay, disable the button once the request starts so it cannot be sent twice, and announce the result in a live region when it finishes.
Detect missing hover, focus, pressed, and disabled styles with AI analysis, CSS extraction, and accessibility auditing. Export each issue to Jira, Linear, and more.