Skip to main content

Panels Per View

The panelsPerView option specifies the number of panels to simultaneously display in the viewport. When a positive value is set, panel sizes are automatically adjusted.

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

// panelsPerView: -1 (default)
new Flicking("#flick-manual", {
  panelsPerView: -1,
  align: "prev"
});

// panelsPerView: 3
new Flicking("#flick-three", {
  panelsPerView: 3,
  align: "prev"
});

// panelsPerView: 1
new Flicking("#flick-one", {
  panelsPerView: 1,
  align: "center"
});

Summary

Key Options

OptionTypeDefaultDescription
panelsPerViewnumber-1Number of panels to display in viewport (-1: no auto-calculation)
noPanelStyleOverridebooleanfalseDisable automatic panel size adjustment

Comparison by Value

ValueBehaviorSuitable For
-1Does not change panel size. Must be set manually via CSSPanels of varying sizes, custom layouts
1Panel fills the entire viewportFullscreen sliders, hero banners
3Resizes so exactly 3 panels are visibleProduct cards, thumbnail galleries
nResizes so exactly n panels are visibleResponsive grid carousels

Details

panelsPerView: -1 in Detail

This is the default. Panel sizes are not changed, and you must specify panel sizes directly in CSS. Use when mixing panels of various sizes or when a custom layout is needed.

/* Required when panelsPerView: -1 */
.flicking-panel {
width: 150px; /* Manual specification */
}

panelsPerView: Positive Value in Detail

Panel sizes are automatically adjusted so the specified number of panels are visible in the viewport. There is no need to specify panel width in CSS.

// Display exactly 3 panels in the viewport
new Flicking("#el", { panelsPerView: 3 });

noPanelStyleOverride in Detail

Prevents width/height style modification of panels when panelsPerView is active. Used for performance optimization when managing all panel sizes manually.

  • Relationship with align: When used with panelsPerView, align: "prev" is common. Left alignment shows panels sequentially.
  • Relationship with virtual: The virtual option requires panelsPerView > 0. If -1, virtual is ignored.
  • Relationship with circular: The panelsPerView setting can affect the circular activation condition (total panel size >= viewport).

Use Cases

When to use?
  • panelsPerView: -1: Cards of varying sizes, tag lists, custom layouts
  • panelsPerView: 1: Hero banners, fullscreen onboarding, image viewers
  • panelsPerView: 3-5: Product carousels, thumbnail galleries, team member introductions

Notes

CSS conflict caution

When setting a positive value for panelsPerView, Flicking automatically calculates the panel width. Specifying width separately in CSS may cause conflicts.

Required for virtual

To use the virtual option, you must set panelsPerView > 0. Virtual does not work with -1.