Parallax
Media
stable
Scroll-driven parallax effect for images and layers.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- animationDurationnumber
- easingTParallaxEasing | string'linear'
- Easing curve for the parallax animation. Accepts tokens or any CSS timing function.
- perspectivenumber1000
- CSS perspective depth value for the 3D transform context.
- eventTParallaxEvent'move'
- Driving event for the parallax effect: mouse move, scroll, or audio data.
- activebooleantrue
- Activates or freezes the mouse-driven movement mode.
- durationnumber1000
- Animation duration in milliseconds for the legacy mouse/transition path.
- directionTParallaxDirection'vertical'
- Axis of the parallax effect. Both enables 2D mouse tracking.
- speednumber0.5
- Global speed multiplier for single-layer mode (0 = fixed, 1 = scroll speed, >1 = faster).
- disabledbooleanfalse
- Forces the parallax translation to 0 regardless of scroll or events.
- thresholdnumber0
- Proportion (0–1) of the host that must enter the viewport before the effect activates.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- tagstring'div'
- Root HTML element tag.
- colorTColor
- Text color applied to the parallax root.
- bgColorTColor
- Background color applied to the parallax root.
- paddingboolean | number | string
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- marginboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>
- borderTopboolean | number | string
- borderLeftboolean | number | string
- borderBottomboolean | number | string
- borderRightboolean | number | string
- borderBlockboolean | number | string
- borderInlineboolean | number | string
- borderInlineStartboolean | number | string
- borderInlineEndboolean | number | string
- borderBlockStartboolean | number | string
- borderBlockEndboolean | number | string
- borderColorstring
- borderStylestring
- borderTopColorTColor
- borderRightColorTColor
- borderBottomColorTColor
- borderLeftColorTColor
- borderInlineStartColorTColor
- borderInlineEndColorTColor
- borderBlockStartColorTColor
- borderBlockEndColorTColor
- roundedboolean | number | string | TRounded | null | undefined
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- elevationTElevation
- heightnumber | string
- Height of the parallax container.
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- Width of the parallax container.
- audiostring
- playAudioboolean
API
Slots
Emplacements de contenu exposés par ce composant.
- #default
- Content rendered inside the parallax container. Add ParallaxLayer or ParallaxElement children here.
API
Emits
Événements émis par ce composant.
- @entervoid
- Fired when the mouse enters the parallax area (move mode).
- @leavevoid
- Fired when the mouse leaves the parallax area (move mode).
- @scroll-progressnumber
- Fired on scroll with the normalised progress value (0–1).
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Scroll-driven parallax
Mouse-driven parallax
Single-layer (speed prop)
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.