Lottie Player

Renders programmatically generated Lottie animations using lottie-web. Two variants: a basic LottiePlayer and a ControlledLottiePlayer with play/pause, speed, and progress controls. 23 built-in animation generators included.

Preview

LottiePlayer (Basic)

Logo AssemblyOne-shot, no controls
Bird FlightLooping

ControlledLottiePlayer (With Controls)

Speed:
Logo Pulse
Speed:
Campfire

Usage

tsx
import {
  LottiePlayer,
  ControlledLottiePlayer,
  createLogoAssemblyAnimation,
} from "zostel-ui";

const data = createLogoAssemblyAnimation();

// Basic player
<LottiePlayer animationData={data} loop={false} autoplay />

// With controls
<ControlledLottiePlayer
  animationData={data}
  loop
  autoplay
  showControls
/>

LottiePlayer Props

animationData
Type: object
Default: required

Lottie JSON animation data.

loop
Type: boolean
Default: true

Whether to loop the animation.

autoplay
Type: boolean
Default: true

Auto-start the animation on mount.

speed
Type: number
Default: 1

Playback speed multiplier.

onComplete
Type: () => void
Default: -

Callback when animation completes (non-looping).

className
Type: string
Default: ""

Additional CSS classes.

style
Type: CSSProperties
Default: -

Inline styles (set width/height).

ControlledLottiePlayer Props

showControls
Type: boolean
Default: true

Show play/pause, restart, speed, and progress controls.

Plus all LottiePlayer props above.

Available Animations

tsx
// 23 built-in generators:
createLogoAssemblyAnimation()
createLogoPulseAnimation()
createLogoRotateAnimation()
createLogoDrawAnimation()
createIconBounceAnimation(color?)
createStaggeredRevealAnimation(wordCount?, color?)
createWaveAnimation()
createCompassSpinAnimation()
createCampfireAnimation()
createTreeSwayAnimation()
createSunRaysAnimation()
createBirdFlightAnimation()
createMountainParallaxAnimation()
createGondFlowAnimation()
createKhovarPulseAnimation()
createRainAnimation()
createSnowAnimation()
createLoadingSpinnerAnimation()
createConfettiBurstAnimation()
createPathDrawAnimation()
createBackpackBounceAnimation()
createStarTwinkleAnimation()
createZManFlyingAnimation()