All styles
Dark UI

Gradient Border CSS Button

Free25 lines · no JS
Open in Studio
Theme

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

States
default
hover
focus-visible
active
disabled
not declared
.btn-gradient-border {
  display: inline-block;
  padding: 12px 26px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: linear-gradient(#0d1017, #0d1017) padding-box, linear-gradient(135deg, #f472b6, #818cf8) border-box;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, box-shadow 0.2s ease;
}
.btn-gradient-border:hover {
  background: linear-gradient(135deg, #f472b6, #818cf8) border-box;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(129, 140, 248, 0.4);
}
.btn-gradient-border:active {
  box-shadow: none;
}
.btn-gradient-border:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
Self-contained · MIT · no build step.btn-gradient-border
Dark UIRoundedBorder FXHover Reveal

Implementation notes

About the Gradient Border CSS button

Gradient Border uses controlled contrast and elevation tuned for dark product surfaces. Its rounded corners balance product-friendly softness with a clear boundary. It is built around a two-stop linear gradient anchored on #0d1017 with a 2px border. The border fx, hover reveal details are included in the copy-paste CSS.

Usage

<button class="btn-gradient-border">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
Rounded
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
Modal81% match

Midnight System Decision Modal

Midnight System kit

Dark UI charactersolid surface
Unlock with Pro →
Free sample
Input81% match

Midnight System Smart Input

Midnight System kit

Dark UI charactersolid surface
Pro preview
Toggle81% match

Midnight System Preference Toggle

Midnight System kit

Dark UI charactersolid surface
Unlock with Pro →
Pro preview
Card81% match

Midnight System Feature Card

Midnight System kit

Dark UI charactersolid surface
Unlock with Pro →
Pro preview
Dropdown81% match

Midnight System Action Menu

Midnight System kit

Dark UI charactersolid surface
Unlock with Pro →
Pro preview
Form81% match

Midnight System Signup Form

Midnight System kit

Dark UI charactersolid surface
Unlock with Pro →
Get the complete Midnight System kit
Six coordinated component types, commercial license and future kit updates.
Explore Pro · $39

More styles that match

Oil Slick

Dark Danger

Dark Gold

Dark Primary Glow

Midnight CTA

Obsidian

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