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. Stroke Cover Scroll

Stroke Cover Scroll

PreviousNext

A pinned section where thick outlined strokes draw in until they cover the screen, the message swaps underneath, then the strokes undraw while sparkles spin in.

Open in
stroke-cover-scroll-demo

Every wall gets a second coat

Room 14, before

Peeling plaster, forty staple holes and one stubborn water stain. Hold still, the rollers are out.

Room 14, after

Two coats of Ferrow Vermilion, dry by noon. Same four walls, a completely different light.

Ferrow Paint Works, est. 1987

components/ui/stroke-cover-scroll-demo.tsx
import { StrokeCoverScroll } from "@/registry/tween/stroke-cover-scroll"

export function StrokeCoverScrollDemo() {
  return <StrokeCoverScroll />
}

Installation

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

Usage

import { StrokeCoverScroll } from "@/components/ui/stroke-cover-scroll"
<StrokeCoverScroll
  before={{ title: "Room 14, before", body: "Bare plaster, rollers out." }}
  after={{ title: "Room 14, after", body: "Two coats, dry by noon." }}
  strokeColor="#FF5A36"
/>

How it works

The section pins for pinDistanceFactor viewport heights and a scrubbed timeline drives thirteen diagonal strokes, each drawn twice (a dark outline and a slightly thinner fill) by animating stroke-dashoffset from the path length to 0.

The strokes draw in an interleaved order (outer ones first, then the gaps) with small timing wobbles until the screen is covered. At that moment the first message is swapped for the second, and the strokes undraw in reverse order by pushing the dash offset to -length. Around the swap, three sparkle shapes pop in with a back.out scale and spin, then shrink away.

The trigger uses usePreviewScroller, and a ResizeObserver rebuilds it on resize. With prefers-reduced-motion: reduce the second message is shown without strokes.

Props

PropTypeDefaultDescription
introReactNodedefault copyHeading of the section before the pin.
before{ title, body }default copyMessage shown before the strokes cover the screen.
after{ title, body }default copyMessage revealed when the strokes undraw.
outroReactNodedefault copyHeading of the section after the pin.
strokeColorstring"#FF5A36"Stroke fill color.
outlineColorstring"#16130F"Stroke outline, sparkle outline and text color.
sparkleColorstring"#FFF6E6"Sparkle fill color.
backgroundstringsky → butter gradientCSS background of all three sections.
pinDistanceFactornumber4Pin length in viewport heights.
scrollerHTMLElement | string | null—Optional ScrollTrigger scroller; defaults to the preview one.
classNamestring—Extra classes on the outer container.
Slit Rotate Hero ScrollStroke Rows Scroll

On This Page

InstallationUsageHow it worksProps

Contribute

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