# Shiny Text

> A narrow glint of light sweeps across the letters every few seconds, like light catching metal.

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

## When to use it

Badges, eyebrow labels, "New" tags and premium plan names, where a glint every few seconds draws the eye.

## How it works

The text clips a gradient three times its width that holds one narrow band of light. Sliding that gradient across the letters is the glint. A rest between sweeps keeps it from feeling busy.

## Installation

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

Or copy `components/motionkit/shiny-text.tsx` below. Requires react, motion 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. |
| `color` | `string` | `"#94A9A7"` | Text colour at rest. |
| `shine` | `string` | `"#F6F1E8"` | Colour of the glint. |
| `duration` | `number` | `1.4` | Seconds for the glint to cross. |
| `interval` | `number` | `2.5` | Seconds of rest between glints. |
| `as` | `ElementType` | `"span"` | Element to render. |

## Accessibility

- **Keyboard: Not applicable.** Text only, nothing to focus.
- **Screen readers: Pass.** Real text, read normally.
- **Reduced motion: Pass.** With reduced motion on, the glint never runs.
- **Colour contrast: Pass.** The resting colour measures 7.7:1 on the dark background; the glint is brighter still.

## Source

```tsx
"use client";

import type { ElementType, ReactNode } from "react";
import { motion, useReducedMotion } from "motion/react";

type ShinyTextProps = {
  children: ReactNode;
  /** The text colour at rest. */
  color?: string;
  /** The colour of the glint. */
  shine?: string;
  /** Seconds for the glint to cross the text. */
  duration?: number;
  /** Seconds of rest between glints. */
  interval?: number;
  /** Element to render, e.g. "span". */
  as?: ElementType;
  className?: string;
};

export function ShinyText({
  children,
  color = "#94A9A7",
  shine = "#F6F1E8",
  duration = 1.4,
  interval = 2.5,
  as: Tag = "span",
  className = "",
}: ShinyTextProps) {
  const reduceMotion = useReducedMotion();

  return (
    <Tag className={className}>
      <motion.span
        // a narrow band of light in a gradient three times the text's width; sliding it across is the glint
        className="bg-clip-text text-transparent [background-size:300%_100%] [-webkit-box-decoration-break:clone] [box-decoration-break:clone]"
        style={{
          backgroundImage: `linear-gradient(105deg, ${color} 42%, ${shine} 50%, ${color} 58%)`,
          backgroundPosition: "100% 0",
        }}
        animate={reduceMotion ? undefined : { backgroundPosition: ["100% 0", "0% 0"] }}
        transition={{ duration, repeat: Infinity, repeatDelay: interval, ease: "easeInOut" }}
      >
        {children}
      </motion.span>
    </Tag>
  );
}
```
