Motion Wrappers
13 Framer Motion animation primitives for scroll reveals, stagger lists, interactive cards, floating elements, counters, and more. Requires framer-motion as a peer dependency.
Preview
Usage
import {
ScrollReveal,
StaggerList,
StaggerItem,
InteractiveCard,
Floating,
CountUp,
TextReveal,
} from "zostel-ui";
// Scroll reveal
<ScrollReveal>
<Card>Appears on scroll</Card>
</ScrollReveal>
// Stagger list
<StaggerList>
<StaggerItem><Card>1</Card></StaggerItem>
<StaggerItem><Card>2</Card></StaggerItem>
</StaggerList>
// Interactive card
<InteractiveCard onClick={handleClick}>
<Card>Hover lift + tap scale</Card>
</InteractiveCard>
// CountUp
<CountUp to={1500} duration={2} />
// Text reveal
<TextReveal text="Live Free" />Components
ScrollReveal
| Prop | Type | Default | Description |
|---|---|---|---|
variants | Variants | fadeUpVariants | Framer Motion variants for enter/exit. |
once | boolean | true | Only animate once when scrolled into view. |
amount | number | 0.3 | Viewport intersection threshold (0-1). |
delay | number | 0 | Delay in seconds before animation starts. |
variantsVariantsFramer Motion variants for enter/exit.
oncebooleanOnly animate once when scrolled into view.
amountnumberViewport intersection threshold (0-1).
delaynumberDelay in seconds before animation starts.
StaggerList
| Prop | Type | Default | Description |
|---|---|---|---|
staggerDelay | number | 0.08 | Delay between each child in seconds. |
once | boolean | true | Only stagger once. |
amount | number | 0.2 | Viewport intersection threshold. |
staggerDelaynumberDelay between each child in seconds.
oncebooleanOnly stagger once.
amountnumberViewport intersection threshold.
StaggerItem
| Prop | Type | Default | Description |
|---|---|---|---|
variants | Variants | fadeUpVariants | Animation variants for this item. |
variantsVariantsAnimation variants for this item.
InteractiveCard
| Prop | Type | Default | Description |
|---|---|---|---|
onClick | () => void | - | Click handler. |
disabled | boolean | false | Disable hover/tap interactions. |
onClick() => voidClick handler.
disabledbooleanDisable hover/tap interactions.
Floating
| Prop | Type | Default | Description |
|---|---|---|---|
distance | number | 10 | Float distance in pixels. |
duration | number | 3 | Full cycle duration in seconds. |
distancenumberFloat distance in pixels.
durationnumberFull cycle duration in seconds.
PulseGlow
| Prop | Type | Default | Description |
|---|---|---|---|
scale | number | 1.05 | Peak scale value. |
duration | number | 2 | Full cycle duration in seconds. |
scalenumberPeak scale value.
durationnumberFull cycle duration in seconds.
Spinner
| Prop | Type | Default | Description |
|---|---|---|---|
duration | number | 8 | Full rotation duration in seconds. |
durationnumberFull rotation duration in seconds.
Shake
| Prop | Type | Default | Description |
|---|---|---|---|
trigger | boolean | false | Set to true to trigger the shake. |
intensity | number | 8 | Shake intensity in pixels. |
triggerbooleanSet to true to trigger the shake.
intensitynumberShake intensity in pixels.
TapBounce
| Prop | Type | Default | Description |
|---|---|---|---|
scale | number | 0.95 | Scale on tap (< 1 for press-in). |
scalenumberScale on tap (< 1 for press-in).
CountUp
| Prop | Type | Default | Description |
|---|---|---|---|
from | number | 0 | Starting number. |
to | number | required | Target number. |
duration | number | 2 | Animation duration in seconds. |
formatter | (value: number) => string | Math.round + toLocaleString | Custom number formatter. |
fromnumberStarting number.
tonumberTarget number.
durationnumberAnimation duration in seconds.
formatter(value: number) => stringCustom number formatter.
TextReveal
| Prop | Type | Default | Description |
|---|---|---|---|
text | string | required | Text to reveal character by character. |
charDelay | number | 0.03 | Delay between each character in seconds. |
once | boolean | true | Only reveal once. |
textstringText to reveal character by character.
charDelaynumberDelay between each character in seconds.
oncebooleanOnly reveal once.
Parallax
| Prop | Type | Default | Description |
|---|---|---|---|
speed | number | 0.5 | Parallax speed multiplier. |
speednumberParallax speed multiplier.
PageTransition
No additional props. Wraps children with enter/exit opacity + y transitions.