Pools of colour swirl and flow inside the letters, for headings that feel alive without moving an inch.
Crisp letters lit from behind by a soft, slowly flowing glow of colour, the way a new AI feature or a launch headline glows.
Customize
Usage
import { HaloText } from "@/components/motionkit/halo-text";
<HaloText as="h1" className="text-7xl font-semibold tracking-tight">
Intelligence
</HaloText>Motion
The exact curves this component runs, plotted with Motion's own maths.
Glow flows
Runs on its own
AI feature launches, product announcements, keynote-style headlines and calls to action that should feel new.
Two hidden copies of your text sit exactly behind it. Both are filled with a wide gradient of your colours using background-clip: text, and one is blurred heavily for the soft halo while the other is blurred only slightly to keep colour close to the letter edges. A keyframe slides the gradient along so the colours flow round the word. The real text sits on top in a solid colour, so it stays crisp, selectable and read once by screen readers.
Works in the App Router as is. Requires Tailwind CSS v4.
One command adds the file and installs its dependencies. Needs a components.json (run npx shadcn@latest init once if you don't have one).
npx shadcn@latest add https://www.motionkitui.com/r/halo-text.jsonnpm install motionSave as components/motionkit/halo-text.tsx.
"use client";
import type { CSSProperties, ElementType, ReactNode } from "react";
type HaloTextProps = {
children: ReactNode;
/** Colours that flow through the glow. */
colors?: string[];
/** Seconds for the colours to travel once round the letters. */
duration?: number;
/** How far the glow spreads, in px. */
spread?: number;
/** Strength of the glow, 0 to 1. */
intensity?: number;
/** Colour of the letters in front. */
color?: string;
/** The element to render, e.g. "h1". */
as?: ElementType;
className?: string;
};
/**
* Crisp letters lit from behind by a soft, slowly moving glow of colour, the way a new AI feature or a launch
* headline glows. The glow is a blurred copy of the same text, so it hugs every letter.
*/
export function HaloText({
children,
colors = ["#7AA8FF", "#B57BFF", "#FF7AB6", "#FFB86B", "#5FE0C8"],
duration = 6,
spread = 14,
intensity = 0.85,
color = "#FFFFFF",
as: Tag = "span",
className = "",
}: HaloTextProps) {
const loop = [...colors, colors[0]].join(", ");
const glow: CSSProperties = {
backgroundImage: `linear-gradient(90deg, ${loop})`,
backgroundSize: "200% 100%",
WebkitBackgroundClip: "text",
backgroundClip: "text",
color: "transparent",
filter: `blur(${spread}px) saturate(1.3)`,
opacity: intensity,
animation: `halo-flow ${duration}s linear infinite`,
};
// a second, tighter glow keeps colour close to the edges of the letters
const rim: CSSProperties = { ...glow, filter: `blur(${Math.max(1, spread / 5)}px) saturate(1.4)`, opacity: intensity * 0.75 };
return (
<Tag className={`relative inline-block isolate ${className}`}>
<style>{"@keyframes halo-flow{to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){[data-halo]{animation:none!important}}"}</style>
<span aria-hidden data-halo="" className="pointer-events-none absolute inset-0 -z-10 select-none" style={glow}>
{children}
</span>
<span aria-hidden data-halo="" className="pointer-events-none absolute inset-0 -z-10 select-none" style={rim}>
{children}
</span>
<span style={{ color }}>{children}</span>
</Tag>
);
}
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | The text. |
| colors | string[] | blue, violet, pink, amber, mint | Colours that flow through the glow. |
| spread | number | 14 | How far the glow spreads, in px. |
| intensity | number | 0.85 | Strength of the glow, 0 to 1. |
| duration | number | 6 | Seconds for the colours to travel once round. |
| color | string | "#FFFFFF" | Colour of the letters in front. |
| as | ElementType | "span" | Element to render, e.g. h1. |
How we audit: the WCAG 2.2 animation checklist and respecting reduced motion in React.
Yes. The file starts with "use client", so you can import it straight into a Server Component page or layout. It works in Vite as is, and in Astro as a React island.
Nothing beyond React and Tailwind CSS v4. There is no MotionKit package and no Tailwind config to add.
Yes. Run npx shadcn@latest add https://www.motionkitui.com/r/halo-text.json in any project with a components.json. It saves the file to components/motionkit and installs its dependencies.
With reduced motion on, the colours stop flowing and the glow stays still.
Pools of colour swirl and flow inside the letters, for headings that feel alive without moving an inch.
A headline cut into bands like a sliced print: hover and the bands slide apart in alternate directions, revealing the word in a second colour through the cut.
A headline that resolves like an image loading: it arrives as a few big blocks of colour, and each step halves the pixels until the letters snap sharp.
Intelligence