51 CSS Buttons
07 / 51

All 51 in 51 CSS Buttons

  1. 01CSS Submit Button (Form Primary)
  2. 02CSS Primary and Secondary Button Pair
  3. 03CSS Ghost / Outline Button
  4. 04CSS Icon-Only Button with Accessible Tooltip
  5. 05CSS Gradient CTA Button
  6. 06CSS Loading Spinner Button (State Transition)
  7. 07CSS Disabled Button State (Full State Reference)
  8. 08CSS Button Group Component (Segmented Radio-Like)
  9. 09CSS Add to Cart Button
  10. 10CSS Download Progress Button
  11. 11CSS Like Heart Button
  12. 12CSS Confirm Delete Button
  13. 13CSS Play Pause Button
  14. 14CSS Subscribe Confetti Button
  15. 15CSS Magnetic Mercury Ripple Button
  16. 16CSS Brutalist Glitch Button
  17. 17CSS Neon Plasma Burst Button
  18. 18CSS Clay Press Button
  19. 19CSS Editorial Ink Spread Button
  20. 20CSS Particle Shard Burst Button
  21. 21CSS Brushed Brass Plate Button
  22. 22CSS Washi Paper Crane Button
  23. 23CSS Frosted Ice Cube Button
  24. 24CSS Vintage Typewriter Key Button
  25. 25CSS Lacquered Walnut Wood Button
  26. 26CSS Pharma Gel Capsule Button
  27. 27CSS Aged Copper Coin Button
  28. 28CSS Origami Fortune Cookie Button
  29. 29CSS Holographic Foil Sticker Button
  30. 30CSS Brutalist Concrete Slab Button
  31. 31CSS Mercury Bead Morph Button
  32. 32CSS Soft Pill Modern SaaS Button
  33. 33CSS Masking Tape Label Button
  34. 34CSS Obsidian Glass Shard Button
  35. 35CSS Wine Velvet Ribbon Button
  36. 36CSS LED Segment Display Button
  37. 37CSS Cassette Mixtape Label Button
  38. 38CSS Chalkboard Menu Button
  39. 39CSS Vinyl Record Sleeve Ripple Button
  40. 40CSS Polaroid Snapshot Button
  41. 41CSS Airline Boarding Pass Button
  42. 42CSS Aged Brass Subway Token Button
  43. 43CSS Vintage Rx Pharmacy Label Button
  44. 44CSS Bakelite Radio Dial Toggle Button
  45. 45CSS Regal Postage Stamp Button
  46. 46CSS Victorian Cigar Band Foil Button
  47. 47CSS Vintage Calculator Key Button
  48. 48CSS Toolbox Latch Spotlight Button
  49. 49CSS Receipt Paper Total Count-Up Button
  50. 50CSS IBM Punch Card Magnetic Follow Button
  51. 51CSS Brass Periscope Lens Button
Pure CSSMIT licensed

CSS Disabled Button State (Full State Reference)

Every button state side by side in one row — rest, hover, focus, pressed, truly disabled, and aria-disabled (focusable, explains itself, refuses activation). The hover/focus/pressed cards are frozen with state classes so you can compare all six simultaneously instead of chasing a pointer.

Live Demo
Plain CSSTailwind v4
Try it

Build UI like this from scratch: Flexbox, Grid, animations & responsive CSS

ZTM · The CSS Bootcamp · 30‑day money-back guarantee · Affiliate link

10% off at checkout with code
Check ZTM Course

The code

<div class="cb-07">
  <div class="cb-07__stage">
    <div class="cb-07__row">
      <button class="cb-07__btn" type="button">Rest</button>
      <button class="cb-07__btn is-hover" type="button">Hover</button>
      <button class="cb-07__btn is-focus" type="button">Focus</button>
      <button class="cb-07__btn is-active" type="button">Pressed</button>
      <button class="cb-07__btn" type="button" disabled>Disabled</button>
      <button class="cb-07__btn" type="button" aria-disabled="true" aria-describedby="cb-07-why">Unavailable</button>
      <span class="cb-07__sr" id="cb-07-why">Complete the form above to enable this action</span>
    </div>
  </div>
