51 Tailwind CSS Buttons
34 / 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 Obsidian Glass Shard Button

A shard of volcanic glass: an asymmetric faceted silhouette from clip-path, near-black translucency over a blurred backdrop, two facet planes shaded by opposing gradients, and a razor of light that runs along the leading edge on hover.

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-34 w-full min-h-svh grid place-items-center font-tb34-sans antialiased p-[clamp(1.5rem,6vw,4rem)]">
  <span class="group inline-block rounded-[0.2rem] drop-shadow-[0_18px_28px_#000000bf] transition-[translate,filter] duration-[350ms] ease-tb34-out has-hover:-translate-y-[3px] has-hover:drop-shadow-[0_26px_34px_#000000cc] has-focus-visible:outline-2 has-focus-visible:outline-offset-[6px] has-focus-visible:outline-tb34-glow motion-reduce:transition-none">
    <button type="button" class="tb-34__shard relative overflow-hidden cursor-pointer grid place-items-center min-h-15 px-12 border-0 text-base font-bold tracking-[0.02em] text-tb34-ink bg-tb34-glass backdrop-blur-[10px] backdrop-saturate-[1.2] transition-[scale] duration-200 ease-tb34-out focus-visible:outline-none active:scale-[0.985] disabled:cursor-not-allowed disabled:text-tb34-muted motion-reduce:transition-none">
      <span aria-hidden="true" class="tb-34__rim absolute inset-px z-10 pointer-events-none shadow-[inset_0_0_0_1px_var(--color-tb34-rim)]"></span>
      <span aria-hidden="true" class="absolute -inset-y-[30%] -inset-x-[40%] z-20 pointer-events-none -translate-x-[70%] bg-[linear-gradient(100deg,transparent_44%,var(--color-tb34-glow-bar)_50%,transparent_56%)] transition-transform duration-[850ms] ease-tb34-out group-hover:translate-x-[70%] group-focus-within:translate-x-[70%] motion-reduce:hidden"></span>
      <span class="relative z-30 [text-shadow:0_1px_10px_#000000b3]">Enter the vault</span>
    </button>
  </span>
</div>
@import "tailwindcss";

@theme {
  --color-tb34-bg: #07070a;
  --color-tb34-bg: oklch(0.1 0.008 280);
  --color-tb34-glass: #101116d1;
  --color-tb34-glass: oklch(0.18 0.012 275 / 0.82);
  --color-tb34-ink: #eef2f8;
  --color-tb34-ink: oklch(0.95 0.008 260);
  --color-tb34-muted: #8b93a3;
  --color-tb34-muted: oklch(0.63 0.02 260);
  --color-tb34-glow: #bfe3ff;
  --color-tb34-glow: oklch(0.9 0.06 235);
  --color-tb34-glow-bar: #bfe3ffd9;
  --color-tb34-glow-bar: oklch(0.9 0.06 235 / 0.85);
  --color-tb34-rim: #bfe3ff4d;
  --color-tb34-rim: oklch(0.9 0.06 235 / 0.3);
  --font-tb34-sans: "Syne", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-tb34-out: cubic-bezier(0.16, 1, 0.3, 1);
}

