Skip to content
PixiKit

Fly Through Stack

Images stacked in depth that you fly through: scroll or drag to travel, far images fade in from the background, and the nearest one follows the pointer.

pixikit.com/docs/components/fly-through-stack

Customize

Infinite
Item width340
Aspect ratio0.80
Border radius7
Grayscale1.00
Perspective1000
Spacing800
Spread0.80
Scatter0.10
Reveal range1.5
Pass range1.0
Parallax x0.12
Parallax y0.06
Parallax smooth0.85
Tilt4.0
Pulse0.030
Drift0.08
Smooth0.85
Wheel speed1.0
Drag speed1.5
Auto scroll0
Pause on hover
Background color

Props

27
NameTypeDefaultDescription
imagesFlyThroughStackImage[]DEFAULT_IMAGESThe images, nearest first: URLs, or objects with src and alt.
infinitebooleantrueLoops the stack so it can be scrolled forever in either direction.
itemWidthnumber340Width of each image, in pixels.
aspectRationumber0.8Image width divided by height.
borderRadiusnumber7Corner rounding, in pixels.
grayscalenumber1How grey the images are. 0 keeps their color.
perspectivenumber1000CSS perspective, in pixels. Lower values exaggerate the depth.
spacingnumber800Depth in pixels between consecutive images. Also the scroll distance per image.
spreadnumber0.8How far images sit to the left and right of the centre.
scatternumber0.1Random offset added to each image's place.
revealRangenumber1.5How many images ahead fade into view.
passRangenumber1How far past the viewer an image travels before it is gone.
parallaxXnumber0.12How far the focused image follows the pointer sideways, as a fraction of its width.
parallaxYnumber0.06How far the focused image follows the pointer vertically, as a fraction of its height.
parallaxSmoothnumber0.85Pointer follow damping. 0 snaps, 1 trails far behind.
tiltnumber4Degrees the focused image tilts toward the pointer while scrolling fast.
pulsenumber0.03How much the focused image swells while scrolling fast. 0.03 is 3 percent.
driftnumber0.08How far the stack drifts against the scroll direction, as a fraction of image height.
smoothnumber0.85Scroll follow damping. 0 is instant, 1 is very loose.
wheelSpeednumber1Multiplier applied to wheel and trackpad deltas.
dragSpeednumber1.5Multiplier applied to pointer drag deltas.
autoScrollnumber0Pixels per second the stack travels on its own; negative flies backward.
pauseOnHoverbooleantrueStops the travel while the pointer is over the gallery.
backgroundColorstring"transparent"Color behind the stack; far images fade into it.
onIndexChange(index: number) => voidNoneCalled when the nearest image changes.
classNamestringNone
childrenReactNodeNoneContent laid over the centre of the gallery.

Related