★ GitHub

ScrollReveal

Animate elements as they enter the viewport using IntersectionObserver.

Usage

Wrap any component in ScrollReveal to trigger a CSS animation when it becomes visible.

Slide Up
Slide In Left (Delayed)
Scale (Delayed)
tsx
import { ScrollReveal, Card } from "starkit-ui"; <ScrollReveal animation="slide-up" delay={150}> <Card>Revealed Content</Card> </ScrollReveal>

Props

PropTypeDefaultDescription
animation'fade' | 'slide-up' | 'slide-in-left' | 'slide-in-right' | 'scale''slide-up'The animation to apply.
delaynumber0Delay in ms.
thresholdnumber0.1How much of the element needs to be visible to trigger.
repeatbooleanfalseAnimate out when scrolled past, to animate in again.