03 / 51
All 51 in 51 Tailwind CSS Buttons
- 01Tailwind Submit Button (Form Primary)
- 02Tailwind Primary and Secondary Button Pair
- 03Tailwind Ghost / Outline Button
- 04Tailwind Icon-Only Button with Accessible Tooltip
- 05Tailwind Gradient CTA Button
- 06Tailwind Loading Spinner Button (State Transition)
- 07Tailwind Disabled Button State (Full State Reference)
- 08Tailwind Button Group Component (Segmented Radio-Like)
- 09Tailwind Add to Cart Button
- 10Tailwind Download Progress Button
- 11Tailwind Like Heart Button
- 12Tailwind Confirm Delete Button
- 13Tailwind Play Pause Button
- 14Tailwind Subscribe Confetti Button
- 15Tailwind Magnetic Mercury Ripple Button
- 16Tailwind Brutalist Glitch Button
- 17Tailwind Neon Plasma Burst Button
- 18Tailwind Clay Press Button
- 19Tailwind Editorial Ink Spread Button
- 20Tailwind Particle Shard Burst Button
- 21Tailwind Brushed Brass Plate Button
- 22Tailwind Washi Paper Crane Button
- 23Tailwind Frosted Ice Cube Button
- 24Tailwind Vintage Typewriter Key Button
- 25Tailwind Lacquered Walnut Wood Button
- 26Tailwind Pharma Gel Capsule Button
- 27Tailwind Aged Copper Coin Button
- 28Tailwind Origami Fortune Cookie Button
- 29Tailwind Holographic Foil Sticker Button
- 30Tailwind Brutalist Concrete Slab Button
- 31Tailwind Mercury Bead Morph Button
- 32Tailwind Soft Pill Modern SaaS Button
- 33Tailwind Masking Tape Label Button
- 34Tailwind Obsidian Glass Shard Button
- 35Tailwind Wine Velvet Ribbon Button
- 36Tailwind LED Segment Display Button
- 37Tailwind Cassette Mixtape Label Button
- 38Tailwind Chalkboard Menu Button
- 39Tailwind Vinyl Record Sleeve Ripple Button
- 40Tailwind Polaroid Snapshot Button
- 41Tailwind Airline Boarding Pass Button
- 42Tailwind Aged Brass Subway Token Button
- 43Tailwind Vintage Rx Pharmacy Label Button
- 44Tailwind Bakelite Radio Dial Toggle Button
- 45Tailwind Regal Postage Stamp Button
- 46Tailwind Victorian Cigar Band Foil Button
- 47Tailwind Vintage Calculator Key Button
- 48Tailwind Toolbox Latch Spotlight Button
- 49Tailwind Receipt Paper Total Count-Up Button
- 50Tailwind IBM Punch Card Magnetic Follow Button
- 51Tailwind Brass Periscope Lens Button
Tailwind Ghost / Outline Button
A ghost button that keeps its 1px silhouette at rest and fills from the bottom edge on hover, the label inverting in the same beat. The fill is one background-size transition on a fixed gradient — no pseudo-element, no overflow clipping — and the border is currentColor, so one colour utility re-skins the whole control.
Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time
Untitled UI React · Affiliate link
The code
<div class="tb-03 w-full min-h-svh grid place-items-center bg-tb03-bg font-tb03-sans antialiased p-[clamp(1.5rem,6vw,4rem)]">
<button type="button" class="group cursor-pointer inline-grid grid-flow-col items-center gap-2.5 min-h-13 px-7 border border-current rounded-full text-[0.9375rem] font-medium tracking-[0.01em] text-tb03-accent bg-transparent bg-[linear-gradient(var(--color-tb03-accent),var(--color-tb03-accent))] bg-no-repeat bg-bottom bg-[length:100%_0%] transition-[background-size,color,letter-spacing] duration-[420ms] ease-tb03-out [transition-delay:0ms,60ms,0ms] hover:bg-[length:100%_100%] hover:text-tb03-on-accent hover:tracking-[0.03em] focus-visible:bg-[length:100%_100%] focus-visible:text-tb03-on-accent focus-visible:tracking-[0.03em] focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-tb03-accent active:scale-[0.985] disabled:cursor-not-allowed disabled:opacity-40 disabled:bg-[length:100%_0%] motion-reduce:transition-[color,background-size] motion-reduce:duration-100 motion-reduce:hover:tracking-[0.01em]">
<span>Read the case study</span>
<svg viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" class="w-[1.05rem] h-[1.05rem] transition-transform duration-[420ms] ease-tb03-out group-hover:rotate-45 group-focus-visible:rotate-45 motion-reduce:transition-none motion-reduce:group-hover:rotate-0"><path d="M7 17 17 7"/><path d="M8.5 7H17v8.5"/></svg>
</button>
</div><div class="tb-03 w-full min-h-svh grid place-items-center bg-tb03-bg font-tb03-sans antialiased p-[clamp(1.5rem,6vw,4rem)]">
<button type="button" class="group cursor-pointer inline-grid grid-flow-col items-center gap-2.5 min-h-13 px-7 border border-current rounded-full text-[0.9375rem] font-medium tracking-[0.01em] text-tb03-accent bg-transparent bg-[linear-gradient(var(--color-tb03-accent),var(--color-tb03-accent))] bg-no-repeat bg-bottom bg-[length:100%_0%] transition-[background-size,color,letter-spacing] duration-[420ms] ease-tb03-out [transition-delay:0ms,60ms,0ms] hover:bg-[length:100%_100%] hover:text-tb03-on-accent hover:tracking-[0.03em] focus-visible:bg-[length:100%_100%] focus-visible:text-tb03-on-accent focus-visible:tracking-[0.03em] focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-tb03-accent active:scale-[0.985] disabled:cursor-not-allowed disabled:opacity-40 disabled:bg-[length:100%_0%] motion-reduce:transition-[color,background-size] motion-reduce:duration-100 motion-reduce:hover:tracking-[0.01em]">
<span>Read the case study</span>
<svg viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" class="w-[1.05rem] h-[1.05rem] transition-transform duration-[420ms] ease-tb03-out group-hover:rotate-45 group-focus-visible:rotate-45 motion-reduce:transition-none motion-reduce:group-hover:rotate-0"><path d="M7 17 17 7"/><path d="M8.5 7H17v8.5"/></svg>
</button>
</div>@import "tailwindcss";
@theme {
--color-tb03-bg: #faf9f6;
--color-tb03-bg: oklch(0.978 0.006 95);
--color-tb03-accent: #111827;
--color-tb03-accent: oklch(0.22 0.02 265);
--color-tb03-on-accent: #f9fafb;
--color-tb03-on-accent: oklch(0.98 0.003 265);
--font-tb03-sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
--ease-tb03-out: cubic-bezier(0.16, 1, 0.3, 1);
}
.tb-03 {
width: 100%;
min-height: 100vh;
min-height: 100svh;
}
@media (prefers-color-scheme: dark) {
.tb-03:not([data-theme="light"]) {
--color-tb03-bg: oklch(0.14 0.004 265);
--color-tb03-accent: oklch(0.96 0.004 95);
--color-tb03-on-accent: oklch(0.16 0.006 265);
}
}
.tb-03[data-theme="dark"] {
--color-tb03-bg: oklch(0.14 0.004 265);
--color-tb03-accent: oklch(0.96 0.004 95);
--color-tb03-on-accent: oklch(0.16 0.006 265);
}
@media (forced-colors: active) {
.tb-03 button {
background: none;
border-color: ButtonText;
color: ButtonText;
}
.tb-03 button:hover {
background: Highlight;
color: HighlightText;
}
}@import "tailwindcss";
@theme {
--color-tb03-bg: #faf9f6;
--color-tb03-bg: oklch(0.978 0.006 95);
--color-tb03-accent: #111827;
--color-tb03-accent: oklch(0.22 0.02 265);
--color-tb03-on-accent: #f9fafb;
--color-tb03-on-accent: oklch(0.98 0.003 265);
--font-tb03-sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
--ease-tb03-out: cubic-bezier(0.16, 1, 0.3, 1);
}
.tb-03 {
width: 100%;
min-height: 100vh;
min-height: 100svh;
}
@media (prefers-color-scheme: dark) {
.tb-03:not([data-theme="light"]) {
--color-tb03-bg: oklch(0.14 0.004 265);
--color-tb03-accent: oklch(0.96 0.004 95);
--color-tb03-on-accent: oklch(0.16 0.006 265);
}
}
.tb-03[data-theme="dark"] {
--color-tb03-bg: oklch(0.14 0.004 265);
--color-tb03-accent: oklch(0.96 0.004 95);
--color-tb03-on-accent: oklch(0.16 0.006 265);
}
@media (forced-colors: active) {
.tb-03 button {
background: none;
border-color: ButtonText;
color: ButtonText;
}
.tb-03 button:hover {
background: Highlight;
color: HighlightText;
}
}Setup — do this once per project
Skip this if your project already runs Tailwind v4.
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<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.
npm install tailwindcss @tailwindcss/vite
npm install tailwindcss @tailwindcss/vite// vite.config.js ("type": "module" in package.json)
import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [tailwindcss()],
})// vite.config.js ("type": "module" in package.json)
import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [tailwindcss()],
})Any v4 setup works — Vite, PostCSS or the CLI. Nothing in this demo is bundler-specific.
@import "tailwindcss";
@theme {
--color-tb03-bg: #faf9f6;
--color-tb03-bg: oklch(0.978 0.006 95);
--color-tb03-accent: #111827;
--color-tb03-accent: oklch(0.22 0.02 265);
--color-tb03-on-accent: #f9fafb;
--color-tb03-on-accent: oklch(0.98 0.003 265);
--font-tb03-sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
--ease-tb03-out: cubic-bezier(0.16, 1, 0.3, 1);
}
.tb-03 {
width: 100%;
min-height: 100vh;
min-height: 100svh;
}
@media (prefers-color-scheme: dark) {
.tb-03:not([data-theme="light"]) {
--color-tb03-bg: oklch(0.14 0.004 265);
--color-tb03-accent: oklch(0.96 0.004 95);
--color-tb03-on-accent: oklch(0.16 0.006 265);
}
}
.tb-03[data-theme="dark"] {
--color-tb03-bg: oklch(0.14 0.004 265);
--color-tb03-accent: oklch(0.96 0.004 95);
--color-tb03-on-accent: oklch(0.16 0.006 265);
}
@media (forced-colors: active) {
.tb-03 button {
background: none;
border-color: ButtonText;
color: ButtonText;
}
.tb-03 button:hover {
background: Highlight;
color: HighlightText;
}
}@import "tailwindcss";
@theme {
--color-tb03-bg: #faf9f6;
--color-tb03-bg: oklch(0.978 0.006 95);
--color-tb03-accent: #111827;
--color-tb03-accent: oklch(0.22 0.02 265);
--color-tb03-on-accent: #f9fafb;
--color-tb03-on-accent: oklch(0.98 0.003 265);
--font-tb03-sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
--ease-tb03-out: cubic-bezier(0.16, 1, 0.3, 1);
}
.tb-03 {
width: 100%;
min-height: 100vh;
min-height: 100svh;
}
@media (prefers-color-scheme: dark) {
.tb-03:not([data-theme="light"]) {
--color-tb03-bg: oklch(0.14 0.004 265);
--color-tb03-accent: oklch(0.96 0.004 95);
--color-tb03-on-accent: oklch(0.16 0.006 265);
}
}
.tb-03[data-theme="dark"] {
--color-tb03-bg: oklch(0.14 0.004 265);
--color-tb03-accent: oklch(0.96 0.004 95);
--color-tb03-on-accent: oklch(0.16 0.006 265);
}
@media (forced-colors: active) {
.tb-03 button {
background: none;
border-color: ButtonText;
color: ButtonText;
}
.tb-03 button:hover {
background: Highlight;
color: HighlightText;
}
}<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=Space+Grotesk:wght@400;500;600;700&display=swap">
<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=Space+Grotesk:wght@400;500;600;700&display=swap">What changed in the port
Which parts became utilities, which stayed CSS, and why.
- Utilities: the entire effect — gradient, background position, both background sizes, the colour flip, the tracking shift and the arrow rotation. This is the demo where the port is a straight win: five CSS rules collapse into one class list with no loss.
- CSS: the dark block and
forced-colorsonly. - The per-property delay had to be an arbitrary property (
[transition-delay:0ms,60ms,0ms]) becausedelay-*applies to all transitioned properties at once. It is the only stagger in the collection that needs this, and it is worth the escape hatch — remove it and the label disappears for 80ms on every hover. group-focus-visible:on the arrow is new: the CSS original rotated the arrow with:is(:hover,:focus-visible)on the button, and the group variant is the exact equivalent.
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 Ghost / Outline Button
Source: https://codefronts.com/components/tailwind-css-buttons/tailwind-ghost-outline-button/
A ghost button that keeps its 1px silhouette at rest and fills from the bottom edge on hover, the label inverting in the same beat. The fill is one background-size transition on a fixed gradient — no pseudo-element, no overflow clipping — and the border is currentColor, so one colour utility re-skins the whole control.
## HTML
```html
<div class="tb-03 w-full min-h-svh grid place-items-center bg-tb03-bg font-tb03-sans antialiased p-[clamp(1.5rem,6vw,4rem)]">
<button type="button" class="group cursor-pointer inline-grid grid-flow-col items-center gap-2.5 min-h-13 px-7 border border-current rounded-full text-[0.9375rem] font-medium tracking-[0.01em] text-tb03-accent bg-transparent bg-[linear-gradient(var(--color-tb03-accent),var(--color-tb03-accent))] bg-no-repeat bg-bottom bg-[length:100%_0%] transition-[background-size,color,letter-spacing] duration-[420ms] ease-tb03-out [transition-delay:0ms,60ms,0ms] hover:bg-[length:100%_100%] hover:text-tb03-on-accent hover:tracking-[0.03em] focus-visible:bg-[length:100%_100%] focus-visible:text-tb03-on-accent focus-visible:tracking-[0.03em] focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-tb03-accent active:scale-[0.985] disabled:cursor-not-allowed disabled:opacity-40 disabled:bg-[length:100%_0%] motion-reduce:transition-[color,background-size] motion-reduce:duration-100 motion-reduce:hover:tracking-[0.01em]">
<span>Read the case study</span>
<svg viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" class="w-[1.05rem] h-[1.05rem] transition-transform duration-[420ms] ease-tb03-out group-hover:rotate-45 group-focus-visible:rotate-45 motion-reduce:transition-none motion-reduce:group-hover:rotate-0"><path d="M7 17 17 7"/><path d="M8.5 7H17v8.5"/></svg>
</button>
</div>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tb03-bg: #faf9f6;
--color-tb03-bg: oklch(0.978 0.006 95);
--color-tb03-accent: #111827;
--color-tb03-accent: oklch(0.22 0.02 265);
--color-tb03-on-accent: #f9fafb;
--color-tb03-on-accent: oklch(0.98 0.003 265);
--font-tb03-sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
--ease-tb03-out: cubic-bezier(0.16, 1, 0.3, 1);
}
.tb-03 {
width: 100%;
min-height: 100vh;
min-height: 100svh;
}
@media (prefers-color-scheme: dark) {
.tb-03:not([data-theme="light"]) {
--color-tb03-bg: oklch(0.14 0.004 265);
--color-tb03-accent: oklch(0.96 0.004 95);
--color-tb03-on-accent: oklch(0.16 0.006 265);
}
}
.tb-03[data-theme="dark"] {
--color-tb03-bg: oklch(0.14 0.004 265);
--color-tb03-accent: oklch(0.96 0.004 95);
--color-tb03-on-accent: oklch(0.16 0.006 265);
}
@media (forced-colors: active) {
.tb-03 button {
background: none;
border-color: ButtonText;
color: ButtonText;
}
.tb-03 button:hover {
background: Highlight;
color: HighlightText;
}
}
```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 Ghost / Outline Button
Source: https://codefronts.com/components/tailwind-css-buttons/tailwind-ghost-outline-button/
A ghost button that keeps its 1px silhouette at rest and fills from the bottom edge on hover, the label inverting in the same beat. The fill is one background-size transition on a fixed gradient — no pseudo-element, no overflow clipping — and the border is currentColor, so one colour utility re-skins the whole control.
## HTML
```html
<div class="tb-03 w-full min-h-svh grid place-items-center bg-tb03-bg font-tb03-sans antialiased p-[clamp(1.5rem,6vw,4rem)]">
<button type="button" class="group cursor-pointer inline-grid grid-flow-col items-center gap-2.5 min-h-13 px-7 border border-current rounded-full text-[0.9375rem] font-medium tracking-[0.01em] text-tb03-accent bg-transparent bg-[linear-gradient(var(--color-tb03-accent),var(--color-tb03-accent))] bg-no-repeat bg-bottom bg-[length:100%_0%] transition-[background-size,color,letter-spacing] duration-[420ms] ease-tb03-out [transition-delay:0ms,60ms,0ms] hover:bg-[length:100%_100%] hover:text-tb03-on-accent hover:tracking-[0.03em] focus-visible:bg-[length:100%_100%] focus-visible:text-tb03-on-accent focus-visible:tracking-[0.03em] focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-tb03-accent active:scale-[0.985] disabled:cursor-not-allowed disabled:opacity-40 disabled:bg-[length:100%_0%] motion-reduce:transition-[color,background-size] motion-reduce:duration-100 motion-reduce:hover:tracking-[0.01em]">
<span>Read the case study</span>
<svg viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" class="w-[1.05rem] h-[1.05rem] transition-transform duration-[420ms] ease-tb03-out group-hover:rotate-45 group-focus-visible:rotate-45 motion-reduce:transition-none motion-reduce:group-hover:rotate-0"><path d="M7 17 17 7"/><path d="M8.5 7H17v8.5"/></svg>
</button>
</div>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tb03-bg: #faf9f6;
--color-tb03-bg: oklch(0.978 0.006 95);
--color-tb03-accent: #111827;
--color-tb03-accent: oklch(0.22 0.02 265);
--color-tb03-on-accent: #f9fafb;
--color-tb03-on-accent: oklch(0.98 0.003 265);
--font-tb03-sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
--ease-tb03-out: cubic-bezier(0.16, 1, 0.3, 1);
}
.tb-03 {
width: 100%;
min-height: 100vh;
min-height: 100svh;
}
@media (prefers-color-scheme: dark) {
.tb-03:not([data-theme="light"]) {
--color-tb03-bg: oklch(0.14 0.004 265);
--color-tb03-accent: oklch(0.96 0.004 95);
--color-tb03-on-accent: oklch(0.16 0.006 265);
}
}
.tb-03[data-theme="dark"] {
--color-tb03-bg: oklch(0.14 0.004 265);
--color-tb03-accent: oklch(0.96 0.004 95);
--color-tb03-on-accent: oklch(0.16 0.006 265);
}
@media (forced-colors: active) {
.tb-03 button {
background: none;
border-color: ButtonText;
color: ButtonText;
}
.tb-03 button:hover {
background: Highlight;
color: HighlightText;
}
}
```How this works
The fill animates background-size, not a layer. That keeps it perfectly clipped to the border radius for free, and Tailwind expresses it in arbitrary length values:
class="bg-no-repeat bg-bottom bg-[length:100%_0%]
hover:bg-[length:100%_100%] focus-visible:bg-[length:100%_100%]"The staggered delay is the detail. The label's colour flips 60ms after the fill starts, so the text is never the same lightness as the rising edge. In v4 that is a per-property delay inside the transition shorthand, which is why this demo writes transition-[…] and [transition-delay:0ms,60ms,0ms] rather than duration-* utilities.
Every hover has its focus-visible twin, written out in full — five pairs on one element. Verbose, and the verbosity is the point: a keyboard user gets the identical animation, and you can see that they do.
Make it yours
- Fill direction is one utility:
bg-leftwipes across,bg-topdrops down. border-2for a bolder editorial ghost; padding is inrem, so the height doesn't shift.border-dashedfor an "add item" placeholder.- Dense UI: swap the
duration-[420ms]forduration-200— the long curve suits marketing pages. rounded-full→rounded-lgfor a squarer, more technical read.
Gotchas — read before shipping
- Ghost buttons fail contrast easily: the label needs 4.5:1 against the page and the 1px border needs 3:1 as a non-text element. A light grey outline on white passes neither.
- Percentage
background-sizeneeds both axes explicit —bg-[length:100%_0%], neverbg-[length:0%], or Safari refuses to interpolate. - Users read ghost buttons as disabled next to a filled primary. Pair them with clear verbs.
- The underscore in
bg-[length:100%_0%]is Tailwind's space escape. A literal space breaks the class name and the utility silently never generates. - Don't switch to a pseudo-element fill and reach for
overflow-hidden— it would clip the focus outline. Thebackground-sizeapproach has no such problem.
Browser support
| Chrome | Safari | Firefox | Edge |
|---|---|---|---|
| 111+ | 16.4+ | 128+ | 111+ |
background-size transitions and currentColor borders are supported everywhere relevant; the floor quoted is Tailwind v4's generated sheet.