Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Scroll Animation

Parallax

Parallax.vue
Scroll down ↓
Parallax
↑ Scroll up

Install

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/parallax

Import the shared styles once in your application.

TSUsage
import Parallax from '@/components/beui/effects/Parallax.vue'
import '@/components/beui/styles.css'

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.

Default.3
axis?
"x" | "y"
Defaulty
container?
HTMLElement | null

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

Default—
spring?
boolean

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

Defaulttrue
class?
string
Default—
#default?
slot
Default—

Updated