Carousel
Combine the circular, panelsPerView, and align options to build various carousel UIs.
- JavaScript
- React
- Vue@3
Summary
Key Options
| Option | Type | Default | Description |
|---|---|---|---|
circular | boolean | false | Circular mode |
panelsPerView | number | -1 | Number of panels per view (-1 to disable) |
align | string | number | "center" | Panel alignment position |
Combination Comparison
| Combination | Behavior | Best For |
|---|---|---|
circular + panelsPerView: 3 + align: "prev" | Infinite loop showing 3 panels | Product lists, card carousels |
circular + panelsPerView: 1 + align: "center" | Infinite loop with 1 center-aligned panel | Hero sliders, banners |
circular: false + panelsPerView: 3 + bound | 3-column slider with end boundaries | Finite lists, galleries |
Details
circular + panelsPerView Combination
When using circular: true together with panelsPerView, the specified number of panels are visible on screen while looping infinitely. Panel width is automatically calculated as 100% / panelsPerView.
Role of align
"prev": Panels are left-aligned — suitable for list-type carousels"center": Current panel is centered — suitable for spotlight-type carousels
Non-Circular Slider
Setting circular: false + bound: true creates a regular slider that stops without empty space at the end.
Related Options
- Relationship with
circularFallback: Sets fallback behavior when there are not enough panels for circular mode - Relationship with
bound: Usebound: truewithcircular: falseto prevent empty space - Relationship with
noPanelStyleOverride: When usingpanelsPerView, you can disable automatic panel width setting and control it directly with CSS
Use Cases
When should you use this?
- Product carousel:
circular + panelsPerView: 3~5combination - Hero banner:
circular + panelsPerView: 1 + align: "center"combination - Image gallery:
circular: false + panelsPerView: 3 + boundcombination
Notes
Caution
- For
circular: trueto work, the total panel width must be larger than the viewport. If there are not enough panels, check thecircularFallbacksetting. - When
panelsPerViewis set, the panel's CSS width is automatically overridden. Setting a separate width in CSS may cause conflicts.
Related Links
Related Options
circular: Circular modepanelsPerView: Number of panels per viewalign: Panel alignmentcircularFallback: Fallback behavior when circular is not possiblebound: Boundary restriction
Related Demos
- Circular: On/off comparison of the circular option itself
- Panels Per View: Detailed panelsPerView option
- Fullpage Scroll: Other option combination patterns