# Halo Text

> Crisp letters lit from behind by a soft, slowly flowing glow of colour, the way a new AI feature or a launch headline glows.

Category: Text · Free · Updated 2026-11-10 · Live demo: https://www.motionkitui.com/components/halo-text

## When to use it

AI feature launches, product announcements, keynote-style headlines and calls to action that should feel new.

## How it works

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.

## Installation

```bash
npx shadcn@latest add https://www.motionkitui.com/r/halo-text.json
```

Or copy `components/motionkit/halo-text.tsx` below. Requires react and Tailwind CSS v4. Free for personal projects; commercial use needs MotionKit Plus (https://www.motionkitui.com/pricing).

## Props

| 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. |

## Accessibility

- **Keyboard: Not applicable.** Text, not a control.
- **Screen readers: Pass.** The glow layers are hidden copies; your text is read once.
- **Reduced motion: Pass.** With reduced motion on, the colours stop flowing and the glow stays still.
- **Colour contrast: Pass.** The letters themselves stay solid: white on the site's dark measures 19:1, and the glow sits behind them.

## Source

```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>
  );
}
```