</div>
@import url('https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:wght@400;500;600;700&display=swap');

.cb-07 {
  --bg: #f5f5f3;
  --accent: #0f766e;
  --ink: #ffffff;
  --muted: #6b7280;
  --fill: var(--accent);
  --fill-h: #0d6a62;
  --fill-a: #0b5a53;
  --fill-d: #dcdcd8;
  --radius: .7rem;
  --sans: "Schibsted Grotesk",ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: block;
  background: var(--bg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

@supports (color: oklch(50% 0 0)) {
  .cb-07 {
    --bg: oklch(96.8% .004 110);
    --accent: oklch(48% .1 180);
    --fill-h: oklch(44% .1 180);
    --fill-a: oklch(39% .09 180);
    --fill-d: oklch(89% .006 110);
    --muted: oklch(48% .01 260);
  }
}

@media (prefers-color-scheme: dark) {
  .cb-07:not([data-theme="light"]) {
    --bg: #0b0d0d;
    --accent: #14b8a6;
    --ink: #04201d;
    --fill-h: #0fa295;
    --fill-a: #0c8b80;
    --fill-d: #23282a;
    --muted: #9aa3a8;
  }
}

.cb-07[data-theme="dark"] {
  --bg: #0b0d0d;
  --accent: #14b8a6;
  --ink: #04201d;
  --fill-h: #0fa295;
  --fill-a: #0c8b80;
  --fill-d: #23282a;
  --muted: #9aa3a8;
}

.cb-07,
.cb-07 *,
.cb-07 *::before,
.cb-07 *::after {
  box-sizing: border-box;
}

.cb-07__stage {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem,6vw,4rem);
}

.cb-07__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.cb-07__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
  max-width: 44rem;
}

.cb-07__btn {
  cursor: pointer;
  display: grid;
  place-items: center;
  min-height: 3rem;
  min-width: 7.5rem;
  padding: 0 1.35rem;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--fill);
  box-shadow: 0 8px 18px -12px color-mix(in oklab,var(--accent) 85%,transparent);
  transition: background-color .18s ease, translate .18s cubic-bezier(.16,1,.3,1), scale .18s ease;
}

.cb-07__btn:hover,
.cb-07__btn.is-hover {
  --fill: var(--fill-h);
  translate: 0 -1px;
}

