Getting Started
Scroll Animations
Text Animations
Hover & Cursor
Sliders & Carousels
Galleries & Grids
Menus & Navigation
Preloaders & Intros
Page Transitions
3D & WebGL
import { LottieFlightScroll } from "@/registry/tween/lottie-flight-scroll"
export function LottieFlightScrollDemo() {
return <LottieFlightScroll />
}
import { LottieFlightScroll } from "@/components/ui/lottie-flight-scroll"<LottieFlightScroll
lottiePath="/bee.json"
items={[
{ image: "/harvest/orchard.jpg", title: "Orchard Blossom" },
{ image: "/harvest/lavender.jpg", title: "Lavender Row" },
]}
background="#f5c63c"
/>A sticky overlay the height of the viewport sits above the page. It holds two copies of the same looping Lottie: the character and a shadow (brightness(0), blurred, half opacity). A scrubbed ScrollTrigger maps the gallery section from top top to bottom bottom onto a 0 to 1 flight progress:
sin(drop × π) rises, so the character seems highest mid-flight.Sizes come from the overlay, not the window, so the flight fits the preview. The trigger is rebuilt when the scroller resizes. With prefers-reduced-motion: reduce the Lottie does not play and the character rests mid-path.
| Prop | Type | Default | Description |
|---|---|---|---|
lottiePath | string | "/lottie-flight-scroll/bee.json" | Looping Lottie JSON (svg renderer). |
items | LottieFlightItem[] | 6 remote items | Gallery items { image, title, index? }. |
introTitle | ReactNode | default copy | Heading before the gallery. |
outroTitle | ReactNode | default copy | Heading after the gallery. |
size | number | 125 | Character size in px. |
shadowSize | number | 115 | Shadow size in px. |
background | string | "#f5c63c" | Page background. |
foreground | string | "#1c1406" | Text color. |
fontFamily | string | DM Sans stack | Font for all text. |
scroller | HTMLElement | string | null | — | Optional ScrollTrigger scroller. |