Saltar al contenido
Neshel-UI
Animaciones (experimental)Referencia

@neshel-ui/animations/scroll

Todas las exportaciones de @neshel-ui/animations/scroll, generadas desde sus declaraciones.

Experimental y no disponible en npm

@neshel-ui/animations es un paquete privado (0.0.0). No se puede instalar y su API puede cambiar antes de una primera publicación. Estas páginas documentan lo que existe en el repositorio.

Firmas, miembros y valores por defecto, generados desde las declaraciones compiladas. Las explicaciones y los ejemplos están en la guía. Efectos ligados al scroll: Scroll y parallax.

Las descripciones de esta referencia se generan desde el código fuente del paquete y se muestran en inglés; las guías y el catálogo están en español.

  • HorizontalScroll component
    ({ layout, label, trackClassName, className, style, ref, children, onFocus, ...rest }: HorizontalScrollProps): Element
  • ParallaxImage component

    SP06: a clipping frame (`<div>` or `asChild`) whose first element child (img/video/picture) moves.

    ({ amount, reducedMotion, asChild, className, ref, children, ...rest }: ParallaxImageProps): Element
  • RevealOnScroll component

    ST01: plays an Entrance preset when the element enters the viewport (hydrated content is not hidden).

    (props: RevealOnScrollProps): Element
  • ScrollEffect component

    Any scroll-family effect on a `<div>` (or `asChild`); inside a `<ScrollScene>` it follows the scene.

    ({ preset, options, asChild, conflicts, className, ref, children, ...rest }: ScrollEffectProps): Element
  • ScrollLayer component

    SP01: a depth layer of the nearest `<ScrollScene>` (or of its own viewport range outside a scene).

    ({ depth, distance, axis, reducedMotion, ...props }: ScrollLayerProps): Element
  • ScrollProgressBar component

    SP03: decorative reading-progress bar (`aria-hidden`); the browser's scrollbar stays the real control.

    ({ source, position, driver, className, ref, ...rest }: ScrollProgressBarProps): Element
  • ScrollScene component

    SP05: a tall `<section>` whose stage is pinned with CSS `position: sticky` (no JS spacer). Writes `--neshel-scene-progress` (0–1) on the section and shares its timeline with `<ScrollLayer>` and `<ScrollEffect>` children (`useScrollScene()`).

    ({ length, smooth, driver, range, reducedMotion, stageClassName, className, style, ref, children, ...rest }: ScrollSceneProps): Element
  • StaggerOnScroll component

    ST02: plays the Entrance `stagger` on the children when the container enters the viewport.

    (props: RevealOnScrollProps): Element
  • StickyStack component

    SP09: each child is wrapped in a sticky card slot whose index is in the server markup.

    ({ top, offset, scale, reducedMotion, className, style, ref, children, ...rest }: StickyStackProps): Element
  • colorAt function

    Colour at progress `p` between stops (stepped when `step`).

    (stops: readonly string[], space: string, p: number, step: boolean): string
  • coveredScale function

    Scale of a card `index` of `count` at stack progress `p` (equal-slot model, documented).

    (index: number, count: number, p: number, scale: number): number
  • createScrollProgress function
    (options?: ScrollProgressOptions | undefined): ScrollProgress
  • createScrollTrigger function
    (element: Element, options?: ScrollTriggerOptions | undefined): ScrollTrigger
  • createSectionSpy function
    (sections: readonly Element[], options?: SectionSpyOptions | undefined): SectionSpy
  • getScrollDebugInfo function

    Snapshot of the scroll engine counters.

    (): ScrollDebugInfo
  • nativeScrollAvailable function

    Whether the APIs of the native driver exist (behaviour is checked per animation).

    (): boolean
  • observeInView function

    Observe `element` against a trigger area; returns the unobserve function.

    (element: Element, input: InViewInput | undefined, listener: Listener): () => void
  • refreshScroll function

    Re-measure every scroll timeline, trigger and effect (for changes the observers cannot see).

    (): void
  • resolveInView function

    Validate and normalise a trigger (preset name or options).

    (input: InViewInput | undefined, owner?: string | undefined): ResolvedInView
  • useInView function

    Whether `ref`'s element is inside the trigger area (state changes only on enter/leave).

    (ref: RefObject<Element | null>, trigger?: InViewInput | undefined): boolean
  • useScrollProgress function

    A timeline for `ref`'s element (its view range) or, with `ref` omitted/null, for the page. Created after mount (one render); never re-renders per frame — read it in effects or subscribe.

    (ref?: RefObject<Element | null> | null | undefined, options?: Omit<ScrollProgressOptions, "subject"> | undefined): ScrollProgress | undefined
  • useScrollScene function

    The nearest `<ScrollScene>`'s timeline (`undefined` outside a scene or before it mounted).

    (): ScrollProgress | undefined
  • useScrollTrigger function

    ST04: trigger state of `ref`'s element; callbacks are read from the latest render.

    (ref: RefObject<Element | null>, options?: ScrollTriggerOptions | undefined): TriggerState
  • useSectionSpy function

    ST08: id of the active section among `ids` (state changes only when the section changes).

    (ids: readonly string[], options?: SectionSpyHookOptions | undefined): string | undefined
  • depthParallax const
    EffectDefinition<DepthParallaxOptions, ResolvedProgress & { extra: { depth: number; distance: number; axis: "x" | "y"; }; }>
  • directionHeader const

    ST06 — hides a sticky/fixed header (transform layer `translateY(−height)`) while scrolling forward past `offset`; shows it on backward scroll, near the top and while focus is inside it (keyboard users never lose a hidden header). `data-neshel-header="hidden"` while hidden. Height is measured on invalidation.

    Readonly<EffectDefinition<DirectionHeaderOptions, ResolvedHeader>>
  • imageParallax const
    EffectDefinition<ImageParallaxOptions, ResolvedProgress & { extra: { amount: number; frame: Element | undefined; }; }>
  • inViewPresets const

    ST10 — named trigger areas (contracts/api-011.md §1).

    Readonly<{ default: Readonly<{ rootMargin: "0px 0px -10% 0px"; threshold: 0; }>; eager: Readonly<{ rootMargin: "0px 0px 25% 0px"; threshold: 0; }>; lazy: Readonly<{ rootMargin: "200% 0px 200% 0px"; threshold: 0; }>; center: Readonly<{ rootMargin: "-45% 0px -45% 0px"; threshold: 0; }>; half: Readonly<{ rootMargin: "0px"; threshold: 0.5; }>; full: Readonly<{ rootMargin: "0px"; threshold: 0.99; }>; top: Readonly<{ rootMargin: "0px 0px -85% 0px"; threshold: 0; }>; }>
  • inViewProgress const

    ST05 — `--neshel-view-progress` (0–1) while the element crosses the viewport; `1` under reduced motion.

    EffectDefinition<PropertyProgressOptions, ResolvedProgress & { extra: { driver: DriverPreference; }; }>
  • lazyEffect const
    Readonly<EffectDefinition<LazyEffectOptions, ResolvedLazy>>
  • pinnedScene const

    SP05: `--neshel-scene-progress` (0–1) over the pinned span of a tall section (`contain` range: from its top reaching the viewport top to its bottom reaching the viewport bottom). Pinning itself is CSS sticky (`.neshel-scene-stage`). Reduced motion keeps the variable and adds the `scene` token to `data-neshel-fx-reduced` so decor can freeze.

    EffectDefinition<PropertyProgressOptions, ResolvedProgress & { extra: { driver: DriverPreference; }; }>
  • revealOnEnter const

    ST01 — play an Entrance preset when the element enters the trigger area.

    Readonly<EffectDefinition<RevealOnEnterOptions, ResolvedReveal>>
  • scrollColorShift const
    EffectDefinition<ScrollColorShiftOptions, ResolvedProgress & { extra: ColorExtra; }>
  • scrollEffects const

    Scroll & Parallax definitions in catalogue order (SP01–SP03, SP05–SP09, SP11), for registries.

    readonly AnyEffectDefinition[]
  • scrollProgress const

    SP03: `--neshel-scroll-progress` (0–1) of the page (or `source`) on the element.

    EffectDefinition<PropertyProgressOptions, ResolvedProgress & { extra: { driver: DriverPreference; }; }>
  • scrollTriggerEffects const

    Scroll Trigger definitions in catalogue order (ST01, ST02, ST05, ST06, ST07, ST09), for registries.

    readonly AnyEffectDefinition[]
  • scrubTransform const
    EffectDefinition<ScrubTransformOptions, ResolvedProgress & { extra: { from: Required<ScrubPose>; to: Required<ScrubPose>; easing: Easing; }; }>
  • staggerOnEnter const

    ST02 — play the E10 `stagger` (children) when the container enters the trigger area.

    Readonly<EffectDefinition<RevealOnEnterOptions, ResolvedReveal>>
  • stickyStack const

    SP09: attached to a container whose element children are the cards. Each child gets `--neshel-stack-index` (scroll.css offsets its sticky `top`) and, unless `scale: 0`, a covered-card scale layer driven by the container's `contain` progress (exact for equal-height cards). Without JavaScript `<StickyStack>` renders the index inline, so stacking works from the server markup.

    EffectDefinition<StickyStackOptions, ResolvedProgress & { extra: { scale: number; }; }>
  • stuckState const

    ST07 — `data-neshel-stuck` while a `position: sticky` element (block-start offset `top`) is pinned. An IntersectionObserver with `rootMargin: -(top + 1)px 0 0 0` and thresholds 0/1 reports the pinned edge (no sentinel element); the release point (bottom of the containing block) comes from cached geometry and the source position, so scrolling reads no layout.

    Readonly<EffectDefinition<StuckStateOptions, ResolvedStuck>>
  • velocitySkew const
    Readonly<EffectDefinition<VelocitySkewOptions, ResolvedSkew>>
  • zoomOnScroll const
    EffectDefinition<ZoomOnScrollOptions, ResolvedProgress & { extra: { from: number; to: number; easing: Easing; }; }>
  • DepthParallaxOptions interface

    DepthParallaxOptions

    DepthParallaxOptions
    PropTipoPredeterminadoDescripción
    axis"x" | "y""y"Eje de movimiento (por defecto "y").
    depthnumber—Factor de velocidad: positivo va contra el scroll (primer plano), negativo se retrasa (fondo). −5…5, por defecto 1.
    distancenumber—Recorrido con profundidad 1 en todo el rango, px (0–2000, por defecto 200).
    rangereadonly [RangeInput, RangeInput]—Rango de la línea de tiempo propia del efecto (se ignora con timeline).
    reducedMotionReducedMotion——
    scrollAxisScrollAxis"block"Eje de scroll de la línea de tiempo propia (por defecto "block").
    smoothboolean | SpringOptions | SpringPreset—Suavizado con resorte (SP10) de la línea de tiempo propia.
    sourceElement | Window | null—Contenedor con scroll de la línea de tiempo propia (por defecto: el de la página).
    timelineScrollProgress—Una línea de tiempo compartida (p. ej. de useScrollScene()); si no, el efecto crea una.
  • DirectionHeaderOptions interface

    DirectionHeaderOptions

    DirectionHeaderOptions
    PropTipoPredeterminadoDescripción
    durationnumber220Duración del deslizamiento en ms (por defecto 220).
    offsetnumber—Nunca se oculta por encima de esta posición, px (0–2000, por defecto 80).
    onChange(hidden: boolean) => void——
    reducedMotionReducedMotion——
    sourceElement | Window | null——
    tolerancenumber—Distancia en una dirección antes de cambiar, px (0–400, por defecto 12).
  • HorizontalScrollProps interface

    HorizontalScrollProps

    HorizontalScrollProps
    PropTipoPredeterminadoDescripción
    childrenReactNode——
    labelstring—Accessible name of the region (recommended).
    layoutHorizontalLayout—"auto" (default) and "pinned": pinned when the track overflows (else a native scroller), stacked whenever motion is reduced (live). "stacked": always vertical. "scroll": always a native horizontal scroller (user-driven, kept under reduced motion).
    refRef<HTMLElement>——
    trackClassNamestring——

    También acepta las props de: React DOM attributes.

  • ImageParallaxOptions interface

    ImageParallaxOptions

    ImageParallaxOptions
    PropTipoPredeterminadoDescripción
    amountnumber—Recorrido a cada lado en px (0–400, por defecto 48). El medio se escala para cubrir el marco.
    frameElement—El marco que recorta (por defecto: el padre del elemento).
    rangereadonly [RangeInput, RangeInput]—Rango de la línea de tiempo propia del efecto (se ignora con timeline).
    reducedMotionReducedMotion——
    scrollAxisScrollAxis"block"Eje de scroll de la línea de tiempo propia (por defecto "block").
    smoothboolean | SpringOptions | SpringPreset—Suavizado con resorte (SP10) de la línea de tiempo propia.
    sourceElement | Window | null—Contenedor con scroll de la línea de tiempo propia (por defecto: el de la página).
    timelineScrollProgress—Una línea de tiempo compartida (p. ej. de useScrollScene()); si no, el efecto crea una.
  • InViewOptions interface

    InViewOptions

    InViewOptions
    PropTipoPredeterminadoDescripción
    rootElement | null—Raíz de intersección; omitida o null → la pantalla.
    rootMarginstring—Margen CSS alrededor de la raíz (px o %), como en IntersectionObserver.
    thresholdnumber | readonly number[]——
  • InViewReport interface

    InViewReport

    InViewReport
    PropTipoPredeterminadoDescripción
    bottom(obligatoria)number——
    inView(obligatoria)boolean——
    position(obligatoria)InViewPosition—after: the element left through the start edge (scrolled past).
    ratio(obligatoria)number——
    top(obligatoria)number—Element box edges relative to the viewport at the report (free from the observer entry).
  • LazyEffectOptions interface

    LazyEffectOptions

    LazyEffectOptions
    PropTipoPredeterminadoDescripción
    keepAliveboolean—Conserva el efecto tras su primera activación (por defecto false: se destruye al alejarse).
    onActiveChange(active: boolean) => void——
    optionsRecord<string, unknown>——
    preset(obligatoria)AnyPreset—Cualquier definición o preset (efectos costosos como Tilt3D…).
    triggerInViewInput"lazy"Área de activación (por defecto "lazy": dos pantallas alrededor).
  • ParallaxImageProps interface

    ParallaxImageProps

    ParallaxImageProps
    PropTipoPredeterminadoDescripción
    amountnumber48Travel each way, px (default 48).
    asChildboolean—Apply to the single child element instead of rendering a <div>.
    childrenReactNode——
    conflictsConflictPolicy—Conflict reporting for exclusive channels (default: warn in development).
    reducedMotionReducedMotion——
    refRef<HTMLDivElement>——

    También acepta las props de: React DOM attributes.

  • ProgressOptions interface

    ProgressOptions

    Options shared by every progress-driven effect.

    ProgressOptions
    PropTipoPredeterminadoDescripción
    rangereadonly [RangeInput, RangeInput]—Rango de la línea de tiempo propia del efecto (se ignora con timeline).
    reducedMotionReducedMotion——
    scrollAxisScrollAxis"block"Eje de scroll de la línea de tiempo propia (por defecto "block").
    smoothboolean | SpringOptions | SpringPreset—Suavizado con resorte (SP10) de la línea de tiempo propia.
    sourceElement | Window | null—Contenedor con scroll de la línea de tiempo propia (por defecto: el de la página).
    timelineScrollProgress—Una línea de tiempo compartida (p. ej. de useScrollScene()); si no, el efecto crea una.
  • PropertyProgressOptions interface

    PropertyProgressOptions

    PropertyProgressOptions
    PropTipoPredeterminadoDescripción
    driverDriverPreference—"auto" (por defecto): scroll timeline nativa si está verificada; si no, JS.
    rangereadonly [RangeInput, RangeInput]—Rango de la línea de tiempo propia del efecto (se ignora con timeline).
    reducedMotionReducedMotion——
    scrollAxisScrollAxis"block"Eje de scroll de la línea de tiempo propia (por defecto "block").
    smoothboolean | SpringOptions | SpringPreset—Suavizado con resorte (SP10) de la línea de tiempo propia.
    sourceElement | Window | null—Contenedor con scroll de la línea de tiempo propia (por defecto: el de la página).
    timelineScrollProgress—Una línea de tiempo compartida (p. ej. de useScrollScene()); si no, el efecto crea una.
  • ResolvedInView interface

    ResolvedInView

    ResolvedInView
    PropTipoPredeterminadoDescripción
    root(obligatoria)Element | null——
    rootMargin(obligatoria)string——
    threshold(obligatoria)number[]——
  • RevealOnEnterOptions interface

    RevealOnEnterOptions

    RevealOnEnterOptions
    PropTipoPredeterminadoDescripción
    initial"hold" | "visible"—"hold" (por defecto al adjuntar de forma imperativa): oculta ya la pose inicial, antes de pintar. "visible": conserva el elemento como está hasta el primer aviso (HTML del servidor hidratado).
    modeTriggerMode—ST03: "once" (por defecto), "repeat" (se rearma en cada salida) o "reverse" (sale al retroceder).
    onEnter() => void—Callbacks de ST04.
    onEnterBack() => void——
    onLeave() => void——
    onLeaveBack() => void——
    optionsRecord<string, unknown>—Opciones combinadas sobre las del preset (appear, hold, replay, playback se gestionan solas).
    preset(obligatoria)AnyPreset—Una definición o preset de entrada (fadeUp, clipCircle…; en ST02 el efecto stagger).
    reducedMotionReducedMotion——
    triggerInViewInput"default"Área de activación: un nombre de inViewPresets o { rootMargin, threshold, root } (por defecto "default").
  • RevealOnScrollProps interface

    RevealOnScrollProps

    RevealOnScrollProps
    PropTipoPredeterminadoDescripción
    asChildboolean—Apply to the single child element instead of rendering a <div>.
    childrenReactNode——
    conflictsConflictPolicy—Conflict reporting for exclusive channels (default: warn in development).
    modeTriggerMode——
    onEnter() => void——
    onEnterBack() => void——
    onLeave() => void——
    onLeaveBack() => void——
    optionsRecord<string, unknown>—Options merged over the preset's.
    preset(obligatoria)AnyPreset—Entrance definition or preset (fadeUp, …); for <StaggerOnScroll> the stagger effect/preset.
    reducedMotionReducedMotion——
    refRef<HTMLDivElement>——
    triggerInViewInput——

    También acepta las props de: React DOM attributes.

  • ScrollColorShiftOptions interface

    ScrollColorShiftOptions

    ScrollColorShiftOptions
    PropTipoPredeterminadoDescripción
    rangereadonly [RangeInput, RangeInput]—Rango de la línea de tiempo propia del efecto (se ignora con timeline).
    reducedMotionReducedMotion——
    scrollAxisScrollAxis"block"Eje de scroll de la línea de tiempo propia (por defecto "block").
    smoothboolean | SpringOptions | SpringPreset—Suavizado con resorte (SP10) de la línea de tiempo propia.
    sourceElement | Window | null—Contenedor con scroll de la línea de tiempo propia (por defecto: el de la página).
    space"oklab" | "oklch" | "srgb""oklab"Espacio de interpolación de color-mix() (por defecto "oklab").
    stops(obligatoria)readonly string[]—Dos o más colores CSS (8 como máximo).
    themeTargetElement—Elemento que recibe data-neshel-theme (por defecto: el propio elemento).
    themesreadonly string[]—Nombres de tema opcionales (uno por parada) escritos en data-neshel-theme de themeTarget.
    timelineScrollProgress—Una línea de tiempo compartida (p. ej. de useScrollScene()); si no, el efecto crea una.
  • ScrollDebugInfo interface

    ScrollDebugInfo

    Scroll engine counters (contracts/scroll-engine.md §6). Plain numbers, no allocation per frame; tests and the browser lab read them to prove, for example, that scrolling never triggers a geometry measurement.

    ScrollDebugInfo
    PropTipoPredeterminadoDescripción
    activeTimelines(obligatoria)number—Timelines currently subscribed to their source.
    lastFallback{ native: number | null; expected: number; property: string; }—Last behavioural-check failure: native progress (null = inactive) vs the JS model.
    measurements(obligatoria)number—Geometry measurements (one per timeline per invalidation pass).
    nativeAnimations(obligatoria)number—Live native (scroll-timeline) animations.
    nativeFallbacks(obligatoria)number—Native animations replaced by the JS driver after the behavioural check.
    observedTargets(obligatoria)number—Elements watched by the shared ResizeObserver.
    scrollReads(obligatoria)number—Scroll position reads (one per source per frame while scrolling).
    sources(obligatoria)number—Live scroll sources (one per scroller with subscribers).
    timelines(obligatoria)number—Live timelines (createScrollProgress results not destroyed).
  • ScrollDiagnostics interface

    ScrollDiagnostics

    ScrollDiagnostics
    PropTipoPredeterminadoDescripción
    actual(obligatoria)number—Fresh bounding-box subject start (includes transforms).
    computed(obligatoria)number—Cached subject start (layout, px).
    drift(obligatoria)number——
  • ScrollGeometry interface

    ScrollGeometry

    ScrollGeometry
    PropTipoPredeterminadoDescripción
    end(obligatoria)number—Scroll offset where progress is 1 (px).
    max(obligatoria)number——
    position(obligatoria)number——
    start(obligatoria)number—Scroll offset where progress is 0 (px).
    subjectSize(obligatoria)number——
    subjectStart(obligatoria)number——
    viewport(obligatoria)number——
  • ScrollLayerProps interface

    ScrollLayerProps

    ScrollLayerProps
    PropTipoPredeterminadoDescripción
    asChildboolean—Apply to the single child element instead of rendering a <div>.
    axis"x" | "y"——
    childrenReactNode——
    conflictsConflictPolicy—Conflict reporting for exclusive channels (default: warn in development).
    depthnumber—SP01 depth (−5…5, default 1).
    distancenumber200Travel at depth 1 over the scene, px (default 200).
    reducedMotionReducedMotion——
    refRef<HTMLDivElement>——

    También acepta las props de: React DOM attributes.

  • ScrollProgress interface

    ScrollProgress

    ScrollProgress
    PropTipoPredeterminadoDescripción
    destroy(obligatoria)() => void—Idempotent: releases listeners, observers and frame tasks.
    diagnose(obligatoria)() => ScrollDiagnostics—Cached vs fresh subject position (forces layout; diagnostics only).
    direction(obligatoria)1 | -1 | 0—1 forward, -1 backward, 0 idle.
    geometry(obligatoria)Readonly<ScrollGeometry>——
    get(obligatoria)() => number—Progress 0–1 (smoothed when smooth is on and motion is not reduced).
    getRaw(obligatoria)() => number—Unsmoothed progress 0–1.
    getVelocity(obligatoria)() => number—Progress units per second.
    refresh(obligatoria)() => void—Re-measure this timeline in the next read phase.
    scrollVelocity(obligatoria)number—Source velocity on this timeline's axis (px/s).
    subscribe(obligatoria)(listener: (progress: number) => void) => () => void—Listener after every update (update phase) and every smoothing step, with the current progress (not only on change: a draw at progress 0 matters). The first subscription starts following the source.
    toJSON(obligatoria)() => string——
  • ScrollProgressBarProps interface

    ScrollProgressBarProps

    ScrollProgressBarProps
    PropTipoPredeterminadoDescripción
    driverDriverPreference——
    position"top" | "bottom" | "static"—"top" (default, fixed to the viewport top), "bottom" or "static" (in flow).
    refRef<HTMLDivElement>——
    sourceElement | null—Scroll container (default: the page).

    También acepta las props de: React DOM attributes.

  • ScrollProgressOptions interface

    ScrollProgressOptions

    ScrollProgressOptions
    PropTipoPredeterminadoDescripción
    axisScrollAxis——
    rangereadonly [RangeInput, RangeInput]——
    reducedMotionReducedMotion"user"Política de movimiento reducido del suavizado (por defecto "user").
    smoothboolean | SpringOptions | SpringPreset—SP10: progreso suavizado con resorte (true = resorte 90/20).
    sourceElement | Window | null—Contenedor con scroll; omitido, null o window → el de la página.
    subjectElement | null—Elemento cuyo paso por pantalla se sigue; omítelo para todo el rango de scroll.
  • ScrollSceneProps interface

    ScrollSceneProps

    ScrollSceneProps
    PropTipoPredeterminadoDescripción
    childrenReactNode——
    driverDriverPreference"auto"Native scroll timeline for --neshel-scene-progress when verified (default "auto").
    lengthnumber—Section length in viewport heights (1–20, default 3); the stage is pinned for length − 1.
    rangereadonly [RangeInput, RangeInput]["contain 0%", "contain 100%"]Progress range (default ["contain 0%", "contain 100%"]: the pinned span).
    reducedMotionReducedMotion——
    refRef<HTMLElement>——
    smoothboolean—SP10: spring-smoothed scene progress.
    stageClassNamestring—Class of the sticky stage.

    También acepta las props de: React DOM attributes.

  • ScrollTrigger interface

    ScrollTrigger

    ScrollTrigger
    PropTipoPredeterminadoDescripción
    destroy(obligatoria)() => void——
    state(obligatoria)TriggerState——
  • ScrollTriggerOptions interface

    ScrollTriggerOptions

    ScrollTriggerOptions
    PropTipoPredeterminadoDescripción
    modeTriggerMode"repeat""once" deja de observar tras la primera entrada (por defecto "repeat").
    onChange(state: TriggerState) => void——
    onEnter() => void—antes → activo (al avanzar hacia el área).
    onEnterBack() => void—después → activo (al retroceder hacia el área).
    onLeave() => void—activo → después (ya superado).
    onLeaveBack() => void—activo → antes (al retroceder por encima del inicio del área).
    triggerInViewInput——
  • ScrubPose interface

    ScrubPose

    ScrubPose
    PropTipoPredeterminadoDescripción
    opacitynumber——
    rotateZnumber——
    scalenumber——
    translateXnumber——
    translateYnumber——
  • ScrubTransformOptions interface

    ScrubTransformOptions

    ScrubTransformOptions
    PropTipoPredeterminadoDescripción
    easingEasing | EasingPreset——
    fromScrubPose——
    rangereadonly [RangeInput, RangeInput]—Rango de la línea de tiempo propia del efecto (se ignora con timeline).
    reducedMotionReducedMotion——
    scrollAxisScrollAxis"block"Eje de scroll de la línea de tiempo propia (por defecto "block").
    smoothboolean | SpringOptions | SpringPreset—Suavizado con resorte (SP10) de la línea de tiempo propia.
    sourceElement | Window | null—Contenedor con scroll de la línea de tiempo propia (por defecto: el de la página).
    timelineScrollProgress—Una línea de tiempo compartida (p. ej. de useScrollScene()); si no, el efecto crea una.
    toScrubPose——
  • SectionSpy interface

    SectionSpy

    SectionSpy
    PropTipoPredeterminadoDescripción
    active(obligatoria)number——
    destroy(obligatoria)() => void——
    refresh(obligatoria)() => void——
  • SectionSpyHookOptions interface

    SectionSpyHookOptions

    SectionSpyHookOptions
    PropTipoPredeterminadoDescripción
    linenumber—Activation line (fraction of the viewport from the top, default 0.3).
    sourceElement | null——
  • SectionSpyOptions interface

    SectionSpyOptions

    SectionSpyOptions
    PropTipoPredeterminadoDescripción
    axisScrollAxis——
    linenumber—Línea de activación como fracción de la zona visible desde su inicio (0–1, por defecto 0.3).
    onChange(index: number, section: Element | undefined) => void—Se llama con el índice activo (-1 antes de la primera sección) y el elemento.
    sourceElement | Window | null——
  • StickyStackOptions interface

    StickyStackOptions

    StickyStackOptions
    PropTipoPredeterminadoDescripción
    rangereadonly [RangeInput, RangeInput]—Rango de la línea de tiempo propia del efecto (se ignora con timeline).
    reducedMotionReducedMotion——
    scalenumber—Escala que pierde una tarjeta cubierta por completo (0–0.5, por defecto 0.05; 0 = solo apilado CSS).
    scrollAxisScrollAxis"block"Eje de scroll de la línea de tiempo propia (por defecto "block").
    smoothboolean | SpringOptions | SpringPreset—Suavizado con resorte (SP10) de la línea de tiempo propia.
    sourceElement | Window | null—Contenedor con scroll de la línea de tiempo propia (por defecto: el de la página).
    timelineScrollProgress—Una línea de tiempo compartida (p. ej. de useScrollScene()); si no, el efecto crea una.
  • StickyStackProps interface

    StickyStackProps

    StickyStackProps
    PropTipoPredeterminadoDescripción
    childrenReactNode——
    offsetstring"1.25rem"Offset between stacked cards (CSS length, default "1.25rem").
    reducedMotionReducedMotion——
    refRef<HTMLDivElement>——
    scalenumber—Scale removed from a covered card (default 0.05; 0 = CSS only).
    topstring"1rem"Sticky top of the first card (CSS length, default "1rem").

    También acepta las props de: React DOM attributes.

  • StuckStateOptions interface

    StuckStateOptions

    StuckStateOptions
    PropTipoPredeterminadoDescripción
    onChange(stuck: boolean) => void——
    sourceElement | Window | null——
  • VelocitySkewOptions interface

    VelocitySkewOptions

    VelocitySkewOptions
    PropTipoPredeterminadoDescripción
    axis"x" | "y"——
    factornumber—Grados por px/s (0–0.05, por defecto 0.003).
    maxnumber—Inclinación máxima en grados (0–30, por defecto 8).
    reducedMotionReducedMotion——
    sourceElement | Window | null——
    springSpringOptions——
  • ZoomOnScrollOptions interface

    ZoomOnScrollOptions

    ZoomOnScrollOptions
    PropTipoPredeterminadoDescripción
    easingEasing | EasingPreset——
    fromnumber—Escala con progreso 0 (0.1–5, por defecto 1).
    rangereadonly [RangeInput, RangeInput]—Rango de la línea de tiempo propia del efecto (se ignora con timeline).
    reducedMotionReducedMotion——
    scrollAxisScrollAxis"block"Eje de scroll de la línea de tiempo propia (por defecto "block").
    smoothboolean | SpringOptions | SpringPreset—Suavizado con resorte (SP10) de la línea de tiempo propia.
    sourceElement | Window | null—Contenedor con scroll de la línea de tiempo propia (por defecto: el de la página).
    timelineScrollProgress—Una línea de tiempo compartida (p. ej. de useScrollScene()); si no, el efecto crea una.
    tonumber—Escala con progreso 1 (0.1–5, por defecto 1.2).
  • DriverPreference type
    "auto" | "native" | "js"
  • HorizontalLayout type
    "auto" | "pinned" | "stacked" | "scroll"
  • InViewInput type
    InViewPreset | InViewOptions
  • InViewPosition type
    "before" | "inside" | "after"
  • InViewPreset type
    keyof typeof inViewPresets
  • InViewProgressOptions type

    InViewProgressOptions

    InViewProgressOptions
    PropTipoPredeterminadoDescripción
    driverDriverPreference—"auto" (por defecto): scroll timeline nativa si está verificada; si no, JS.
    rangereadonly [RangeInput, RangeInput]—Rango de la línea de tiempo propia del efecto (se ignora con timeline).
    reducedMotionReducedMotion——
    scrollAxisScrollAxis"block"Eje de scroll de la línea de tiempo propia (por defecto "block").
    smoothboolean | SpringOptions | SpringPreset—Suavizado con resorte (SP10) de la línea de tiempo propia.
    sourceElement | Window | null—Contenedor con scroll de la línea de tiempo propia (por defecto: el de la página).
    timelineScrollProgress—Una línea de tiempo compartida (p. ej. de useScrollScene()); si no, el efecto crea una.
  • PinnedSceneOptions type

    PinnedSceneOptions

    PinnedSceneOptions
    PropTipoPredeterminadoDescripción
    driverDriverPreference—"auto" (por defecto): scroll timeline nativa si está verificada; si no, JS.
    rangereadonly [RangeInput, RangeInput]—Rango de la línea de tiempo propia del efecto (se ignora con timeline).
    reducedMotionReducedMotion——
    scrollAxisScrollAxis"block"Eje de scroll de la línea de tiempo propia (por defecto "block").
    smoothboolean | SpringOptions | SpringPreset—Suavizado con resorte (SP10) de la línea de tiempo propia.
    sourceElement | Window | null—Contenedor con scroll de la línea de tiempo propia (por defecto: el de la página).
    timelineScrollProgress—Una línea de tiempo compartida (p. ej. de useScrollScene()); si no, el efecto crea una.
  • RangeInput type

    A range edge. With a subject: `"<name>"` or `"<name> <percent>%"`. Without: px (number) or `"<percent>%"` of the maximum scroll.

    number | `${number}%` | RangeName | `${RangeName} ${number}%`
  • RangeName type
    (typeof RANGE_NAMES)[number]
  • ScrollAxis type
    "block" | "inline"
  • ScrollEffectProps type

    ScrollEffectProps

    ScrollEffectProps
    PropTipoPredeterminadoDescripción
    asChildboolean—Apply to the single child element instead of rendering a <div>.
    childrenReactNode——
    conflictsConflictPolicy—Conflict reporting for exclusive channels (default: warn in development).
    optionsobject—Options of a single preset.
    preset(obligatoria)AnyPreset | readonly AnyPreset[]—One scroll / scroll-trigger effect or preset, or a list composed on the element.
    refRef<HTMLDivElement>——

    También acepta las props de: React DOM attributes.

  • ScrollProgressEffectOptions type

    ScrollProgressEffectOptions

    ScrollProgressEffectOptions
    PropTipoPredeterminadoDescripción
    driverDriverPreference—"auto" (por defecto): scroll timeline nativa si está verificada; si no, JS.
    rangereadonly [RangeInput, RangeInput]—Rango de la línea de tiempo propia del efecto (se ignora con timeline).
    reducedMotionReducedMotion——
    scrollAxisScrollAxis"block"Eje de scroll de la línea de tiempo propia (por defecto "block").
    smoothboolean | SpringOptions | SpringPreset—Suavizado con resorte (SP10) de la línea de tiempo propia.
    sourceElement | Window | null—Contenedor con scroll de la línea de tiempo propia (por defecto: el de la página).
    timelineScrollProgress—Una línea de tiempo compartida (p. ej. de useScrollScene()); si no, el efecto crea una.
  • TriggerMode type
    "once" | "repeat" | "reverse"
  • TriggerState type
    "idle" | "before" | "active" | "after"
Editar en GitHub