All styles
Minimal

Hairline CSS Button

Free42 lines · no JS
Open in Studio
Theme

A real <button> carrying .btn-hairline — the preview is the stylesheet, not a picture of it.

States
default
hover
focus-visible
active
disabled
not declared
.btn-hairline {
  position: relative;
  display: inline-block;
  padding: 10px 4px 12px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #d1d5db;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.25s ease;
}
.btn-hairline::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 44%;
  height: 1px;
  background: #6b7280;
  transform: translateX(-50%);
  transition: width 0.3s ease, background 0.3s ease;
}
.btn-hairline:hover {
  color: #ffffff;
}
.btn-hairline:hover::after {
  width: 100%;
  background: #e5e7eb;
}
.btn-hairline:active {
  color: #d1d5db;
}
.btn-hairline:active::after {
  background: #9ca3af;
}
.btn-hairline:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
Self-contained · MIT · no build step.btn-hairline
MinimalSquareHover Reveal

Implementation notes

About the Hairline CSS button

Hairline uses restrained decoration that keeps the surrounding content in focus. Its square geometry creates a compact, precise control. The hover reveal details are included in the copy-paste CSS.

Usage

<button class="btn-hairline">Button</button>

Pair it with the CSS tab above — the class is self-contained.

Before shipping: keep the semantic button element, verify contrast on your actual background and add a visible:focus-visible state. If you retain motion, include a prefers-reduced-motion override.
Built with
HTML + plain CSS
Shape
Square
Exports
CSS, Tailwind, React
License
MIT · commercial use
Complete the look

Build the interface around this button

We matched its palette, surface, geometry and motion to a complete UI system — like composing an outfit, not browsing unrelated parts.

Style DNA · v1
How matching works →
Pro preview
Modal83% match

Quiet Paper Decision Modal

Quiet Paper kit

Minimal characterneutral palette
Unlock with Pro →
Free sample
Input83% match

Quiet Paper Smart Input

Quiet Paper kit

Minimal characterneutral palette
Pro preview
Toggle83% match

Quiet Paper Preference Toggle

Quiet Paper kit

Minimal characterneutral palette
Unlock with Pro →
Pro preview
Card83% match

Quiet Paper Feature Card

Quiet Paper kit

Minimal characterneutral palette
Unlock with Pro →
Pro preview
Dropdown83% match

Quiet Paper Action Menu

Quiet Paper kit

Minimal characterneutral palette
Unlock with Pro →
Pro preview
Form83% match

Quiet Paper Signup Form

Quiet Paper kit

Minimal characterneutral palette
Unlock with Pro →
Get the complete Quiet Paper kit
Six coordinated component types, commercial license and future kit updates.
Explore Pro · $39

More styles that match

Framed Air

Quiet Type

Strike Reveal

Ink Fade

Under Score

Wave Line

Two optional extras load only if you allow them. Every button, preview and line of code works exactly the same either way. What each one does