Scroll Animation

Scroll tools for long pages: SmoothScroll wraps Lenis and shares position, progress and velocity, while ScrollProgress, Parallax, ScrollTo and ScrollReveal add a reading meter, depth, anchor jumps and entrance effects. Each falls back to native behaviour under reduced motion.

Smooth Scroll

smooth-scroll.tsx

Wraps the page or a contained scroller in Lenis and hands out scrollY, progress and velocity motion values plus a scrollTo helper through useSmoothScroll; with reduced motion it keeps native scrolling.

Scroll Animation Smooth Scroll preview width

Install

$ bunx --bun shadcn add @karaui/smooth-scroll
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

root?
boolean

Drive the page (window) when true, or a contained scroll area when false.

true
lerp?
number

Smoothing factor; lower is smoother and heavier.

0.1
duration?
number

Wheel / programmatic ease duration in seconds.

1.2
orientation?
"horizontal" | "vertical"
vertical
wheelMultiplier?
number

Wheel scroll speed multiplier.

1
touch?
boolean

Smooth touch scrolling. Off by default — native momentum is good on mobile.

false
className?
string
—

Scroll Progress

scroll-progress.tsx

Shows how far through a page the reader is, as a thin bar pinned to the top or bottom or as a circular ring, optionally spring-smoothed and fed by any progress value you pass in.

Scroll Animation Scroll Progress preview width

Install

$ bunx --bun shadcn add @karaui/scroll-progress

API Reference

variant?
"circle" | "bar"
—
position?
"bottom" | "top"
—
height?
number

Bar thickness in px.

—
fixed?
boolean

Position the bar with `fixed` (page) or `absolute` (embedded).

—
progress?
MotionValue<number>

Override the scroll source. Defaults to the page via useSmoothScroll.

—
spring?
boolean

Spring-smooth the value. Disabled automatically under reduced motion.

—
className?
string
—
size?
number

Diameter in px.

—
thickness?
number

Stroke width in px.

—

Parallax

parallax.tsx

Moves its content faster or slower than the page as it passes through view, along x or y; a negative speed pushes it the other way, and it can track a custom scroll container.

Scroll Animation Parallax preview width

Install

$ bunx --bun shadcn add @karaui/parallax

API Reference

speed?
number

Drift as a fraction of the element's travel through the viewport. Positive moves with the scroll (foreground), negative against it (background). ~0.1–0.5 reads best.

0.3
axis?
"x" | "y"
y
container?
RefObject<HTMLElement | null>

Scroll container for contained scroll areas. Defaults to the viewport.

—
spring?
boolean

Spring-smooth the drift. Disabled automatically under reduced motion.

true
className?
string
—

Scroll To

scroll-to.tsx

A button that glides the page to a pixel position, CSS selector or element, with an offset for sticky headers; it uses the SmoothScroll provider when present and native scrolling otherwise.

Scroll Animation Scroll To preview width

Install

$ bunx --bun shadcn add @karaui/scroll-to

API Reference

to
ScrollTarget

Where to scroll: px offset, selector string or element.

—
offset?
number

Extra px offset from the target (e.g. to clear a sticky header).

—
duration?
number

Override the ease duration in seconds.

—
className?
string
—

Scroll Reveal

scroll-reveal.tsx

Fades content up into place through a short blur as it enters the viewport or a custom scroll root, once by default or every time, with distance, duration and visibility threshold props.

Scroll Animation Scroll Reveal preview width

Install

$ bunx --bun shadcn add @karaui/scroll-reveal

API Reference

y?
number

Slide distance in px before reveal.

16
blur?
number

Enter blur in px (kept ≤ 10 per motion conventions).

8
duration?
number

Reveal duration in seconds.

0.6
delay?
number
0
once?
boolean

Reveal only once (default) or every time it enters view.

true
amount?
number | "all" | "some"

Portion of the element that must be visible to trigger.

0.3
root?
RefObject<Element | null>

Scroll root for contained scroll areas. Defaults to the viewport.

—
className?
string
—

Updated