Glow Card React component
A card with an animated rotating conic-gradient glow border, customizable colors, text position, and an optional background image.
About the Glow Card component
Glow Card is a free card with a rainbow glow that circles its inner edge: a conic gradient rotates around a ring that follows the corner radius, blurred into a soft light, with a line of text placed anywhere in a 3 by 3 grid. It uses only CSS (an animated @property angle), so there is no animation library.
colors sets the gradient stops (seven by default, from pink through orange, yellow, green and blue to purple), duration the seconds per rotation (default 6), and glowWidth and glowBlur the size and softness of the ring. A backgroundImage can sit under the glow, darkened by backgroundColor at overlayOpacity; it is decorative with an empty alt. The rotation pauses while the card is scrolled out of view.
When to use it
Use it for announcement tiles, a highlighted feature or pricing card, AI or launch callouts, and short quotes that need to stand out on a dark page.
For a glow that follows the cursor with a 3D tilt, use Glare Card.
Installation
Add the Glow Card component to your project with the shadcn CLI. It lands in components/glow-card.tsx as plain React + Tailwind CSS source you own and can edit.
npx shadcn@latest add @reactframe/glow-cardOr copy the source by hand and install its dependencies:
npm install clsx tailwind-mergeProps
<GlowCard /> accepts 14 props, all optional.
| Prop | Type | Default |
|---|---|---|
| text | string | "I'm a card with an inner glow" |
| fontSize | number | 28 |
| textColor | string | "#F5F5F7" |
| textPosition | "top-left" | "top-center" | "top-right" | "center-left" | "center" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right" | "center" |
| backgroundImage | string | — |
| backgroundColor | string | "#1C1C1E" |
| overlayOpacity | number | 0.55 |
| colors | string[] | DEFAULT_COLORS |
| radius | number | 24 |
| padding | number | 32 |
| glowWidth | number | 28 |
| glowBlur | number | 20 |
- textstringDefault: "I'm a card with an inner glow"
- fontSizenumberDefault: 28
- textColorstringDefault: "#F5F5F7"
- textPosition"top-left" | "top-center" | "top-right" | "center-left" | "center" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right"Default: "center"
- backgroundImagestring
- backgroundColorstringDefault: "#1C1C1E"
- overlayOpacitynumberDefault: 0.55
- colorsstring[]Default: DEFAULT_COLORS
- radiusnumberDefault: 24
- paddingnumberDefault: 32
- glowWidthnumberDefault: 28
- glowBlurnumberDefault: 20
Show all 14 propsShow fewer
| duration | number | 6 |
| className | string | — |
- durationnumberDefault: 6
- classNamestring
npm dependencies
Installed for you by the shadcn CLI.
Glow Card FAQ
- How do I use my brand colors for the glow?
- Pass colors as an array of CSS colors, for example colors={["#6366f1", "#22d3ee"]}; the first color is repeated at the end so the loop has no seam.
- How do I place the text?
- Set textPosition to one of top-left, top-center, top-right, center-left, center, center-right, bottom-left, bottom-center or bottom-right (default center). fontSize and textColor style it.
- How do I slow the glow down?
- Raise duration, the length of one full rotation in seconds (default 6).
- Does it keep animating off screen?
- No. An IntersectionObserver pauses the CSS animation while the card isn't visible.