Gradient border

Also called rainbow border, rainbow button, or neon gradient card

A border painted with a multicolor gradient, often flowing slowly along the edge with a matching glow, used to feature one button or card.

What is Gradient border?

A gradient border swaps a solid outline for a band of several colors. The colors can sit still, but they usually flow along the edge in a slow loop, and a blurred copy of the same gradient often sits underneath as a soft colored glow. It marks a featured plan, a new-feature card, or the main call to action.

CSS has no gradient value for border-color, so the usual build uses two layers. An outer wrapper gets the gradient as its background and 1 to 2px of padding, and the inner element covers the middle with the page color and a slightly smaller radius, so only the padding shows. To make the colors flow, slide a gradient strip twice the element’s width with transform, or rotate a conic-gradient behind the element. A single element can also do it with two backgrounds and background-clip: padding-box, border-box.

Use one per screen, and keep the glow faint on light backgrounds, where it can look muddy. Check that the text inside still has strong contrast. Sliding the strip with transform stays cheap; animating background-position repaints every frame. Under prefers-reduced-motion, keep the colors and stop the flow.

Often confused with

Border beam
A border beam is one short streak of light traveling around an otherwise plain edge. A gradient border colors the whole edge, and its colors may flow or stay still.
Glow effect
A glow is soft light around an element, with or without a border. A gradient border is the crisp colored outline itself, sometimes with a glow added underneath.
All terms

Border beam

A short streak of light that travels around the edge of a card or button on a loop, drawing attention to it.

Glow effect

A soft halo of colored light around a button, card, or text, made with colored shadows or a blurred layer behind the element.

Animated gradient

A color gradient that slowly shifts across a surface on a loop, often used behind a hero or call to action to add warmth and motion.

Gradient text

Text filled with a color gradient instead of a solid color, made by painting a gradient background and clipping it to the shape of the letters.

Build it with Layerwise

Describe your app, watch it run in a live preview, and publish it with a database, storage, and sign-in built in.