MenuClose

Chromatic Text — React Text Effect

The pointer is the prism: letters near the cursor split into red and blue fringes while the rainbow underneath slides with it.

View source
PreviewReact
Starting live preview

Usage

import { ChromaticText } from "@/components/ChromaticText";

export function Headline() {
  return <h1><ChromaticText text="Split the light." separation={5}
    {...{
      text: "Split the light.",
      separation: 5,
      spectrum: 280
    }}
  /></h1>;
}
Implementation notes & API

Accepts text, separation, spread, spectrum, disabled, className and style. Wrap in a heading for heading semantics. The words stay plain, selectable text for assistive technology; reduced motion gets still text. No GPU dependency.

PropertyTypeNotes / default
childrenReactNodeYour own content; the default is a demonstration
disabledbooleanfalse; motion also respects system preferences
className / stylestring / CSSPropertiesApplied to the outer container
View source on GitHubFree for commercial projects · MIT