51 Tailwind CSS Buttons
44 / 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 Bakelite Radio Dial Toggle Button

A bakelite rotary switch that turns 132° from OFF to ON, with a knurled grip, a chamfered pointer, engraved ticks around the bezel, and a warm indicator lamp that fades up as the contact closes. A checkbox with role="switch" holds the state.

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-44 w-full min-h-svh grid place-items-center font-tb44-sans p-[clamp(1.5rem,6vw,4rem)]">
  <label class="group relative block cursor-pointer [-webkit-tap-highlight-color:transparent]">
    <input type="checkbox" role="switch" aria-label="Power" class="sr-only">
    <span aria-hidden="true" class="tb-44__plate relative grid place-items-center size-38 rounded-full shadow-[inset_0_2px_4px_#ffffff1a,inset_0_-3px_8px_#000000b3,0_16px_26px_-12px_#000000d9] group-has-focus-visible:outline-2 group-has-focus-visible:outline-offset-[5px] group-has-focus-visible:outline-tb44-lamp">
      <span class="absolute inset-0 rounded-full opacity-65 bg-[repeating-conic-gradient(from_-66deg,var(--color-tb44-tick)_0_0.9deg,transparent_0.9deg_11deg)] [mask-image:radial-gradient(farthest-side,transparent_76%,#000_78%)]"></span>
      <span class="absolute left-1.5 bottom-6 text-[0.6875rem] tracking-[0.16em] uppercase text-tb44-ink opacity-100 -rotate-[24deg] transition-opacity duration-300 group-has-checked:opacity-60 motion-reduce:transition-none">Off</span>
      <span class="absolute right-1.5 bottom-6 text-[0.6875rem] tracking-[0.16em] uppercase text-tb44-ink opacity-60 rotate-[24deg] transition-[opacity,color] duration-300 group-has-checked:opacity-100 group-has-checked:text-tb44-lamp motion-reduce:transition-none">On</span>
      <span class="absolute top-3.5 size-2 rounded-full bg-tb44-lamp opacity-[0.18] shadow-[0_0_6px_var(--color-tb44-lamp),0_0_14px_var(--color-tb44-lamp-55)] transition-opacity duration-[350ms] group-has-checked:opacity-100 motion-reduce:transition-none"></span>
      <span class="tb-44__knob relative w-[62%] h-[62%] rounded-full -rotate-[66deg] shadow-[inset_0_2px_3px_#ffffff38,inset_0_-3px_6px_#00000099,0_6px_12px_-4px_#000000cc] transition-[rotate,filter] duration-700 ease-tb44-spring group-hover:brightness-110 group-active:scale-[0.97] group-has-checked:rotate-[66deg] motion-reduce:transition-none">
        <span class="absolute inset-0 rounded-full bg-[repeating-conic-gradient(from_0deg,#ffffff24_0_1.6deg,#00000038_1.6deg_3.4deg)] [mask-image:radial-gradient(farthest-side,transparent_78%,#000_80%)]"></span>
        <span class="absolute top-[9%] left-1/2 w-[0.28rem] h-[34%] -ml-[0.14rem] rounded-full bg-[linear-gradient(180deg,var(--color-tb44-tick),var(--color-tb44-tick-lo))] shadow-[0_0_4px_#00000099]"></span>
      </span>
    </span>
  </label>
</div>
@import "tailwindcss";

