Design a CSS button with hover, pressed, focus and disabled states, each checked against WCAG contrast, and copy the CSS and HTML.
Initializing in your browser…
Design linear, radial and conic CSS gradients with live preview, vivid colour-space blending, and CSS or Tailwind code to copy.
Design layered CSS box shadows with live preview on light or dark, twelve presets, inset shadows, and a box-shadow line to copy.
Create CSS keyframe animations visually: presets, easing curves and steps, a live preview, reduced-motion support and clean CSS to copy.
You need a primary call-to-action button for a white page and want to be sure it is readable in every state, not just the one on your screen.
Button settings (the Primary preset)
Label "Get started", 16px, weight 600, white text Background #2563eb, hover #1d4ed8, pressed #1e40af Corner radius 8px, padding 12px 24px, page #ffffff
What the contrast table shows
Resting 5.17:1 passes Hover 6.70:1 passes Active 8.72:1 passes Focused 5.17:1 passes Disabled 1.49:1 exempt Focus ring against the page 17.74:1 passes Focus ring against the button 3.43:1 passes Button edge against the page 5.17:1 passes
At 16px and weight 600 the label counts as normal text, so each state needs 4.5:1; large text, which would only need 3:1, starts at 24px or about 18.7px in bold. The blue is #2563eb rather than the lighter and more familiar #3b82f6, because white text on #3b82f6 measures only 3.68:1 and would fail. The hover and pressed colours are darker still, so contrast rises as the user interacts. The near-black focus ring (#111827) clears 3:1 against both the white page and the blue button it surrounds, and the disabled state is exempt from the rule but still shown.
Design a CSS button with hover, pressed, focus and disabled states, see every state side by side, and copy ready-to-use CSS and HTML. Each state is checked against the WCAG 2.2 contrast rules on the page colour you choose, so you know the button is readable before it ships.
Design it. Start from one of twelve presets (Primary, Secondary, Success, Danger, Warning, Outline, Ghost, Pill, Gradient, 3D, Neon and Minimal) or from scratch. The settings are grouped into Text (size, weight, colour, letter spacing, case), Fill (a solid colour or a gradient, plus padding), Border (width, style, colour, corner radius or a full pill), Shadow, and States (hover and pressed colours, a slight hover scale, the focus ring, disabled opacity and the transition speed). The top preview is a real button with the generated CSS applied: hover it, press it and Tab to it.
Every state at once. Most people only ever look at the resting state, but hover, pressed, focused and disabled are what users see the moment they interact. The row under the live button draws all five next to each other from the same CSS, each with its contrast ratio, so a hover colour that washes the label out is visible immediately.
Contrast that matches the rules. WCAG 2.2 asks for 4.5:1 between a label and its background for normal text, and 3:1 for large text, which means 24 pixels, or about 18.7 pixels in bold. The tool applies the right threshold for your font size and weight. A gradient fill is measured at its worst point, a see-through fill is first blended with the page colour, and a disabled button is measured at its actual opacity (disabled controls are exempt, but the figure is shown). Two non-text checks follow WCAG 2.2 too: the focus ring needs 3:1 against both the page and the button it surrounds, and the edge of the button needs 3:1 against the page so people can see where the control is.
The page colour matters. A transparent or outline button has no background of its own, so its contrast depends entirely on what it sits on. Choose White, Light grey, Dark or any colour, and every figure is recalculated: the Ghost preset passes on white and fails badly on a dark page. Every preset passes WCAG AA in every state on the page colour it was designed for.
Code you can paste. The CSS uses :focus-visible, so the focus ring appears for keyboard users but not on a mouse click, and it turns off movement for people who ask their system to reduce motion. The HTML includes type="button", which stops the button from submitting a form by accident. Your design is kept in the page address, so a bookmark or the Share button brings it back. Everything runs in your browser.
The Primary preset (#2563eb, white 16px semibold label) measures 5.17:1 at rest, 6.70:1 on hover and 8.72:1 pressed, all above the 4.5:1 required.
Switch the page to Dark with the Ghost preset and its contrast drops to 2.83:1 and turns red, because its blue label was chosen for a light page.
A grey ring can pass against a white page and still vanish against the blue button it surrounds. The table checks both, so the ring is visible wherever it lands.
WCAG 2.2 level AA asks for 4.5:1 between the label and its background for normal text, or 3:1 for large text (24px, or about 18.7px bold). The focus indicator and the button's boundary need 3:1 against what is next to them.
If the button is transparent or only an outline, the label sits directly on the page, so the page colour decides the contrast. Choose your real page colour in the tool to get the true figure.
No. WCAG exempts inactive controls. The tool still shows the figure so you can judge whether the disabled state is at least recognisable.
A CSS selector that shows the focus ring when someone navigates with the keyboard, but not after a mouse click. Keyboard users get a clear indicator and mouse users do not see a ring they did not ask for.
A button inside a form submits the form by default. type="button" makes it an ordinary button, which is what you want unless it really is the submit button.
The label is checked against every point along the gradient and the worst result is reported, because that is the part of the button where the text is hardest to read.
This runs as client-side JavaScript. Keys, tokens, payloads, and other inputs never leave your device.