Skip to main content

Bound

The bound option restricts the camera from going beyond the first and last panel boundaries. It can be used together with the bounce option to control the elastic effect at the boundaries.

import Flicking from "@egjs/flicking";
import "@egjs/flicking/dist/flicking.css";
import "./styles.css";

// bound: false (default)
new Flicking("#flick-unbound", {
  bound: false,
  align: "prev"
});

// bound: true
new Flicking("#flick-bound", {
  bound: true,
  align: "prev"
});

// bound: true + bounce: "50%"
new Flicking("#flick-bounce", {
  bound: true,
  bounce: "50%",
  align: "prev"
});

Summary

Key Options

OptionTypeDefaultDescription
boundbooleanfalseEnable boundary restriction
bouncenumber | string | [number | string, number | string]"20%"Bounce area size

Comparison by Value

ValueBehaviorSuitable For
bound: falseCan drag into empty space beyond first/last panelInfinite scroll feel, free exploration
bound: trueStops at first/last panel boundary with bounce effectFinite content, clear start/end indication

Details

bound: false in Detail

This is the default. You can continue to drag beyond the last panel, and empty space will be visible. When you release, it snaps to the nearest panel.

bound: true in Detail

The camera cannot go beyond the start of the first panel or the end of the last panel. When reaching the boundary, a bounce effect is displayed to indicate to the user that the end has been reached.

bounce in Detail

The size of the elastic area displayed at the boundary. Larger values give more of a pull feel.

// Various bounce values
bounce: "20%" // Default, 20% of viewport
bounce: "50%" // Larger bounce
bounce: "100px" // Fixed pixel value
bounce: 0 // No bounce
bounce: ["10%", "30%"] // Different values for start/end
  • Relationship with circular: circular: true and bound: true are mutually exclusive. If both are true, circular takes priority and bound is ignored.
  • Relationship with moveType: "freeScroll": Using bound: true together with freeScroll mode prevents scrolling beyond the boundaries.

Use Cases

When to use?
  • bound: false: When you want an infinite scroll feel, when not using circular
  • bound: true: When you want to clearly indicate the start and end of content, when boundary restriction is needed in freeScroll mode

Notes

Cannot be used with circular

When circular: true and bound: true are set simultaneously, circular takes priority. Set circular: false if you want the bound effect.

Bounce value caution

If the bounce value is too large, users may be confused about whether they have reached the end. Generally, around 20-30% is appropriate.

  • circular: Infinite loop mode (mutually exclusive with bound)
  • moveType: Movement behavior mode (freeScroll + bound combination recommended)