A button is the interface's smallest promise
It must read as clickable and signal what happens next, which needs three things: contrast, a clear boundary and stable dimensions. Button text carries the label; two background colours with the gradient toggle build the fill; text colour sets the label; border colour outlines; bold controls weight. Output is ready-to-use CSS, copyable or downloadable.
Steps
- Enter two to six characters of label, ideally starting with a verb.
- Choose both background colours; enable the gradient to blend them, or use only the first.
- Set text colour at 4.5:1 or better against the fill.
- Set border colour when an outline is wanted.
- Tick bold, copy the code, or load the example.
Contrast and states
Primary buttons put white on brand colour, usually around 4:1 — passable but worth verifying. Secondary buttons use transparent fills with borders at 3:1. Disabled states drop opacity to roughly fifty percent while keeping the label legible. Hover and pressed states need perceptible change, ten percent darker or an added shadow. Focus needs a visible ring, since keyboard users depend on it and colour shift alone is insufficient.
Gradient pitfalls
Keep gradient direction consistent with the site's light source. Close endpoints matter: saturated two-colour ramps break text contrast mid-transition, where the brightest or darkest area swallows the label. A border interrupts the gradient's continuity, so usually drop it or use a darker shade of the fill. Do not rotate the angle on press, which reads as a jump. Dark mode needs lower lightness overall or buttons glow.
Size and hit area
Heights cluster at 32, 40 and 48 pixels for compact, default and touch-friendly. Touch targets need at least 44 pixels square, so a small visual may need an expanded hit area. Horizontal padding runs 0.8 to 1.2 times the text height. Corner radius should match other controls — no pill buttons beside square inputs. Icon-only buttons need accessible labels, or screen readers announce nothing meaningful.
Common problems:Colour-only state changes fail for colour-blind users; add underline or icon. Long labels inside buttons go unread. Two primaries side by side leave the choice unclear. Pale gradients with white text erase the middle. And radius beyond half the height distorts into nonsense.