Hero Vibe Check
A large illustrative hero SVG that animates the "vibe check" motif as a star constellation: fifteen main stars in three rows reveal a hidden network of seventeen connection edges. The edges draw in one by one, the pattern glows, a ripple sweeps through the stars, the network breathes, then the whole sky fades back to a quiet dim state before the cycle repeats. Theme-driven via currentColor + a single accentColor prop; reduced-motion users see a static revealed frame.
Customize
Hero illustration
400px
accent
false
Installation
npx shadcn@latest add https://craftbits.dev/r/hero-vibe-check.jsonUsage
import { HeroVibeCheck } from "@craft-bits/core/svg/hero-vibe-check";
<HeroVibeCheck size={400} />
// Tint via the parent text color.
<div className="text-cb-accent">
<HeroVibeCheck />
</div>Understanding the component
- Continuous storyboard. A single
useEffectschedules the full ~10s cycle: 30 dim background stars twinkle indefinitely; 15 main stars fade in with a gentle stagger; 17 connection lines draw in via pathLength springs; a soft radial glow centred on the network brightens; the stars brighten and grow; a wave ripples through the constellation; the connection opacities pulse to make the network breathe; everything fades back to a dim state. Every timer is cleaned up on unmount and when reduced-motion changes. - Motion values, not re-renders. Star opacity, star scale, edge pathLength, edge opacity, and network-glow opacity are all driven by
useMotionValue+useSpring, so the React tree never re-renders during the loop. Springs come from@craft-bits/core/motion—SPRINGS.dampedfor star opacities and the glow,SPRINGS.slowfor edge draws,SPRINGS.bouncyfor star scales. - Theme-driven color. The bright star cores and bodies use
currentColor, so the host tints the structural chrome with anytext-cb-*utility. TheaccentColorprop colors the connection lines, halo, and network glow — any CSS color (includingvar(--color-accent-500)). The dim background twinkle and the caption usevar(--cb-fg-muted). - Reduced-motion safe. When
prefers-reduced-motion: reduceis set, or thepausedprop istrue, the loop short-circuits to a single static revealed frame: all stars lit and grown, all edges drawn, network glow on. - Hydration-safe. Background star positions are computed deterministically from each star's index, so server and client renders agree.
Variants / Examples
// Paused — useful for thumbnails / OG images.
<HeroVibeCheck paused />
// Compact thumbnail.
<HeroVibeCheck size={200} />
// Explicit accent color.
<HeroVibeCheck size={480} accentColor="var(--color-accent-300)" />
// Custom hex.
<HeroVibeCheck accentColor="#8b5cf6" />Props
| Prop | Type | Default | Description |
|---|---|---|---|
size | number | 400 | Pixel width. Height is computed from the 400×280 aspect ratio. |
accentColor | string | 'currentColor' | Any CSS color. Tints the connection lines, halo, and network glow. |
paused | boolean | false | When true, render a single static revealed frame instead of looping. |
className | string | — | Extra classes merged onto the root SVG. |
...rest | SVGAttributes<SVGSVGElement> | — | Other SVG props forwarded to the root. |
Accessibility
- The root SVG carries
aria-hidden="true"— the illustration is decorative; pair it with a visible heading or caption in its surrounding context. - Motion respects
prefers-reduced-motion: reduce: the loop short-circuits and renders a static revealed frame. - All colors flow from
currentColor+ theaccentColorprop, so contrast tracks the consumer's text and accent tokens — no hardcoded hex values.
Credits
- Extracted from:
craftingattention(app/src/lessons/primitives/chrome/icons/heroes/HeroVibeCheck.tsx). - Inspiration: classical constellation diagrams — "the hidden pattern reveals itself".