Command Palette

Search for a command to run...

0GitHub stars
Components

Reactive gradient character

An expressive metallic-gradient character stage with 9-second kinetic typography, depth-of-field camera pans, blinking eye choreography, and zero-rerender cursor tracking.

Loading…
Dependencies (1)

Overview and background

Reactive gradient character combines procedural vector character animation with continuous kinetic typography and physics-based cursor reactivity. Designed as a brand centerpiece, hero mascot, or conversational avatar, the component orchestrates a 9-second looped sequence featuring multi-plane depth-of-field camera pans, atmospheric vignetting, and synchronized kinetic phrasing ("HELLO", "HOW", "ARE", "YOU"). The character's chrome metallic head and torso spheres respond seamlessly to pointer movement through critically damped springs that run completely outside the React render loop. Integrated eye choreography includes natural multi-frame blinks, gaze redirection, and interactive click-to-nod physical responses, creating a lifelike presence while maintaining strict 60fps performance on high-density displays.

Features

  • Multi-plane kinetic typography with depth-of-field blur sweeps and 3D layering behind and in front of the character sphere.
  • Zero-rerender spring-driven eye tracking and head parallax calculated via motion values and hardware-accelerated transforms.
  • 9-second procedural camera choreo timeline with rack-focus transitions, atmospheric ambient glows, and customizable phrase strings.
  • 5 pre-calibrated metallic lighting palettes (crimson, midnight, emerald, violet, and obsidian) with rim specular highlights.
  • Interactive click-to-blink triggers with tactile nod physics and immediate keyboard trigger navigation.
  • Comprehensive accessibility support including aria-live phonetic word announcements and reduced-motion static poses.

Use cases

  • Hero section visual focal point: Anchor landing pages with an expressive brand mascot that greets prospective users immediately upon arrival.
  • Conversational and AI agents: Serve as a visual avatar for intelligent support bots, conversational copilots, and voice interfaces.
  • Interactive onboarding and error states: Delight users during interactive tour steps, auth welcome screens, or whimsical 404 recovery flows.
  • Agency and creator showcase stages: Highlight dynamic art direction and interactive frontend engineering excellence on portfolio homepages.

Installation

pnpm dlx shadcn@latest add @abushaidislam/reactive-gradient-character

Usage

import ReactiveGradientCharacter from "@/components/reactive-gradient-character"
<ReactiveGradientCharacter
  phrases="HELLO, HOW, ARE, YOU"
  palette="crimson"
  autoPlay={true}
  interactive={true}
  speed={1}
/>

Composition

ReactiveGradientCharacter (Stage Container)
├── Screen Reader Live Region (sr-only aria-live="polite")
├── Layer 0: Ambient Aura (Radial glow with character x-pan)
├── Layer 1: Back Z-Plane Typography (Words 0 & 3 behind head sphere)
├── Layer 2: Metallic Character Stage (SVG)
│   ├── Torso & Shoulders Sphere (Metallic gradient + rim glow filter)
│   └── Head Sphere & Eyes Group
│       ├── Head Base Sphere (Multi-stop gradient + rim stroke)
│       └── Pointer-Reactive Eye Assembly
│           └── Kinetic Eye Pupils (Choreographed scaleY blinks & gaze offsets)
├── Layer 3: Front Z-Plane Typography (Words 1 & 2 in foreground)
├── Layer 4: Entrance & Exit Fade Shutter (Atmospheric dimming)
└── Layer 5: Specular Inner Border Vignette

API reference

ReactiveGradientCharacter

PropTypeDefaultDescription
phrasesstring | string[]"HELLO, HOW, ARE, YOU"Comma-separated string or array of up to 4 uppercase words for kinetic choreography.
palette"crimson" | "midnight" | "emerald" | "violet" | "obsidian""crimson"Color atmosphere for background radial fill, ambient glow, and metallic rim lighting.
autoPlaybooleantrueRuns continuous 9-second kinetic camera and typographic choreography timeline.
interactivebooleantrueEnables pointer eye-tracking, head parallax springs, and click-to-blink/jump triggers.
speednumber1Timeline playback rate multiplier bounded between 0.5 and 2.0.
ariaLabelstring"Reactive gradient character animation"Accessible label describing the interactive character stage.

Accessibility

  • Screen reader announcements: An invisible aria-live="polite" element announces each typographic word sequentially as it achieves focus on stage.
  • Keyboard navigation: When interactive is enabled, the container receives tabIndex={0} and triggers eye-blinks and nod beats on Enter or Space.
  • Reduced motion support: Fully honors prefers-reduced-motion media queries by freezing the choreography into a balanced, static centered pose with neutral eye alignment and zero animation loops.

Frequently asked questions

How does pointer tracking remain smooth without causing re-renders?

All pointer tracking coordinates are bound to Framer/Motion useMotionValue and useSpring instances. Their updates bypass React state cycles completely and write directly to DOM element transforms via GPU composite layers (translate3d), guaranteeing consistent 60fps performance even on complex pages.

Can custom phrases longer than four words be supplied?

The kinetic sequence is specifically timed across four choreographic measures (HELLO, HOW, ARE, YOU). Supplying fewer words will backfill defaults, while additional words beyond four are gracefully truncated to preserve cinematic pacing.

How do I embed the character within responsive cards or hero containers?

The component uses container query units (cqi) and an aspect ratio of 4/5. Constrain it with any max-width class such as max-w-[360px] or max-w-[420px], and both typography scales and vector geometry will adapt automatically.

License and usage

  • Free to use and modify in both personal and commercial projects.
  • Attribution is appreciated but not required.
  • Released under the MIT License.

Was this helpful?

Command Palette

Search for a command to run...