tween
ComponentsTemplatesShowcaseContact

Command Palette

Search for a command to run...

Getting Started
  • Introduction
  • Installation
  • StoryNew
Guides
  • Motion Principles
  • Scroll and Smooth Scroll
  • Performance and Accessibility
Scroll Animations
  • Sticky Cards Scroll
  • Rise Fan Cards Scroll
  • Rotate Stack Scroll
  • Doodle Lens ScrollNew
  • Slit Open Hero ScrollNew
  • Logo Mask Zoom ScrollNew
  • ASCII Dissolve ScrollNew
  • Lottie Flight ScrollNew
  • Inline Icon Text ScrollNew
  • Starfield ScrollNew
  • Name Swap ScrollNew
  • Spotlight Gallery HeroNew
  • Slit Rotate Hero ScrollNew
  • Stroke Cover ScrollNew
  • Stroke Rows ScrollNew
Text Animations
  • Text Skew Reveal
  • Block Text Reveal
Hover & Cursor
  • Image Trail Cursor
  • Cursor Depth Logo
  • Physics Tag Drop
  • Elastic Card ListNew
  • Magnetic Cards SpringNew
Sliders & Carousels
  • Wheel Fullscreen Carousel
  • Ripple Displacement Slider
  • Three.js Blend Slider
  • Stacked Deck Slider
  • Orbit Cylinder SliderNew
  • Fan Stack SliderNew
  • Exponential Strip SliderNew
  • Dual Column SliderNew
Galleries & Grids
  • Scroll Wave Gallery
Menus & Navigation
  • Shrink Page MenuNew
Preloaders & Intros
  • Floating Items RevealNew
  • Word Cycle RevealNew
  • Tile Grid LoaderNew
Page Transitions
  • Panel Assembly TransitionNew
3D & WebGL
  • Fractal Glass Hero
  • Fluid Cursor Canvas
  • Fluid Portrait Hero
  • Fluid Gradient Canvas
  • Inversion Lens HoverNew
UI Elements
  • Circular Widgets
  • Vinyl Cover
  • Image Explosion Footer
  • Accordion Image FramesNew

(Tween) — Motion registry

Animated components & full sites, one command away.

Product

  • Components
  • Templates
  • Installation
  • Guides
  • Blog
  • Contact

Categories

  • Scroll Animations
  • Text Animations
  • Hover & Cursor
  • Sliders & Carousels
  • Galleries & Grids
  • Menus & Navigation
  • Preloaders & Intros
  • Page Transitions
  • 3D & WebGL
  • UI Elements
TWEEN
ease: power2.inOut0.00s
© 2026 TweenBack to topBuilt by mohammad
  1. Docs/
  2. Components/
  3. Starfield Scroll

Starfield Scroll

PreviousNext

A pinned canvas starfield whose radial color streaks accelerate with scroll while three headers scrub in and out word by word.

Open in
starfield-scroll-demo

Engines Hot

Past the last satellite

Into the quiet between stars

Until the far light arrives

Touchdown

components/ui/starfield-scroll-demo.tsx
import { StarfieldScroll } from "@/registry/tween/starfield-scroll"

export function StarfieldScrollDemo() {
  return <StarfieldScroll />
}

Installation

pnpm dlx shadcn@latest add https://tweenui.dev/r/starfield-scroll.json

Usage

import { StarfieldScroll } from "@/components/ui/starfield-scroll"
<StarfieldScroll
  intro="Engines Hot"
  headers={["Clear the pad", "Into the dark", "Hold the line"]}
  outro="Touchdown"
/>

How it works

The starfield section pins for pinDistanceFactor viewport heights. Each star is a radial streak with a random direction, length, width and weighted palette color, drawn on a 2D canvas as a gradient line from a central hole outwards. The scroll progress raises a "fill" value that sets the travel speed, so streaks rush outward faster the further you scroll and fade in softly near the center.

A single scrubbed timeline, split into words with SplitText, fades the first header out word by word while it scales up, brings the second in and out, then settles on the third. The trigger uses usePreviewScroller and a ResizeObserver rebuilds it on resize. With prefers-reduced-motion: reduce only the final header is shown over a static field.

Props

PropTypeDefaultDescription
introReactNode"Engines Hot"Heading of the section before the pin.
headers[string, string, string]default copyThe three headers that scrub over the starfield.
outroReactNode"Touchdown"Heading of the section after the pin.
starCountnumber1000Number of streaks.
palettestring[]ice → amberHex colors for streaks.
paletteWeightsnumber[]weightedProbability weight of each palette color.
pinDistanceFactornumber5Pin length in viewport heights.
backgroundstring"#0f0f0f"Section background.
scrollerHTMLElement | string | null—Optional ScrollTrigger scroller; defaults to the preview one.
classNamestring—Extra classes on the outer container.
Inline Icon Text ScrollName Swap Scroll

On This Page

InstallationUsageHow it worksProps

Contribute

  • Report an issue
  • Request a feature
  • Edit this page