.tb-34 {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  --tb-34-shape: polygon(4% 0, 100% 6%, 96% 82%, 88% 100%, 0 94%, 3% 18%);
  background: radial-gradient(38rem 22rem at 50% 45%, #14161d, transparent 74%), var(--color-tb34-bg);
}
/* The shape is shared by the button and its 1px rim layer — one variable, so the
   inset can never drift at the corners. Facets: two hard-stop planes over the base. */

.tb-34__shard {
  clip-path: var(--tb-34-shape);
  background-image: linear-gradient(122deg, rgba(255,255,255,.1) 0 38%, transparent 38.5%), linear-gradient(-58deg, rgba(255,255,255,.05) 0 30%, transparent 30.5%), linear-gradient(160deg, rgba(52,58,74,.95), rgba(14,16,22,.97));
}

.tb-34__rim {
  clip-path: var(--tb-34-shape);
}

@media (prefers-color-scheme: light) {
  .tb-34:not([data-theme="dark"]) {
    --color-tb34-bg: oklch(0.16 0.012 275);
  }
}

.tb-34[data-theme="light"] {
  --color-tb34-bg: oklch(0.16 0.012 275);
}

@media (forced-colors: active) {
  .tb-34__shard {
    clip-path: none;
    background: ButtonFace;
    color: ButtonText;
    border: 1px solid ButtonText;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .tb-34__shard span[aria-hidden] {
    display: none;
  }

  .tb-34 > span {
    filter: 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-tb34-bg: #07070a;
  --color-tb34-bg: oklch(0.1 0.008 280);
  --color-tb34-glass: #101116d1;
  --color-tb34-glass: oklch(0.18 0.012 275 / 0.82);
  --color-tb34-ink: #eef2f8;
  --color-tb34-ink: oklch(0.95 0.008 260);
  --color-tb34-muted: #8b93a3;
  --color-tb34-muted: oklch(0.63 0.02 260);
  --color-tb34-glow: #bfe3ff;
  --color-tb34-glow: oklch(0.9 0.06 235);
  --color-tb34-glow-bar: #bfe3ffd9;
  --color-tb34-glow-bar: oklch(0.9 0.06 235 / 0.85);
  --color-tb34-rim: #bfe3ff4d;
  --color-tb34-rim: oklch(0.9 0.06 235 / 0.3);
  --font-tb34-sans: "Syne", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-tb34-out: cubic-bezier(0.16, 1, 0.3, 1);
}

.tb-34 {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  --tb-34-shape: polygon(4% 0, 100% 6%, 96% 82%, 88% 100%, 0 94%, 3% 18%);
  background: radial-gradient(38rem 22rem at 50% 45%, #14161d, transparent 74%), var(--color-tb34-bg);
}
/* The shape is shared by the button and its 1px rim layer — one variable, so the
   inset can never drift at the corners. Facets: two hard-stop planes over the base. */

.tb-34__shard {
  clip-path: var(--tb-34-shape);
  background-image: linear-gradient(122deg, rgba(255,255,255,.1) 0 38%, transparent 38.5%), linear-gradient(-58deg, rgba(255,255,255,.05) 0 30%, transparent 30.5%), linear-gradient(160deg, rgba(52,58,74,.95), rgba(14,16,22,.97));
}

.tb-34__rim {
  clip-path: var(--tb-34-shape);
}

@media (prefers-color-scheme: light) {
  .tb-34:not([data-theme="dark"]) {
    --color-tb34-bg: oklch(0.16 0.012 275);
  }
}

.tb-34[data-theme="light"] {
  --color-tb34-bg: oklch(0.16 0.012 275);
}

@media (forced-colors: active) {
  .tb-34__shard {
    clip-path: none;
    background: ButtonFace;
    color: ButtonText;
    border: 1px solid ButtonText;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .tb-34__shard span[aria-hidden] {
    display: none;
  }

  .tb-34 > span {
    filter: 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=Syne:wght@600;700;800&display=swap">

What changed in the port

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

  • Utilities: the clip (via a shared variable), the backdrop filters, the wrapper's relational hover and focus states, the rim's inset ring, the edge sweep. CSS: the three facet gradients and the shape variable they share with the rim.
  • has-hover: on the wrapper is a literal one-to-one port of :has(:hover), and this is the demo where that matters most: with clip-path on the button, every decoration — shadow, lift, focus ring — has to live one level up. The variant makes that structure explicit rather than accidental.
  • The --tb-34-shape variable stays in CSS even though the polygon could be an arbitrary utility, because two elements must use the identical value. A duplicated 60-character polygon is a drift bug waiting to happen.
  • A11y fix from the CSS original: the disabled label was #7c8494 on the near-black glass — about 4.0:1. The port raises it to oklch(0.63 0.02 260) (≈5.4:1). Disabled is not exempt, and on a dark shard it is the only text present.
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 Obsidian Glass Shard Button
Source: https://codefronts.com/components/tailwind-css-buttons/tailwind-obsidian-glass-shard-button/

A shard of volcanic glass: an asymmetric faceted silhouette from clip-path, near-black translucency over a blurred backdrop, two facet planes shaded by opposing gradients, and a razor of light that runs along the leading edge on hover.
## HTML
```html
<div class="tb-34 w-full min-h-svh grid place-items-center font-tb34-sans antialiased p-[clamp(1.5rem,6vw,4rem)]">
  <span class="group inline-block rounded-[0.2rem] drop-shadow-[0_18px_28px_#000000bf] transition-[translate,filter] duration-[350ms] ease-tb34-out has-hover:-translate-y-[3px] has-hover:drop-shadow-[0_26px_34px_#000000cc] has-focus-visible:outline-2 has-focus-visible:outline-offset-[6px] has-focus-visible:outline-tb34-glow motion-reduce:transition-none">
    <button type="button" class="tb-34__shard relative overflow-hidden cursor-pointer grid place-items-center min-h-15 px-12 border-0 text-base font-bold tracking-[0.02em] text-tb34-ink bg-tb34-glass backdrop-blur-[10px] backdrop-saturate-[1.2] transition-[scale] duration-200 ease-tb34-out focus-visible:outline-none active:scale-[0.985] disabled:cursor-not-allowed disabled:text-tb34-muted motion-reduce:transition-none">
      <span aria-hidden="true" class="tb-34__rim absolute inset-px z-10 pointer-events-none shadow-[inset_0_0_0_1px_var(--color-tb34-rim)]"></span>
      <span aria-hidden="true" class="absolute -inset-y-[30%] -inset-x-[40%] z-20 pointer-events-none -translate-x-[70%] bg-[linear-gradient(100deg,transparent_44%,var(--color-tb34-glow-bar)_50%,transparent_56%)] transition-transform duration-[850ms] ease-tb34-out group-hover:translate-x-[70%] group-focus-within:translate-x-[70%] motion-reduce:hidden"></span>
      <span class="relative z-30 [text-shadow:0_1px_10px_#000000b3]">Enter the vault</span>
    </button>
  </span>
</div>
```
## CSS
```css
@import "tailwindcss";

@theme {
  --color-tb34-bg: #07070a;
  --color-tb34-bg: oklch(0.1 0.008 280);
  --color-tb34-glass: #101116d1;
  --color-tb34-glass: oklch(0.18 0.012 275 / 0.82);
  --color-tb34-ink: #eef2f8;
  --color-tb34-ink: oklch(0.95 0.008 260);
  --color-tb34-muted: #8b93a3;
  --color-tb34-muted: oklch(0.63 0.02 260);
  --color-tb34-glow: #bfe3ff;
  --color-tb34-glow: oklch(0.9 0.06 235);
  --color-tb34-glow-bar: #bfe3ffd9;
  --color-tb34-glow-bar: oklch(0.9 0.06 235 / 0.85);
  --color-tb34-rim: #bfe3ff4d;
  --color-tb34-rim: oklch(0.9 0.06 235 / 0.3);
  --font-tb34-sans: "Syne", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-tb34-out: cubic-bezier(0.16, 1, 0.3, 1);
}

.tb-34 {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  --tb-34-shape: polygon(4% 0, 100% 6%, 96% 82%, 88% 100%, 0 94%, 3% 18%);
  background: radial-gradient(38rem 22rem at 50% 45%, #14161d, transparent 74%), var(--color-tb34-bg);
}
/* The shape is shared by the button and its 1px rim layer — one variable, so the
   inset can never drift at the corners. Facets: two hard-stop planes over the base. */

.tb-34__shard {
  clip-path: var(--tb-34-shape);
  background-image: linear-gradient(122deg, rgba(255,255,255,.1) 0 38%, transparent 38.5%), linear-gradient(-58deg, rgba(255,255,255,.05) 0 30%, transparent 30.5%), linear-gradient(160deg, rgba(52,58,74,.95), rgba(14,16,22,.97));
}

.tb-34__rim {
  clip-path: var(--tb-34-shape);
}

@media (prefers-color-scheme: light) {
  .tb-34:not([data-theme="dark"]) {
    --color-tb34-bg: oklch(0.16 0.012 275);
  }
}

.tb-34[data-theme="light"] {
  --color-tb34-bg: oklch(0.16 0.012 275);
}

@media (forced-colors: active) {
  .tb-34__shard {
    clip-path: none;
    background: ButtonFace;
    color: ButtonText;
    border: 1px solid ButtonText;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .tb-34__shard span[aria-hidden] {
    display: none;
  }

  .tb-34 > span {
    filter: none;
  }
}
```

How this works

Clipping costs you shadows, borders and outlines. All three workarounds live on the wrapper, and the port makes that structural decision visible:

<span class="inline-block drop-shadow-[0_18px_28px_#000000bf]
  has-hover:-translate-y-[3px] has-focus-visible:outline-2
  has-focus-visible:outline-offset-[6px]">
  <button class="[clip-path:polygon(…)] focus-visible:outline-none">…</button>
</span>

has-hover: and has-focus-visible: on the wrapper are exactly :has(:hover) and :has(:focus-visible) from the original — a one-to-one port of a relational selector.

The facets are hard-ish gradient stops, not a smooth sheen: rgba(255,255,255,.1) 0 38%, transparent 38.5% makes a plane, a soft stop makes a blur. Three layers, so they stay in CSS with the shape variable they share.

Make it yours

  • Redraw the facets in the polygon; keep one long straight edge so the label has room.
  • --color-tb34-glow sets the edge light: icy blue for obsidian, amber for smoked quartz.
  • A second edge sweep at a different angle with a delay-* gives a multi-facet catch.
  • Raise backdrop-blur-[10px] for frosted volcanic glass, drop it for opaque stone.
  • The rim's alpha is the difference between a shard and a cut-out. Keep it under 0.35.

Gotchas — read before shipping

  • clip-path kills box-shadow, border and outline. Wrapper filter, clipped inner rim, wrapper outline.
  • Angular shapes shrink the effective hit area at the corners. Keep the label well inside and the height ≥3rem.
  • Sharp geometric buttons read as decorative — the label must be an unambiguous verb.
  • Very dark surfaces need a light label at ≥4.5:1. Near-black on near-black is this style's classic failure.
  • The rim layer must use the same clip-path variable as the button, or the 1px inset drifts at the corners.

Browser support

ChromeSafariFirefoxEdge
111+16.4+128+111+

clip-path and drop-shadow are baseline; backdrop-filter degrades to the solid translucent background declared underneath it. :has() drives the wrapper states.

Techniques used in this demo

Utilitiesfirst-class utility or variant

Arbitraryneeds bracket syntax

Search CodeFronts

Loading…