# Flux — Animated Text Effect for React

> A word slot that cycles by melting — the outgoing word sags through a bright white heat-blur while the incoming word solidifies from the same blur, with a hairline neutral underline that stretches to each new width like drawn wire.

- Page: https://crucibleui.com/components/text/flux
- Category: [text](https://crucibleui.com/components/text)
- Tier: pro (one-time purchase, see https://crucibleui.com/pricing)
- Engine: motion
- npm dependencies: motion

## Install

```bash
npx shadcn@latest add @crucible/flux
```

Pro install requires adding the token-bearing `@crucible` registry to components.json (issued at https://crucibleui.com/account after purchase).

Import from `@/components/crucible/flux`.

## Props (`FluxProps`)

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `words?` | `string[]` | — | Words or short phrases to cycle through. |
| `interval?` | `number` | `2600` | Milliseconds each word holds before smelting into the next. |
| `transitionDuration?` | `number` | `0.7` | Seconds the melt/solidify crossfade takes. |
| `loop?` | `boolean` | `true` | Restart from the first word after the last. |
| `paused?` | `boolean` | `false` | Freeze cycling on the current word. |
| `onIndexChange?` | `(index: number) => void` | — | Fired whenever a new word becomes current. |
| `heatColor?` | `string` | `soft white` | Halo the outgoing/incoming glyphs glow with mid-transition. |
| `underlineColor?` | `string` | `neutral-400` | Hairline underline color. |

Also accepts: `Omit<React.ComponentPropsWithoutRef<"span">, "children">`.

## Usage example

```tsx
import { Flux } from "@/components/crucible/flux";

export default function FluxDemo() {
  return (
    <div className="relative isolate flex h-full min-h-[360px] w-full items-center justify-center overflow-hidden rounded-xl bg-neutral-950">
      <div
        aria-hidden
        className="pointer-events-none absolute inset-0 bg-[radial-gradient(ellipse_at_center,rgba(255,255,255,0.035),transparent_70%)]"
      />
      <div className="relative z-10 max-w-xl px-6 text-center">
        <h2 className="text-4xl font-semibold tracking-tight text-white">
          Watch this word <Flux words={["change", "morph", "shift", "flow"]} /> on its own
        </h2>
        <p className="mt-4 text-sm text-neutral-500">
          Each word blurs out; the next sharpens in its place.
        </p>
        <div className="mt-8 flex flex-col items-center gap-2">
          <span className="text-xl font-medium text-neutral-200">
            <Flux
              words={["one", "after", "another"]}
              interval={2000}
              heatColor="#f0abfc"
              underlineColor="#a855f7"
            />
          </span>
          <span className="text-[10px] font-medium uppercase tracking-[0.2em] text-neutral-600">
            Custom colors
          </span>
        </div>
      </div>
    </div>
  );
}
```

## Accessibility & performance

Honors `prefers-reduced-motion` with a designed static frame or fade (never a blank box) and passes `className` through.