@theme {
  --color-tb44-bg: #1b1512;
  --color-tb44-bg: oklch(0.2 0.02 50);
  --color-tb44-plate: #241c17;
  --color-tb44-plate: oklch(0.24 0.025 50);
  --color-tb44-bake: #3a2418;
  --color-tb44-bake: oklch(0.3 0.05 50);
  --color-tb44-bake-hi: #5a3a26;
  --color-tb44-bake-hi: oklch(0.4 0.06 52);
  --color-tb44-bake-lo: #1d120b;
  --color-tb44-bake-lo: oklch(0.18 0.03 48);
  --color-tb44-tick: #c9b48d;
  --color-tb44-tick: oklch(0.78 0.04 82);
  --color-tb44-tick-lo: #8a7a59;
  --color-tb44-tick-lo: oklch(0.56 0.04 82);
  --color-tb44-ink: #e6d7b8;
  --color-tb44-ink: oklch(0.88 0.04 85);
  --color-tb44-lamp: #ff9f43;
  --color-tb44-lamp: oklch(0.78 0.16 62);
  --color-tb44-lamp-55: #ff9f438c;
  --color-tb44-lamp-55: oklch(0.78 0.16 62 / 0.55);
  --font-tb44-sans: "Oswald", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-tb44-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

@supports (transition-timing-function: linear(0, 1)) {
  @theme {
    --ease-tb44-spring: linear(0, 0.36 7%, 0.8 15%, 1.05 23%, 1.09 29%, 1.02 39%, 1 54%, 1);
  }
}

.tb-44 {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  background: radial-gradient(30rem 20rem at 50% 44%, #2b211a, transparent 74%), var(--color-tb44-bg);
}

.tb-44__plate {
  background: radial-gradient(circle at 40% 30%, rgba(255,255,255,.08), transparent 60%), linear-gradient(160deg, #2e241d, var(--color-tb44-plate));
}
/* BAKELITE: mottled two-blotch overlay + specular, which is what separates it
   from plain dark plastic. */

.tb-44__knob {
  background: radial-gradient(circle at 36% 28%, var(--color-tb44-bake-hi), transparent 58%), radial-gradient(1.4rem 1rem at 70% 74%, rgba(0,0,0,.4), transparent 70%), linear-gradient(155deg, var(--color-tb44-bake), var(--color-tb44-bake-lo));
}
/* Safari ≤15.3 shims for the two annulus masks. */

.tb-44__plate > span:first-child {
  -webkit-mask-image: radial-gradient(farthest-side, transparent 76%, #000 78%);
}

.tb-44__knob > span:first-child {
  -webkit-mask-image: radial-gradient(farthest-side, transparent 78%, #000 80%);
}

@media (prefers-color-scheme: light) {
  .tb-44:not([data-theme="dark"]) {
    --color-tb44-bg: oklch(0.25 0.022 50);
  }
}

.tb-44[data-theme="light"] {
  --color-tb44-bg: oklch(0.25 0.022 50);
}

@media (forced-colors: active) {
  .tb-44__plate,
    .tb-44__knob {
    background: ButtonFace;
    border: 1px solid ButtonText;
    box-shadow: none;
  }

  .tb-44__plate > span:first-child,
    .tb-44__knob > span:first-child {
    display: none;
  }

  .tb-44__knob > span:last-child {
    background: ButtonText;
  }
}

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-tb44-bg: #1b1512;
  --color-tb44-bg: oklch(0.2 0.02 50);
  --color-tb44-plate: #241c17;
  --color-tb44-plate: oklch(0.24 0.025 50);
  --color-tb44-bake: #3a2418;
  --color-tb44-bake: oklch(0.3 0.05 50);
  --color-tb44-bake-hi: #5a3a26;
  --color-tb44-bake-hi: oklch(0.4 0.06 52);
  --color-tb44-bake-lo: #1d120b;
  --color-tb44-bake-lo: oklch(0.18 0.03 48);
  --color-tb44-tick: #c9b48d;
  --color-tb44-tick: oklch(0.78 0.04 82);
  --color-tb44-tick-lo: #8a7a59;
  --color-tb44-tick-lo: oklch(0.56 0.04 82);
  --color-tb44-ink: #e6d7b8;
  --color-tb44-ink: oklch(0.88 0.04 85);
  --color-tb44-lamp: #ff9f43;
  --color-tb44-lamp: oklch(0.78 0.16 62);
  --color-tb44-lamp-55: #ff9f438c;
  --color-tb44-lamp-55: oklch(0.78 0.16 62 / 0.55);
  --font-tb44-sans: "Oswald", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-tb44-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

@supports (transition-timing-function: linear(0, 1)) {
  @theme {
    --ease-tb44-spring: linear(0, 0.36 7%, 0.8 15%, 1.05 23%, 1.09 29%, 1.02 39%, 1 54%, 1);
  }
}

.tb-44 {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  background: radial-gradient(30rem 20rem at 50% 44%, #2b211a, transparent 74%), var(--color-tb44-bg);
}

.tb-44__plate {
  background: radial-gradient(circle at 40% 30%, rgba(255,255,255,.08), transparent 60%), linear-gradient(160deg, #2e241d, var(--color-tb44-plate));
}
/* BAKELITE: mottled two-blotch overlay + specular, which is what separates it
   from plain dark plastic. */

.tb-44__knob {
  background: radial-gradient(circle at 36% 28%, var(--color-tb44-bake-hi), transparent 58%), radial-gradient(1.4rem 1rem at 70% 74%, rgba(0,0,0,.4), transparent 70%), linear-gradient(155deg, var(--color-tb44-bake), var(--color-tb44-bake-lo));
}
/* Safari ≤15.3 shims for the two annulus masks. */

.tb-44__plate > span:first-child {
  -webkit-mask-image: radial-gradient(farthest-side, transparent 76%, #000 78%);
}

.tb-44__knob > span:first-child {
  -webkit-mask-image: radial-gradient(farthest-side, transparent 78%, #000 80%);
}

@media (prefers-color-scheme: light) {
  .tb-44:not([data-theme="dark"]) {
    --color-tb44-bg: oklch(0.25 0.022 50);
  }
}

.tb-44[data-theme="light"] {
  --color-tb44-bg: oklch(0.25 0.022 50);
}

@media (forced-colors: active) {
  .tb-44__plate,
    .tb-44__knob {
    background: ButtonFace;
    border: 1px solid ButtonText;
    box-shadow: none;
  }

  .tb-44__plate > span:first-child,
    .tb-44__knob > span:first-child {
    display: none;
  }

  .tb-44__knob > span:last-child {
    background: ButtonText;
  }
}
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@500;600&display=swap">

What changed in the port

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

  • Utilities: the rotation and its spring, both legends, the lamp, the tick ring, the knurl, the pointer, the focus ring on the plate. CSS: the plate and bakelite gradients, the linear() spring, and the two -webkit-mask shims.
  • Splitting the 132° throw into -rotate-[66deg] and rotate-[66deg] is a small port improvement over the original's -66deg/132deg pair: the symmetry with the tick ring's from -66deg is now visible, so the "pointer must land on a tick" constraint is self-documenting.
  • role="switch" survives the port untouched, and that is the point — it is the single most important attribute on the control and no utility is involved in it.
  • A11y fix from the CSS original: the resting legends sat at opacity:.6 on --ink:#e6d7b8 over the dark plate — about 3.9:1 for the active one, since both were dimmed until checked. The port keeps the inactive legend at 60% but holds the current one at full opacity in both states, so whichever legend is true is always ≈9:1.
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 Bakelite Radio Dial Toggle Button
Source: https://codefronts.com/components/tailwind-css-buttons/tailwind-bakelite-radio-dial-toggle-button/

A bakelite rotary switch that turns 132° from OFF to ON, with a knurled grip, a chamfered pointer, engraved ticks around the bezel, and a warm indicator lamp that fades up as the contact closes. A checkbox with role="switch" holds the state.
## HTML
```html
<div class="tb-44 w-full min-h-svh grid place-items-center font-tb44-sans p-[clamp(1.5rem,6vw,4rem)]">
  <label class="group relative block cursor-pointer [-webkit-tap-highlight-color:transparent]">
    <input type="checkbox" role="switch" aria-label="Power" class="sr-only">
    <span aria-hidden="true" class="tb-44__plate relative grid place-items-center size-38 rounded-full shadow-[inset_0_2px_4px_#ffffff1a,inset_0_-3px_8px_#000000b3,0_16px_26px_-12px_#000000d9] group-has-focus-visible:outline-2 group-has-focus-visible:outline-offset-[5px] group-has-focus-visible:outline-tb44-lamp">
      <span class="absolute inset-0 rounded-full opacity-65 bg-[repeating-conic-gradient(from_-66deg,var(--color-tb44-tick)_0_0.9deg,transparent_0.9deg_11deg)] [mask-image:radial-gradient(farthest-side,transparent_76%,#000_78%)]"></span>
      <span class="absolute left-1.5 bottom-6 text-[0.6875rem] tracking-[0.16em] uppercase text-tb44-ink opacity-100 -rotate-[24deg] transition-opacity duration-300 group-has-checked:opacity-60 motion-reduce:transition-none">Off</span>
      <span class="absolute right-1.5 bottom-6 text-[0.6875rem] tracking-[0.16em] uppercase text-tb44-ink opacity-60 rotate-[24deg] transition-[opacity,color] duration-300 group-has-checked:opacity-100 group-has-checked:text-tb44-lamp motion-reduce:transition-none">On</span>
      <span class="absolute top-3.5 size-2 rounded-full bg-tb44-lamp opacity-[0.18] shadow-[0_0_6px_var(--color-tb44-lamp),0_0_14px_var(--color-tb44-lamp-55)] transition-opacity duration-[350ms] group-has-checked:opacity-100 motion-reduce:transition-none"></span>
      <span class="tb-44__knob relative w-[62%] h-[62%] rounded-full -rotate-[66deg] shadow-[inset_0_2px_3px_#ffffff38,inset_0_-3px_6px_#00000099,0_6px_12px_-4px_#000000cc] transition-[rotate,filter] duration-700 ease-tb44-spring group-hover:brightness-110 group-active:scale-[0.97] group-has-checked:rotate-[66deg] motion-reduce:transition-none">
        <span class="absolute inset-0 rounded-full bg-[repeating-conic-gradient(from_0deg,#ffffff24_0_1.6deg,#00000038_1.6deg_3.4deg)] [mask-image:radial-gradient(farthest-side,transparent_78%,#000_80%)]"></span>
        <span class="absolute top-[9%] left-1/2 w-[0.28rem] h-[34%] -ml-[0.14rem] rounded-full bg-[linear-gradient(180deg,var(--color-tb44-tick),var(--color-tb44-tick-lo))] shadow-[0_0_4px_#00000099]"></span>
      </span>
    </span>
  </label>
</div>
```
## CSS
```css
@import "tailwindcss";

@theme {
  --color-tb44-bg: #1b1512;
  --color-tb44-bg: oklch(0.2 0.02 50);
  --color-tb44-plate: #241c17;
  --color-tb44-plate: oklch(0.24 0.025 50);
  --color-tb44-bake: #3a2418;
  --color-tb44-bake: oklch(0.3 0.05 50);
  --color-tb44-bake-hi: #5a3a26;
  --color-tb44-bake-hi: oklch(0.4 0.06 52);
  --color-tb44-bake-lo: #1d120b;
  --color-tb44-bake-lo: oklch(0.18 0.03 48);
  --color-tb44-tick: #c9b48d;
  --color-tb44-tick: oklch(0.78 0.04 82);
  --color-tb44-tick-lo: #8a7a59;
  --color-tb44-tick-lo: oklch(0.56 0.04 82);
  --color-tb44-ink: #e6d7b8;
  --color-tb44-ink: oklch(0.88 0.04 85);
  --color-tb44-lamp: #ff9f43;
  --color-tb44-lamp: oklch(0.78 0.16 62);
  --color-tb44-lamp-55: #ff9f438c;
  --color-tb44-lamp-55: oklch(0.78 0.16 62 / 0.55);
  --font-tb44-sans: "Oswald", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-tb44-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

@supports (transition-timing-function: linear(0, 1)) {
  @theme {
    --ease-tb44-spring: linear(0, 0.36 7%, 0.8 15%, 1.05 23%, 1.09 29%, 1.02 39%, 1 54%, 1);
  }
}

.tb-44 {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  background: radial-gradient(30rem 20rem at 50% 44%, #2b211a, transparent 74%), var(--color-tb44-bg);
}

.tb-44__plate {
  background: radial-gradient(circle at 40% 30%, rgba(255,255,255,.08), transparent 60%), linear-gradient(160deg, #2e241d, var(--color-tb44-plate));
}
/* BAKELITE: mottled two-blotch overlay + specular, which is what separates it
   from plain dark plastic. */

.tb-44__knob {
  background: radial-gradient(circle at 36% 28%, var(--color-tb44-bake-hi), transparent 58%), radial-gradient(1.4rem 1rem at 70% 74%, rgba(0,0,0,.4), transparent 70%), linear-gradient(155deg, var(--color-tb44-bake), var(--color-tb44-bake-lo));
}
/* Safari ≤15.3 shims for the two annulus masks. */

.tb-44__plate > span:first-child {
  -webkit-mask-image: radial-gradient(farthest-side, transparent 76%, #000 78%);
}

.tb-44__knob > span:first-child {
  -webkit-mask-image: radial-gradient(farthest-side, transparent 78%, #000 80%);
}

@media (prefers-color-scheme: light) {
  .tb-44:not([data-theme="dark"]) {
    --color-tb44-bg: oklch(0.25 0.022 50);
  }
}

.tb-44[data-theme="light"] {
  --color-tb44-bg: oklch(0.25 0.022 50);
}

@media (forced-colors: active) {
  .tb-44__plate,
    .tb-44__knob {
    background: ButtonFace;
    border: 1px solid ButtonText;
    box-shadow: none;
  }

  .tb-44__plate > span:first-child,
    .tb-44__knob > span:first-child {
    display: none;
  }

  .tb-44__knob > span:last-child {
    background: ButtonText;
  }
}
```

How this works

The throw angle and the tick offset are the same number. The knob rests at -66deg and turns to +66deg; the tick ring starts at from -66deg. Change one and you must change the other, which is much easier to notice when they sit in the same file as two utilities than as two rules forty lines apart.

class="-rotate-[66deg] group-has-checked:rotate-[66deg] ease-tb44-spring"

The legends carry the state in text. A rotating knob announces nothing; OFF/ON plus role="switch" is what makes it a control rather than a sculpture.

Focus goes on the label, not the knob, so the ring surrounds the whole plate — a knob-sized ring inside a plate reads as a rendering error.

Make it yours

  • Change the throw and the tick offset together, or the pointer lands between ticks.
  • More positions: switch to a radio group with one rotation per option.
  • --color-tb44-lamp: amber for tube gear, green for lab equipment.
  • Knurl frequency is the second conic's 3.4deg — coarser grips read as heavier gear.
  • Keep the rotation under ~180° or users cannot tell which way it turned.

Gotchas — read before shipping

  • role="switch" on a checkbox is correct and well-supported. Do not add aria-checked as well — the checkbox already exposes it.
  • A rotating knob gives no textual state. The legend and the role are what make it accessible.
  • Masked conic rings alias at small sizes; below 4rem use fewer, thicker ticks.
  • The knob must not be the focus target. Focus the label so the ring surrounds the control.
  • Two masked conic rings plus three radial layers is near the paint ceiling for one element.

Browser support

ChromeSafariFirefoxEdge
113+17.2+128+113+

:has() and repeating-conic-gradient sit below Tailwind v4's floor; linear() spring easing needs Chrome 113 / Safari 17.2 / Firefox 112 behind the token's cubic-bezier fallback.

Techniques used in this demo

Utilitiesfirst-class utility or variant

Search CodeFronts

Loading…