Getting Started
Liveposter is a JSON-driven JavaScript animation library for creating sophisticated image transitions and effects. It’s framework-agnostic, lightweight, and easy to use - perfect for creating dynamic visual displays, digital signage, and interactive presentations.
Quick Start
Section titled “Quick Start”The fastest way to try Liveposter is to run it directly with npx - no installation required!
Try the Demo
Section titled “Try the Demo”npx liveposterpnpm dlx liveposteryarn dlx liveposterbunx liveposterThis will start a demo server at http://localhost:3000 showcasing all available animation modes.
Installation
Section titled “Installation”For Library Use
Section titled “For Library Use”Install Liveposter in your project:
npm install liveposterpnpm add liveposteryarn add liveposterbun add liveposterUsing the CLI Tool
Section titled “Using the CLI Tool”The recommended way to use the CLI is with npx - no installation required!
Basic Usage
Section titled “Basic Usage”Running the Demo
Section titled “Running the Demo”Start the built-in demo showcasing all animation modes:
npx liveposter# or explicitlynpx liveposter demopnpm dlx liveposter# or explicitlypnpm dlx liveposter demoyarn dlx liveposter# or explicitlyyarn dlx liveposter demobunx liveposter# or explicitlybunx liveposter demoServing a Single Poster Spec
Section titled “Serving a Single Poster Spec”Display a specific poster configuration:
npx liveposter path/to/your-poster.jsonpnpm dlx liveposter path/to/your-poster.jsonyarn dlx liveposter path/to/your-poster.jsonbunx liveposter path/to/your-poster.jsonServing a Poster List
Section titled “Serving a Poster List”Display multiple posters in a fullscreen layout with navigation:
npx liveposter path/to/poster-list.jsonpnpm dlx liveposter path/to/poster-list.jsonyarn dlx liveposter path/to/poster-list.jsonbunx liveposter path/to/poster-list.jsonA poster list is a JSON array of spec file paths:
[ "specs/slideshow.json", "specs/parallax.json", { "spec": "specs/zoom.json", "title": "Custom Title", "description": "Optional description" }]Development Mode with Hot-Reload
Section titled “Development Mode with Hot-Reload”When developing posters, use development mode for automatic browser reload on file changes:
# Watch a poster spec with auto-reloadnpx liveposter dev path/to/your-poster.json
# Watch a poster listnpx liveposter dev path/to/poster-list.json
# Watch the default demonpx liveposter dev# Watch a poster spec with auto-reloadpnpm dlx liveposter dev path/to/your-poster.json
# Watch a poster listpnpm dlx liveposter dev path/to/poster-list.json
# Watch the default demopnpm dlx liveposter dev# Watch a poster spec with auto-reloadyarn dlx liveposter dev path/to/your-poster.json
# Watch a poster listyarn dlx liveposter dev path/to/poster-list.json
# Watch the default demoyarn dlx liveposter dev# Watch a poster spec with auto-reloadbunx liveposter dev path/to/your-poster.json
# Watch a poster listbunx liveposter dev path/to/poster-list.json
# Watch the default demobunx liveposter devThe dev mode automatically reloads your browser when you modify:
- Poster spec JSON files
- Image assets
- HTML/CSS files
- Any files in the spec’s directory
Port Configuration
Section titled “Port Configuration”By default, Liveposter runs on port 3000. You can customize the port in three ways:
Option 1: Environment Variable
Section titled “Option 1: Environment Variable”PORT=8080 npx liveposter dev my-poster.jsonPORT=8080 pnpm dlx liveposter dev my-poster.jsonPORT=8080 yarn dlx liveposter dev my-poster.jsonPORT=8080 bunx liveposter dev my-poster.jsonOption 2: .env File in Project Directory
Section titled “Option 2: .env File in Project Directory”Create a .env file in your project directory (where you run the command):
echo "PORT=8080" > .envThen run Liveposter normally - it will use the port from your .env file:
npx liveposter dev my-poster.jsonOption 3: .env File in Package Directory
Section titled “Option 3: .env File in Package Directory”For repository development, create .env in packages/demo-server/:
echo "PORT=8080" > packages/demo-server/.envnpm run devPriority Order
Section titled “Priority Order”Liveposter checks these locations in order:
PORTenvironment variable (highest priority).envin current working directory.envin package directory- Default: 3000 (if none set)
Your First Poster
Section titled “Your First Poster”Let’s create a simple slideshow from scratch.
1. Create a Poster Spec
Section titled “1. Create a Poster Spec”Create a file called my-first-poster.json:
{ "container": "#poster", "mode": "diaporama", "loop": true, "timing": { "duration": 3000, "transition": 500 }, "effects": { "type": "fade", "easing": "ease-in-out" }, "images": [ { "src": "https://picsum.photos/1080/1920?random=1", "alt": "Image 1" }, { "src": "https://picsum.photos/1080/1920?random=2", "alt": "Image 2" }, { "src": "https://picsum.photos/1080/1920?random=3", "alt": "Image 3" } ]}2. Run It Locally
Section titled “2. Run It Locally”npx liveposter dev my-first-poster.jsonpnpm dlx liveposter dev my-first-poster.jsonyarn dlx liveposter dev my-first-poster.jsonbunx liveposter dev my-first-poster.jsonOpen http://localhost:3000 in your browser. You’ll see a smooth crossfade slideshow!
3. Understanding the Output
Section titled “3. Understanding the Output”Your poster will:
- Display three images in sequence
- Use smooth fade transitions (500ms)
- Show each image for 3 seconds
- Loop continuously
Try modifying the spec:
- Change
modeto"hardcut-slideshow"for instant transitions - Adjust
timing.durationto control display time - Change
effects.typeto"zoom"for Ken Burns effect - Add your own image URLs or local file paths
Using in Your Web Application
Section titled “Using in Your Web Application”For more control, use Liveposter as a library in your HTML:
<!DOCTYPE html><html> <head> <link rel="stylesheet" href="node_modules/liveposter/dist/animator.css" /> </head> <body> <div id="slideshow"></div>
<script type="module"> import ImageAnimator from "liveposter";
const config = { container: "#slideshow", mode: "diaporama", loop: true, timing: { duration: 3000, transition: 500, }, effects: { type: "fade", easing: "ease-in-out", }, images: [ { src: "image1.jpg", alt: "Image 1" }, { src: "image2.jpg", alt: "Image 2" }, { src: "image3.jpg", alt: "Image 3" }, ], };
const animator = new ImageAnimator(config); await animator.init();
// Control the slideshow // animator.pause(); // animator.resume(); // animator.next(); // animator.previous(); </script> </body></html>Next Steps
Section titled “Next Steps”Now that you have Liveposter running, explore more advanced features:
- Animation Modes - Learn about all available animation modes (slideshow, pan, zoom, lenticular, parallax)
- Overlays - Add visual overlays to enhance your animations
- Effects - Understand available transition effects
- Poster Spec Reference - Complete configuration schema and options
- Kiosk Mode - Deploy fullscreen displays for digital signage
Available Animation Modes
Section titled “Available Animation Modes”Liveposter supports multiple animation modes:
- hardcut-slideshow: Instant cuts between images
- diaporama: Smooth crossfade transitions (classic slideshow)
- pan-slideshow: Continuous panning across wide images
- zoom-slideshow: Ken Burns style zoom effect
- lenticular: Input-driven image switching (mouse/tilt)
- parallax-layers: Multiple layers with depth effect
See the Animation Modes guide for detailed examples of each mode.
Need Help?
Section titled “Need Help?”- Check out the GitHub repository
- Report issues on GitHub Issues
- View the npm package