Presets

Glow border on hover

A dark panel whose edge lights up in your accent color with a soft outer glow.

CSSTailwindReactGIFMP4
Pro feature The border glows on hover.
00.000 / 0.300s
timing
style

npm i motion · the component uses motion/react

How it works

This card has a barely visible edge at rest. When the pointer moves over it, the edge turns into a crisp 1px line in Glow color and a soft halo of the same color spreads around it. It is popular on dark-themed landing pages for pricing tiers and feature highlights.

Everything is one box-shadow with two layers, transitioned as a whole. At rest: 0 0 0 1px at 8% white for the hairline edge, plus a zero-blur transparent glow. On hover: 0 0 0 1px in Glow color, plus 0 0 Glow size px in Glow color at 45% opacity. Keeping the same number of layers in both states is what lets the browser interpolate the shadow smoothly rather than snapping.

Parameters: Width, Glow color, Card color, Glow size, Corner radius, Duration and Easing. The effect needs a dark Card color and a dark page to look like light; on white backgrounds a glow just looks like a colored blur. Glow size of 16 to 32px is enough. Keep Duration short (0.2 to 0.35s) so the light feels like it reacts to the pointer.

Box-shadow transitions repaint, but only during the short hover change, not continuously, so the cost is small. Remember the glow is decoration: if the card is a link, also give it a :focus-visible style (the same shadow works well) so keyboard users see the highlight.

Can I make the glow pulse while hovered?

Yes. Instead of a transition, add a keyframe that alternates the outer shadow between two blur sizes, and apply it in the hover rule with animation-direction: alternate. Note that a continuously animating box-shadow repaints every frame, so keep it to one or two highlighted cards, not a whole grid.

Why does the resting state include an invisible glow layer?

The browser can only interpolate box-shadow smoothly when both states have the same number of layers. The resting state includes a zero-blur, fully transparent second shadow, so on hover both layers animate together. Without it, the glow would appear instantly instead of fading in.

Does the glow work on a light background?

It works technically, but the effect reads as glowing light only against dark surfaces. On light themes a colored shadow looks like a stain. For light pages, try the Card lift preset instead, or reduce Glow size and use a slightly darker shade of your accent so the halo reads as a soft colored shadow.

relatedMore like this

all hover effects →
01 Image zoom on hover hover
Card title Hover to lift this card.
02 Card lift on hover hover
03 Underline grow link hover
04 Fill sweep button hover
05 Arrow nudge button hover

Export

format
height

480p max · small watermark · 3 per day · remove limits