51 Tailwind CSS Buttons
47 / 51

All 51 in 51 Tailwind CSS Buttons

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

Tailwind Vintage Calculator Key Button

A 1974 desk calculator key: warm beige ABS with a dished top, a chamfered skirt, tight 3px travel, and the orange function key beside it. The dish is two counter-facing radial gradients, and the press collapses a hard shadow stack so it lands with a stop.

Live Demo
Plain CSSTailwind v4
Try it

Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time

Untitled UI React · Affiliate link

Get Untitled UI Pro

The code

<div class="tb-47 w-full min-h-svh grid place-items-center font-tb47-sans p-[clamp(1.5rem,6vw,4rem)]">
  <div class="tb-47__pad flex gap-3 p-3.5 rounded-lg shadow-[inset_0_1px_0_#ffffff29,inset_0_-2px_5px_#00000073,0_16px_26px_-14px_#000000b3]">
    <button type="button" class="tb-47__key cursor-pointer grid place-items-center min-w-22 min-h-14 px-5 border-0 rounded-t-[0.3rem] rounded-b-[0.45rem] text-[0.9375rem] font-medium tracking-[0.12em] uppercase text-tb47-ink [text-shadow:0_1px_0_#ffffff8c] shadow-[inset_0_1px_0_#ffffff80,inset_0_-1px_0_#0000001f,0_1px_0_var(--color-tb47-skirt),0_2px_0_var(--color-tb47-skirt-lo),0_3px_0_var(--color-tb47-skirt-lo),0_7px_11px_-5px_#00000073] transition-[translate,box-shadow,filter] duration-[80ms] ease-linear [-webkit-tap-highlight-color:transparent] hover:brightness-105 active:translate-y-[3px] active:shadow-[inset_0_1px_3px_#00000047,0_1px_0_var(--color-tb47-skirt-lo),0_2px_4px_-2px_#00000073] focus-visible:outline-2 focus-visible:outline-offset-[3px] focus-visible:outline-tb47-accent disabled:cursor-not-allowed disabled:grayscale-50 disabled:brightness-95 motion-reduce:transition-none">Total</button>
    <button type="button" class="tb-47__key tb-47__key--accent cursor-pointer grid place-items-center min-w-14 min-h-14 px-5 border-0 rounded-t-[0.3rem] rounded-b-[0.45rem] text-[0.9375rem] font-medium tracking-[0.12em] uppercase text-tb47-accent-ink [text-shadow:0_1px_0_#00000059] shadow-[inset_0_1px_0_#ffffff59,inset_0_-1px_0_#00000040,0_1px_0_#a4400f,0_2px_0_#8d370c,0_3px_0_#8d370c,0_7px_11px_-5px_#00000080] transition-[translate,box-shadow,filter] duration-[80ms] ease-linear [-webkit-tap-highlight-color:transparent] hover:brightness-105 active:translate-y-[3px] active:shadow-[inset_0_1px_3px_#00000066,0_1px_0_#8d370c,0_2px_4px_-2px_#00000080] focus-visible:outline-2 focus-visible:outline-offset-[3px] focus-visible:outline-tb47-accent disabled:cursor-not-allowed disabled:grayscale-50 motion-reduce:transition-none">C</button>
  </div>
</div>
@import "tailwindcss";