.cb-07__btn:focus-visible,
.cb-07__btn.is-focus {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.cb-07__btn:active,
.cb-07__btn.is-active {
  --fill: var(--fill-a);
  translate: 0 1px;
  scale: .985;
  box-shadow: none;
}

.cb-07__btn:disabled,
.cb-07__btn[aria-disabled="true"] {
  --fill: var(--fill-d);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
  translate: 0;
  scale: 1;
}

.cb-07__btn[aria-disabled="true"] {
  cursor: not-allowed;
}

.cb-07__btn[aria-disabled="true"]:active {
  animation: cb-07-nope .32s cubic-bezier(.36,.07,.19,.97);
}

@keyframes cb-07-nope {
  0%,
    100% {
    translate: 0 0;
  }

  25% {
    translate: -3px 0;
  }

  75% {
    translate: 3px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cb-07__btn {
    transition: none;
  }

  .cb-07__btn[aria-disabled="true"]:active {
    animation: none;
    outline: 2px dashed var(--muted);
    outline-offset: 2px;
  }
}

@media (forced-colors: active) {
  .cb-07__btn {
    background: ButtonFace;
    color: ButtonText;
    border: 1px solid ButtonText;
    box-shadow: none;
  }

  .cb-07__btn:disabled,
    .cb-07__btn[aria-disabled="true"] {
    color: GrayText;
    border-color: GrayText;
  }
}
Paste this into ChatGPT, Claude, Cursor, or any coding assistant. The block below is pre-framed with everything the AI needs to integrate this demo into your project — markup, styles, scoping notes, and the source URL. Hit Copy and paste straight into your chat.
Here's a working CSS Button from CodeFronts. Use it as-is or adapt to your framework. All classes are scoped under a unique prefix so the code won't collide with your existing styles. MIT licensed.
Demo: CSS Disabled Button State (Full State Reference)
Source: https://codefronts.com/components/css-buttons/css-disabled-button-state-full-state-reference/

Every button state side by side in one row — rest, hover, focus, pressed, truly disabled, and aria-disabled (focusable, explains itself, refuses activation). The hover/focus/pressed cards are frozen with state classes so you can compare all six simultaneously instead of chasing a pointer.
## HTML
```html
<div class="cb-07">
  <div class="cb-07__stage">
    <div class="cb-07__row">
      <button class="cb-07__btn" type="button">Rest</button>
      <button class="cb-07__btn is-hover" type="button">Hover</button>
      <button class="cb-07__btn is-focus" type="button">Focus</button>
      <button class="cb-07__btn is-active" type="button">Pressed</button>
      <button class="cb-07__btn" type="button" disabled>Disabled</button>
      <button class="cb-07__btn" type="button" aria-disabled="true" aria-describedby="cb-07-why">Unavailable</button>
      <span class="cb-07__sr" id="cb-07-why">Complete the form above to enable this action</span>
    </div>
  </div>
</div>
```
## CSS
```css
@import url('https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:wght@400;500;600;700&display=swap');

.cb-07 {
  --bg: #f5f5f3;
  --accent: #0f766e;
  --ink: #ffffff;
  --muted: #6b7280;
  --fill: var(--accent);
  --fill-h: #0d6a62;
  --fill-a: #0b5a53;
  --fill-d: #dcdcd8;
  --radius: .7rem;
  --sans: "Schibsted Grotesk",ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: block;
  background: var(--bg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

@supports (color: oklch(50% 0 0)) {
  .cb-07 {
    --bg: oklch(96.8% .004 110);
    --accent: oklch(48% .1 180);
    --fill-h: oklch(44% .1 180);
    --fill-a: oklch(39% .09 180);
    --fill-d: oklch(89% .006 110);
    --muted: oklch(48% .01 260);
  }
}

@media (prefers-color-scheme: dark) {
  .cb-07:not([data-theme="light"]) {
    --bg: #0b0d0d;
    --accent: #14b8a6;
    --ink: #04201d;
    --fill-h: #0fa295;
    --fill-a: #0c8b80;
    --fill-d: #23282a;
    --muted: #9aa3a8;
  }
}

.cb-07[data-theme="dark"] {
  --bg: #0b0d0d;
  --accent: #14b8a6;
  --ink: #04201d;
  --fill-h: #0fa295;
  --fill-a: #0c8b80;
  --fill-d: #23282a;
  --muted: #9aa3a8;
}

.cb-07,
.cb-07 *,
.cb-07 *::before,
.cb-07 *::after {
  box-sizing: border-box;
}

.cb-07__stage {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem,6vw,4rem);
}

.cb-07__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.cb-07__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
  max-width: 44rem;
}

.cb-07__btn {
  cursor: pointer;
  display: grid;
  place-items: center;
  min-height: 3rem;
  min-width: 7.5rem;
  padding: 0 1.35rem;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--fill);
  box-shadow: 0 8px 18px -12px color-mix(in oklab,var(--accent) 85%,transparent);
  transition: background-color .18s ease, translate .18s cubic-bezier(.16,1,.3,1), scale .18s ease;
}

.cb-07__btn:hover,
.cb-07__btn.is-hover {
  --fill: var(--fill-h);
  translate: 0 -1px;
}

.cb-07__btn:focus-visible,
.cb-07__btn.is-focus {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.cb-07__btn:active,
.cb-07__btn.is-active {
  --fill: var(--fill-a);
  translate: 0 1px;
  scale: .985;
  box-shadow: none;
}

.cb-07__btn:disabled,
.cb-07__btn[aria-disabled="true"] {
  --fill: var(--fill-d);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
  translate: 0;
  scale: 1;
}

.cb-07__btn[aria-disabled="true"] {
  cursor: not-allowed;
}

.cb-07__btn[aria-disabled="true"]:active {
  animation: cb-07-nope .32s cubic-bezier(.36,.07,.19,.97);
}

@keyframes cb-07-nope {
  0%,
    100% {
    translate: 0 0;
  }

  25% {
    translate: -3px 0;
  }

  75% {
    translate: 3px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cb-07__btn {
    transition: none;
  }

  .cb-07__btn[aria-disabled="true"]:active {
    animation: none;
    outline: 2px dashed var(--muted);
    outline-offset: 2px;
  }
}

@media (forced-colors: active) {
  .cb-07__btn {
    background: ButtonFace;
    color: ButtonText;
    border: 1px solid ButtonText;
    box-shadow: none;
  }

  .cb-07__btn:disabled,
    .cb-07__btn[aria-disabled="true"] {
    color: GrayText;
    border-color: GrayText;
  }
}
```

How this works

The base button reads its look from state tokens, and each real pseudo-class is paired with a forced class so a static screenshot can show it:

.cb-07__btn:hover,.cb-07__btn.is-hover{ --fill:var(--fill-h); translate:0 -1px; }
.cb-07__btn:focus-visible,.cb-07__btn.is-focus{ outline:2px solid var(--accent); outline-offset:3px; }
.cb-07__btn:active,.cb-07__btn.is-active{ --fill:var(--fill-a); translate:0 1px; scale:.985; }

The two "off" states are deliberately different. disabled removes the button from the tab order and from the accessibility tree's interactive set — correct for a control that is irrelevant right now. aria-disabled="true" keeps it focusable and announceable, which is correct for "you can't do this yet" — and CSS can style it identically:

.cb-07__btn:disabled,
.cb-07__btn[aria-disabled='true']{
  --fill:var(--fill-d); color:var(--muted);
  cursor:not-allowed; box-shadow:none;
}
.cb-07__btn[aria-disabled='true']:active{ animation:cb-07-nope .3s; }

The aria-disabled card shakes on click to acknowledge the press without acting on it, and both variants keep the label above 4.5:1 contrast — greying text into illegibility is the classic disabled-state mistake.

Make it yours

  • Tune the disabled look with the three --fill-* tokens; avoid opacity on the whole button since it also fades focus rings and icons.
  • For aria-disabled buttons in real code, block the action in JS (if (btn.getAttribute('aria-disabled') === 'true') return;) — ARIA changes semantics, not behaviour.
  • Add a loading state by copying the disabled rule and pairing it with aria-busy instead.
  • Drop the .is-* demo classes in production — they exist only to display frozen states.
  • If your brand disabled colour fails contrast, keep the fill and darken only the label; WCAG has no exemption for disabled text, and users still need to read it.

Gotchas — read before shipping

  • disabled buttons never fire pointer or focus events, so a tooltip explaining why can't appear on them. That is the main reason to prefer aria-disabled on form submits.
  • opacity:.5 is not a disabled style, it is a contrast bug. Compute the real disabled colours.
  • cursor:not-allowed is a hint, not a state; without a visual fill change colour-blind and zoomed users get nothing.
  • Never disable a submit button to prevent double submission without also handling the keyboard "Enter" path — the form can still submit.
  • In forced-colors mode GrayText is the only reliable disabled colour; browser-defined system colours override your tokens by design.

Browser support

ChromeSafariFirefoxEdge
111+16.2+113+111+

Floor set by oklch(), color-mix() as this demo is written. The core technique itself goes back further — Chrome 88+.

Everything here is baseline CSS: :disabled, [aria-disabled], :focus-visible (Chrome 86 / Safari 15.4 / Firefox 85) and system colours in forced-colors mode.

Techniques used in this demo

Search CodeFronts

Loading…