Lifetime updates on every purchase Support replies within 24 hours Secure checkout via Gumroad 8,500+ sales since 2016

Options

Updated 1 min read 5 views
OptionTypeDefaultDescription
mode'loop' | 'scroll' | 'sections''loop'Animation mode.
colorsArray<string | object>4 pastel colorsPalette. See Colors.
propertystring'background-color'Property animated by plain string colors.
durationnumber | '1.5s' | '300ms'1500Transition between two colors (loop, sections).
holdtime1000loop: how long each color stays.
delaytime0loop: delay before the first transition.
easingstring | function'ease-in-out'linear, ease, ease-in, ease-out, ease-in-out, ease-in-sine, ease-out-sine, ease-in-out-sine, ease-in-out-cubic, ease-in-out-quint, ease-in-out-expo, cubic-bezier(a, b, c, d) or t => t. In scroll mode, it applies to each segment between two colors.
direction'normal' | 'reverse' | 'alternate' | 'random''normal'loop: color order.
iterationsnumberInfinityloop: number of full cycles.
interpolation'oklab' | 'oklch' | 'rgb''oklab'Color space for mixing.
containerElement | string | windowwindowscroll, sections: the scrolling element.
triggerElement | stringnullscroll: element whose passage through the viewport drives progress.
smooth0 – 0.950.85scroll: inertia. 0 follows the scrollbar instantly.
sectionsstring | NodeList | Element[]'[data-sbg-section]'sections: section elements.
threshold0 – 10.5sections: activation line as a fraction of viewport height.
activeClassstring | null'is-sbg-active'sections: class added to the active section. Per-section classes for the target come from data-sbg-class.
pauseOffscreenbooleantrueloop: pause while the element is not visible.
reducedMotion'auto' | 'ignore''auto''auto' respects the user’s prefers-reduced-motion setting.
autoplaybooleantrueloop: start immediately.
onInit, onChange, onUpdate, onComplete, onDestroyfunctionnullSee Events.

Global defaults live in SmoothBackground.defaults and can be changed before you create instances.

Was this article helpful?