@theme {
  --color-tb47-bg: #3d3a33;
  --color-tb47-bg: oklch(0.36 0.012 85);
  --color-tb47-panel: #57534a;
  --color-tb47-panel: oklch(0.46 0.015 85);
  --color-tb47-cap: #e0d8c6;
  --color-tb47-cap: oklch(0.89 0.022 88);
  --color-tb47-cap-lo: #cdc4ae;
  --color-tb47-cap-lo: oklch(0.83 0.026 86);
  --color-tb47-skirt: #b3a992;
  --color-tb47-skirt: oklch(0.73 0.03 88);
  --color-tb47-skirt-lo: #8d8471;
  --color-tb47-skirt-lo: oklch(0.6 0.028 88);
  --color-tb47-ink: #3a352b;
  --color-tb47-ink: oklch(0.32 0.02 85);
  --color-tb47-accent: #c2551f;
  --color-tb47-accent: oklch(0.56 0.17 43);
  --color-tb47-accent-lo: #a4400f;
  --color-tb47-accent-lo: oklch(0.47 0.16 43);
  --color-tb47-accent-ink: #fff3e6;
  --font-tb47-sans: "Oswald", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.tb-47 {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  background: radial-gradient(30rem 20rem at 50% 42%, rgba(255,255,255,.06), transparent 72%), var(--color-tb47-bg);
}

.tb-47__pad {
  background: linear-gradient(180deg, color-mix(in oklab, var(--color-tb47-panel) 88%, white 6%), var(--color-tb47-panel));
}
/* THE DISH: dark at the top edge, light at the bottom, so the surface scoops
   toward the user. On dark themes these two stops must INVERT, not darken —
   which is why the recipe lives here rather than in a class list. */

.tb-47__key {
  background: radial-gradient(120% 100% at 50% -18%, rgba(0,0,0,.15), transparent 58%), radial-gradient(120% 90% at 50% 118%, rgba(255,255,255,.6), transparent 56%), linear-gradient(180deg, var(--color-tb47-cap-lo), var(--color-tb47-cap));
}

.tb-47__key--accent {
  background: radial-gradient(120% 100% at 50% -18%, rgba(0,0,0,.22), transparent 58%), radial-gradient(120% 90% at 50% 118%, rgba(255,255,255,.32), transparent 56%), linear-gradient(180deg, var(--color-tb47-accent-lo), var(--color-tb47-accent));
}

@media (prefers-color-scheme: dark) {
  .tb-47:not([data-theme="light"]) {
    --color-tb47-bg: oklch(0.24 0.01 85);
    --color-tb47-panel: oklch(0.32 0.012 85);
  }
}

.tb-47[data-theme="dark"] {
  --color-tb47-bg: oklch(0.24 0.01 85);
  --color-tb47-panel: oklch(0.32 0.012 85);
}

@media (forced-colors: active) {
  .tb-47__pad {
    background: Canvas;
    box-shadow: none;
    border: 1px solid CanvasText;
  }

  .tb-47__key {
    background: ButtonFace;
    color: ButtonText;
    border: 1px solid ButtonText;
    box-shadow: none;
    text-shadow: none;
  }
}

Setup — do this once per project

Skip this if your project already runs Tailwind v4.

1Load Tailwind
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>

Compiles in the browser — perfect for a CodePen or a quick test, not for production.

2Add the stylesheetRequiredthe @theme block is what makes the custom utilities exist
@import "tailwindcss";

@theme {
  --color-tb47-bg: #3d3a33;
  --color-tb47-bg: oklch(0.36 0.012 85);
  --color-tb47-panel: #57534a;
  --color-tb47-panel: oklch(0.46 0.015 85);
  --color-tb47-cap: #e0d8c6;
  --color-tb47-cap: oklch(0.89 0.022 88);
  --color-tb47-cap-lo: #cdc4ae;
  --color-tb47-cap-lo: oklch(0.83 0.026 86);
  --color-tb47-skirt: #b3a992;
  --color-tb47-skirt: oklch(0.73 0.03 88);
  --color-tb47-skirt-lo: #8d8471;
  --color-tb47-skirt-lo: oklch(0.6 0.028 88);
  --color-tb47-ink: #3a352b;
  --color-tb47-ink: oklch(0.32 0.02 85);
  --color-tb47-accent: #c2551f;
  --color-tb47-accent: oklch(0.56 0.17 43);
  --color-tb47-accent-lo: #a4400f;
  --color-tb47-accent-lo: oklch(0.47 0.16 43);
  --color-tb47-accent-ink: #fff3e6;
  --font-tb47-sans: "Oswald", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.tb-47 {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  background: radial-gradient(30rem 20rem at 50% 42%, rgba(255,255,255,.06), transparent 72%), var(--color-tb47-bg);
}

.tb-47__pad {
  background: linear-gradient(180deg, color-mix(in oklab, var(--color-tb47-panel) 88%, white 6%), var(--color-tb47-panel));
}
/* THE DISH: dark at the top edge, light at the bottom, so the surface scoops
   toward the user. On dark themes these two stops must INVERT, not darken —
   which is why the recipe lives here rather than in a class list. */

.tb-47__key {
  background: radial-gradient(120% 100% at 50% -18%, rgba(0,0,0,.15), transparent 58%), radial-gradient(120% 90% at 50% 118%, rgba(255,255,255,.6), transparent 56%), linear-gradient(180deg, var(--color-tb47-cap-lo), var(--color-tb47-cap));
}

.tb-47__key--accent {
  background: radial-gradient(120% 100% at 50% -18%, rgba(0,0,0,.22), transparent 58%), radial-gradient(120% 90% at 50% 118%, rgba(255,255,255,.32), transparent 56%), linear-gradient(180deg, var(--color-tb47-accent-lo), var(--color-tb47-accent));
}

@media (prefers-color-scheme: dark) {
  .tb-47:not([data-theme="light"]) {
    --color-tb47-bg: oklch(0.24 0.01 85);
    --color-tb47-panel: oklch(0.32 0.012 85);
  }
}

.tb-47[data-theme="dark"] {
  --color-tb47-bg: oklch(0.24 0.01 85);
  --color-tb47-panel: oklch(0.32 0.012 85);
}

@media (forced-colors: active) {
  .tb-47__pad {
    background: Canvas;
    box-shadow: none;
    border: 1px solid CanvasText;
  }

  .tb-47__key {
    background: ButtonFace;
    color: ButtonText;
    border: 1px solid ButtonText;
    box-shadow: none;
    text-shadow: none;
  }
}
3Fonts used by this demooptional — skip if you have your own type stack
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600&display=swap">

What changed in the port

Which parts became utilities, which stayed CSS, and why.

  • Utilities: both keys in full — the six-segment rest shadow, the collapsed press shadow, the 3px travel, the printed legend, the focus ring, the disabled state. CSS: the two dish recipes and the panel.
  • The accent key differs from the base key by four classes (ink colour, text-shadow, and two shadow stacks) plus one background rule. That ratio — a variant as a handful of overrides on a repeated base — is the same shape as the primary/secondary pair in demo 02, sixteen hundred lines earlier.
  • Third demo in the collection where travel and shadow depth must be the same number (after the concrete slab and the typewriter key), and the third time utilities put them on one line. It is the strongest recurring argument for this port.
  • A11y fix from the CSS original: the accent was oklch(0.62 0.17 43) with --accent-ink:#fff3e6 — about 3.2:1, well under the minimum for a 15px legend. The port darkens the accent key to 0.56 (≈4.6:1) and keeps the same orange family, so the 1974 palette survives a contrast check.
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 demo 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: Tailwind Vintage Calculator Key Button
Source: https://codefronts.com/components/tailwind-css-buttons/tailwind-vintage-calculator-key-button/

A 1974 desk calculator key: warm beige ABS with a dished top, a chamfered skirt, tight 3px travel, and the orange function key beside it. The dish is two counter-facing radial gradients, and the press collapses a hard shadow stack so it lands with a stop.
## HTML
```html
<div class="tb-47 w-full min-h-svh grid place-items-center font-tb47-sans p-[clamp(1.5rem,6vw,4rem)]">
  <div class="tb-47__pad flex gap-3 p-3.5 rounded-lg shadow-[inset_0_1px_0_#ffffff29,inset_0_-2px_5px_#00000073,0_16px_26px_-14px_#000000b3]">
    <button type="button" class="tb-47__key cursor-pointer grid place-items-center min-w-22 min-h-14 px-5 border-0 rounded-t-[0.3rem] rounded-b-[0.45rem] text-[0.9375rem] font-medium tracking-[0.12em] uppercase text-tb47-ink [text-shadow:0_1px_0_#ffffff8c] shadow-[inset_0_1px_0_#ffffff80,inset_0_-1px_0_#0000001f,0_1px_0_var(--color-tb47-skirt),0_2px_0_var(--color-tb47-skirt-lo),0_3px_0_var(--color-tb47-skirt-lo),0_7px_11px_-5px_#00000073] transition-[translate,box-shadow,filter] duration-[80ms] ease-linear [-webkit-tap-highlight-color:transparent] hover:brightness-105 active:translate-y-[3px] active:shadow-[inset_0_1px_3px_#00000047,0_1px_0_var(--color-tb47-skirt-lo),0_2px_4px_-2px_#00000073] focus-visible:outline-2 focus-visible:outline-offset-[3px] focus-visible:outline-tb47-accent disabled:cursor-not-allowed disabled:grayscale-50 disabled:brightness-95 motion-reduce:transition-none">Total</button>
    <button type="button" class="tb-47__key tb-47__key--accent cursor-pointer grid place-items-center min-w-14 min-h-14 px-5 border-0 rounded-t-[0.3rem] rounded-b-[0.45rem] text-[0.9375rem] font-medium tracking-[0.12em] uppercase text-tb47-accent-ink [text-shadow:0_1px_0_#00000059] shadow-[inset_0_1px_0_#ffffff59,inset_0_-1px_0_#00000040,0_1px_0_#a4400f,0_2px_0_#8d370c,0_3px_0_#8d370c,0_7px_11px_-5px_#00000080] transition-[translate,box-shadow,filter] duration-[80ms] ease-linear [-webkit-tap-highlight-color:transparent] hover:brightness-105 active:translate-y-[3px] active:shadow-[inset_0_1px_3px_#00000066,0_1px_0_#8d370c,0_2px_4px_-2px_#00000080] focus-visible:outline-2 focus-visible:outline-offset-[3px] focus-visible:outline-tb47-accent disabled:cursor-not-allowed disabled:grayscale-50 motion-reduce:transition-none">C</button>
  </div>
</div>
```
## CSS
```css
@import "tailwindcss";

@theme {
  --color-tb47-bg: #3d3a33;
  --color-tb47-bg: oklch(0.36 0.012 85);
  --color-tb47-panel: #57534a;
  --color-tb47-panel: oklch(0.46 0.015 85);
  --color-tb47-cap: #e0d8c6;
  --color-tb47-cap: oklch(0.89 0.022 88);
  --color-tb47-cap-lo: #cdc4ae;
  --color-tb47-cap-lo: oklch(0.83 0.026 86);
  --color-tb47-skirt: #b3a992;
  --color-tb47-skirt: oklch(0.73 0.03 88);
  --color-tb47-skirt-lo: #8d8471;
  --color-tb47-skirt-lo: oklch(0.6 0.028 88);
  --color-tb47-ink: #3a352b;
  --color-tb47-ink: oklch(0.32 0.02 85);
  --color-tb47-accent: #c2551f;
  --color-tb47-accent: oklch(0.56 0.17 43);
  --color-tb47-accent-lo: #a4400f;
  --color-tb47-accent-lo: oklch(0.47 0.16 43);
  --color-tb47-accent-ink: #fff3e6;
  --font-tb47-sans: "Oswald", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.tb-47 {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  background: radial-gradient(30rem 20rem at 50% 42%, rgba(255,255,255,.06), transparent 72%), var(--color-tb47-bg);
}

.tb-47__pad {
  background: linear-gradient(180deg, color-mix(in oklab, var(--color-tb47-panel) 88%, white 6%), var(--color-tb47-panel));
}
/* THE DISH: dark at the top edge, light at the bottom, so the surface scoops
   toward the user. On dark themes these two stops must INVERT, not darken —
   which is why the recipe lives here rather than in a class list. */

.tb-47__key {
  background: radial-gradient(120% 100% at 50% -18%, rgba(0,0,0,.15), transparent 58%), radial-gradient(120% 90% at 50% 118%, rgba(255,255,255,.6), transparent 56%), linear-gradient(180deg, var(--color-tb47-cap-lo), var(--color-tb47-cap));
}

.tb-47__key--accent {
  background: radial-gradient(120% 100% at 50% -18%, rgba(0,0,0,.22), transparent 58%), radial-gradient(120% 90% at 50% 118%, rgba(255,255,255,.32), transparent 56%), linear-gradient(180deg, var(--color-tb47-accent-lo), var(--color-tb47-accent));
}

@media (prefers-color-scheme: dark) {
  .tb-47:not([data-theme="light"]) {
    --color-tb47-bg: oklch(0.24 0.01 85);
    --color-tb47-panel: oklch(0.32 0.012 85);
  }
}

.tb-47[data-theme="dark"] {
  --color-tb47-bg: oklch(0.24 0.01 85);
  --color-tb47-panel: oklch(0.32 0.012 85);
}

@media (forced-colors: active) {
  .tb-47__pad {
    background: Canvas;
    box-shadow: none;
    border: 1px solid CanvasText;
  }

  .tb-47__key {
    background: ButtonFace;
    color: ButtonText;
    border: 1px solid ButtonText;
    box-shadow: none;
    text-shadow: none;
  }
}
```

How this works

A dished keycap is the inverse of a domed one. Dark at the top, light at the bottom — get it backwards and you have a 2010s app button:

radial-gradient(120% 100% at 50% -18%, rgba(0,0,0,.15), transparent 58%),
radial-gradient(120% 90%  at 50% 118%, rgba(255,255,255,.6), transparent 56%),
linear-gradient(180deg, var(--cap-lo), var(--cap))

It stays in CSS for the same reason as the typewriter key: the dish must invert rather than darken in dark mode, which is a rule about the recipe, not a value.

Travel and skirt must match. Three 1px segments, 3px of travel — the same arithmetic as the concrete slab and the typewriter key, and the third time the collection makes the point that utilities put the two numbers next to each other.

Make it yours

  • --color-tb47-cap/-skirt: warm beige, chocolate brown and safety orange are the period palette.
  • Travel and shadow depth move together — 2px is a laptop key, 4px a cash register.
  • col-span-2 on the accent key makes an equals bar.
  • A condensed grotesque legend reads more 1980s than 1970s.
  • The pad is a normal flex row — add a third key without touching either key's classes.

Gotchas — read before shipping

  • Two keys in a row need identical heights. Set min-h-* rather than relying on the line-box.
  • Dished gradients look wrong on dark themes. Invert the two radial stops; don't just darken the cap.
  • Hard shadow travel exposes subpixel rounding. Whole-pixel offsets.
  • Keys imply a keypad. If they don't type, keep the labels verbs.
  • Never remove the focus ring on a key-styled control — the press state is not a focus state.

Browser support

ChromeSafariFirefoxEdge
111+16.4+128+111+

Baseline gradients, stacked shadows and individual transform utilities throughout — all below Tailwind v4's own floor.

Techniques used in this demo

Search CodeFronts

Loading…