About this set
One primary button drawn in each of its seven states, side by side with a caption: rest, hover, focus visible, active, disabled, toggled and busy. It is a reference sheet for checking that a design system covers every state before it ships, and a starting point for your own button. Hover darkens the fill, focus visible adds a two-ring focus indicator, active darkens further and moves the button down one pixel, disabled turns grey, toggled turns near-black and busy shows a spinner beside the label. The first four cells use .is-hover, .is-focus and .is-active classes to force their state on screen, and the same rules also answer the real :hover, :focus-visible and :active pseudo-classes, so every button in the grid responds to the mouse and keyboard as well. The toggled state is read from aria-pressed and the busy state from aria-busy rather than from classes, so what is shown matches what assistive technology announces. The busy spinner is a CSS pseudo-element in plain CSS, a restyled .spinner-border in Bootstrap and a bordered span with animate-spin in Tailwind.
What’s included
- Seven states: rest, hover, focus visible, active, disabled, toggled, busy
- Toggled and busy states styled from aria-pressed and aria-busy
- Busy button keeps its width while the spinner shows
- Busy fill darkened to #5558e8 so white text reaches 4.5:1
- Press offset and transitions off under reduced motion
Accessibility
Every cell is a native button with visible text. The toggled button carries aria-pressed="true" and the busy button aria-busy="true", and the Bootstrap spinner is aria-hidden. Keyboard focus draws the same white and indigo double ring shown in the Focus visible cell. Under prefers-reduced-motion the transitions and the one-pixel press offset are removed and the spinner slows from 0.7 to 2.6 seconds per turn rather than stopping, so the busy state stays visible.
Customise it
Change the fills in the .st rules (#4f46e5 rest, #4338ca hover, #3730a3 active, #101828 toggled, #5558e8 busy). In Bootstrap they are --bs-btn-bg, --bs-btn-hover-bg and --bs-btn-active-bg on .st, with the spinner sized through --bs-spinner-width; in Tailwind edit the bg-, aria-pressed: and aria-busy: utilities.

















