Toggle Sidebar B
AppearanceLight & dark mode D

Fade Content

Simple directional fade / slide entrance / exit wrapper with threshold-based activation.

Default

Every prop is wired to the controls underneath. The fade plays once when the element reaches the trigger line, use the replay button to run it again.

Dark previewReplay previewOpen in new tab
Fade

Customize

Ease
Disappear Ease
Duration1s
Delay0s
Threshold0.1
Initial Opacity0
Disappear After0
Disappear Duration0.5

API Reference

FadeContent

PropTypeDefaultDescription
containerstring | HTMLElementnullThe scroll container to use for ScrollTrigger. Falls back to the element with id snap-main-container, then the window.
blurbooleanfalseEnables a blur effect during the animation.
durationnumber1000Duration of the fade animation. Values above 10 are read as milliseconds, smaller values as seconds.
delaynumber0Adds a delay in seconds before triggering the animation.
easestring"power2.out"GSAP easing function for the fade animation.
thresholdnumber0.1How much of the element must be in view before the animation starts (0-1).
initialOpacitynumber0The starting opacity of the component before it enters the viewport.
disappearAfternumber0Time in seconds after which the content will start to disappear. Disabled if set to 0.
disappearDurationnumber0.5Duration of the disappearance animation in seconds.
disappearEasestring"power2.in"GSAP easing function for the disappearance animation.
EventDescription
completeEmitted when the fade-in completes.
disappearance-completeEmitted when the disappearance animation completes.
SlotDescription
defaultThe content to be animated.

Accessibility

Keyboard shortcuts and ARIA behavior.

  • GSAP autoAlpha toggles visibility, so content is hidden from assistive tech until the fade starts.