Skip to main content

Progress Bar

Use the progress property from the Reactive API to display a visual scroll progress indicator that updates in real-time.

import Flicking, { connectFlickingReactiveAPI } from "@egjs/flicking";
import "@egjs/flicking/dist/flicking.css";
import "./styles.css";

const flicking = new Flicking("#flick", {
  moveType: "freeScroll"
});
const reactiveAPI = connectFlickingReactiveAPI(flicking);

const progressBar = document.querySelector(".progress-bar");
const progressText = document.querySelector(".progress-text");

reactiveAPI.subscribe("progress", value => {
  progressBar.style.width = `${value}%`;
  progressText.textContent = `Progress: ${value.toFixed(1)}%`;
});

Summary

Key API

PropertyTypeDescription
progressnumberOverall scroll progress percentage (0-100)

Behavior

PositionprogressBar Width
Start00%
Middle~50~50%
End100100%

Details

What is progress?

progress represents the current camera position as a percentage of the total scrollable range. Combining it with moveType: "freeScroll" allows continuous (non-snapping) progress updates, making it ideal for smooth progress bar animations.

  • moveType: "freeScroll": Enables continuous progress changes without snapping to panel boundaries.
  • bound: true: Ensures progress reaches exactly 0 at the start and 100 at the end.

Use Cases

When to use
  • Image gallery scroll progress
  • Onboarding step indicator
  • Content reading progress