How to design a button
- Choose a preset (Primary, Pill, Outline, Soft, Brutalist or Dark) or start from scratch.
- Set the colors, font size, weight, padding, radius, border and shadow.
- Use Hover: darken to make the hover color darker (positive values) or lighter (negative values), and switch on Lift on hover for a small upward move.
- Hover and click the preview, then copy the CSS and the HTML.
What the generated CSS includes
- An
inline-flexbase, so an icon and the label line up and stay centered. :hoverand:activestates with a short transition.- A visible
:focus-visibleoutline for keyboard users. Never remove focus styles without a replacement.
Button design best practices
- Make touch targets at least 44 by 44 pixels: about 12px vertical padding with a 16px font.
- Text must contrast with the background at 4.5:1 or more; check your colors with the contrast checker.
- Use one solid primary button per view, and outline or soft styles for secondary actions.
- Use a
<button>for actions and an<a>for navigation, even if they look the same. - Keep labels short and specific: “Create account” is clearer than “Submit”.
Fine-tune shadows with the box shadow generator, or browse ready-made button styles for Bootstrap, Tailwind CSS and pure CSS.