04.30 · Micro-Interactions
Animated Gradient Border
A band of colors runs around the edge of a card or button. Best for featured offers.
Watch it
It moves by itself. Pause it to look closely, or turn on slow motion to see each part of the movement.
Most popular
Pro
$12 / month
- Unlimited projects
- Priority support
Inside, the colors are a big square turning behind the button: the button's shape cuts it out, and a dark box covers all but the edge.
Plain border: the edge is a still, faint line. Running colors: a band of colors keeps traveling around the same edge.
Try it
Change a setting and see the difference as it moves.
Colors
The colors that travel around the edge.
Speed
How long one trip around the edge takes.
A blurred halo of the same colors around it.
Copy the prompt
Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.
Add an animated gradient border to [the card or button you want to stand out]. Give it an edge where a band of colors keeps running around it; wherever the band does not reach, the edge stays a faint line. Build it from a square layer, twice as wide as the element, filled with a gradient that sweeps around its center, clipped to the element's rounded shape and covered by an inner box everywhere but the edge. Turn that layer and never animate the gradient itself, so the browser only rotates a finished picture. For a glow, put a blurred copy of the same layer behind it. If the visitor has reduced motion turned on, keep the border still. Match the settings listed below.
Your settings
Replace the words in brackets with your own element. Your settings are added at the end.
Free and open source. If this helped, a star on GitHub helps other people find it.
Star on GitHubWhat it is
The full explanation is in README.md.