@neshel-ui/animations/media
Todas las exportaciones de @neshel-ui/animations/media, generadas desde sus declaraciones.
Experimental y no disponible en npm
Firmas, miembros y valores por defecto, generados desde las declaraciones compiladas. Las explicaciones y los ejemplos están en la guía.
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.
BlurUpImagecomponentM02 — a native `<img>` with a blurred placeholder until it is decoded (visible without JavaScript).
(props: BlurUpImageProps): ElementCompareSlidercomponentM04 — before/after comparison with a native range input (keyboard, touch, pointer, value text).
(props: CompareSliderProps): ElementCrossfadecomponentM08 — stacked slides cross-fading to `index` (inactive slides inert and hidden from AT).
(props: CrossfadeProps): ElementDuotonecomponentM05 — duotone transition on the single child (image untouched; filter restored on cleanup).
({ children, controlRef, ...options }: DuotoneProps): ElementHoverPancomponentM10 — the single media child follows the pointer inside a clipping frame.
(props: HoverPanProps): ElementKenBurnscomponentM01 — a clipping frame (`div.neshel-kenburns`) around one image or video.
(props: KenBurnsProps): ElementLightboxcomponentM07 — thumbnail button + native modal `<dialog>` with a FLIP zoom (focus, Escape, scroll lock).
(props: LightboxProps): ElementLoadRevealcomponentM03 — reveal the single `<img>` child when (and only if) it finishes loading.
({ children, controlRef, ...options }: LoadRevealProps): ElementPixelDissolvecomponentM09 — block dissolve between stacked images on a decorative canvas (cross-fade fallback).
(props: PixelDissolveProps): ElementcameraValuesfunctionBounded pose → channel values (`translate` in % of the media box).
(scale: number, x: number, y: number): { scale: string; translate: string; }createBlurUpfunctionM02 — a blurred placeholder layer fades out as the decoded image fades in.
(frame: HTMLElement, options?: BlurUpOptions | undefined): MediaRevealControlcreateCompareSliderfunction(root: HTMLElement, options?: CompareSliderOptions | undefined): CompareControlcreateCrossfadefunctionM08 — cross-fade between slides; interruptible from the current opacities.
(container: HTMLElement, options?: CrossfadeOptions | undefined): CrossfadeControlcreateDuotonefunction(element: Element, options?: DuotoneOptions | undefined): ProgressControlcreateHoverPanfunctionM10 — the media follows the pointer inside its frame (bounded, springy, restored on leave).
(frame: HTMLElement, options?: HoverPanOptions | undefined): HoverPanControlcreateKenBurnsfunctionM01 — slow bounded camera move over an image or video inside a clipping frame.
(media: Element, options?: KenBurnsOptions | undefined): ProgressControlcreateLightboxZoomfunction(options: LightboxZoomOptions): LightboxControlcreateLoadRevealfunctionM03 — the image is revealed by a clip when (and only if) it finishes loading.
(img: HTMLImageElement, options?: LoadRevealOptions | undefined): MediaRevealControlcreatePixelDissolvefunctionM09 — block dissolve between images on a Canvas 2D surface; cross-fade fallback.
(container: HTMLElement, options?: PixelDissolveOptions | undefined): DissolveControlcreateVideoScrubfunction(video: HTMLVideoElement, options?: VideoScrubOptions | undefined): VideoScrubControlgetMediaDebugInfofunction(): MediaDebugInfogetMediaSupportfunction(): MediaSupportuseKenBurnsfunctionM01 — Ken Burns on a media element you render inside a clipping frame.
(ref: RefObject<Element | null>, options?: KenBurnsOptions | undefined): RefObject<ProgressControl | null>useVideoScrubfunctionM06 — scrub a `<video>` you render from a 0–1 progress source (never plays it).
(ref: RefObject<HTMLVideoElement | null>, options: VideoScrubOptions): RefObject<VideoScrubControl | null>watchImagefunction(img: HTMLImageElement, onChange: (state: ImageLoadState) => void, options?: WatchImageOptions | undefined): () => voidBlurUpOptionsinterfaceBlurUpOptions
BlurUpOptions Prop Tipo Predeterminado Descripción blur number— Desenfoque del marcador en px (0–40, por defecto 16). duration number— ms (0–10000; por defecto según el efecto). easing Easing | EasingPreset— — image HTMLImageElement— La imagen (por defecto: el primer imgdel marco).onStateChange (state: MediaRevealState) => void— — placeholder string— Marcador: URL o data URI de una imagen mínima, un degradado CSS o un color (por defecto un tono neutro). reducedMotion ReducedMotion— — replay boolean— Anima una imagen que ya estaba cargada (por defecto false: se muestra al instante). revealTimeout number— ms tras los que se muestra igualmente una imagen que sigue cargando (500–60000, por defecto 8000). CameraPoseinterfaceCameraPose
CameraPose Prop Tipo Predeterminado Descripción scale number— Uniform zoom 1–3. x number— −1 (left) … 1 (right) of the pan allowance. y number— −1 (top) … 1 (bottom) of the pan allowance. CompareControlinterfaceCompareControl
CompareControl Prop Tipo Predeterminado Descripción destroy(obligatoria) () => void— — set(obligatoria) (value: number) => void— Set the value (0–100) without animation. value(obligatoria) number— — CompareSliderOptionsinterfaceCompareSliderOptions
CompareSliderOptions Prop Tipo Predeterminado Descripción onValueChange (value: number) => void— — orientation "horizontal" | "vertical"— — step number— Paso de teclado (0.1–25, por defecto 1). value number500–100 (por defecto 50): parte visible de la imagen «antes». valueText (value: number) => string"N% before, M% after"Texto del valor para tecnología de asistencia (por defecto "N% before, M% after"). CrossfadeControlinterfaceCrossfadeControl
CrossfadeControl Prop Tipo Predeterminado Descripción count(obligatoria) number— — destroy(obligatoria) () => void— — index(obligatoria) number— — next(obligatoria) () => void— — pause(obligatoria) () => void— Stop autoplay (WCAG 2.2.2). play(obligatoria) () => void— — prev(obligatoria) () => void— — show(obligatoria) (index: number) => void— — CrossfadeOptionsinterfaceCrossfadeOptions
CrossfadeOptions Prop Tipo Predeterminado Descripción duration number— ms (0–10000; por defecto según el efecto). easing Easing | EasingPreset— — index number0Diapositiva inicial (por defecto 0). interval number— Intervalo automático en ms (≥ 2000; ninguno por defecto). Se pausa con hover, foco dentro y página oculta. onIndexChange (index: number) => void— — reducedMotion ReducedMotion— — DissolveControlinterfaceDissolveControl
DissolveControl Prop Tipo Predeterminado Descripción destroy(obligatoria) () => void— — index(obligatoria) number— — mode(obligatoria) "dissolve" | "fade" | "none"— dissolve(canvas) orfade(fallback) — of the last transition.running(obligatoria) boolean— — show(obligatoria) (index: number) => void— — DuotoneOptionsinterfaceDuotoneOptions
DuotoneOptions Prop Tipo Predeterminado Descripción amount number1Cantidad final de duotono 0–1 (por defecto 1). duration number— ms (0–10000; por defecto según el efecto). easing Easing | EasingPreset— — highlight string#f2c14eColor de las luces (por defecto #f2c14e).onComplete (result: MotionResult) => void— — progress ProgressSource— Se dirige con una fuente de 0 a 1 en lugar de su propio reloj. reducedMotion ReducedMotion— — shadow string#1b1f3aColor de las sombras (por defecto #1b1f3a). Hex#rgb/#rrggbborgb(r g b).trigger ProgressTrigger"visible"Por defecto "visible"(una vez); se ignora conprogress.GalleryOptionsinterfaceGalleryOptions
GalleryOptions Prop Tipo Predeterminado Descripción duration number— ms (0–10000; por defecto según el efecto). easing Easing | EasingPreset— — index number0Diapositiva inicial (por defecto 0). onIndexChange (index: number) => void— — reducedMotion ReducedMotion— — HoverPanControlinterfaceHoverPanControl
HoverPanControl Prop Tipo Predeterminado Descripción destroy(obligatoria) () => void— — reset(obligatoria) () => void— Back to the rest pose. HoverPanOptionsinterfaceHoverPanOptions
HoverPanOptions Prop Tipo Predeterminado Descripción keyboard boolean— Marco enfocable con desplazamiento por flechas (para imágenes cuyo detalle es información; necesita nombre). media Element— El elemento que se mueve (por defecto: el primer hijo del marco). pointerTypes readonly ("mouse" | "pen" | "touch")[]— Tipos de puntero que desplazan (por defecto ratón y lápiz; el tacto desplaza la página). reducedMotion ReducedMotion— — scale number1.4Zoom con hover 1.05–3 (por defecto 1.4). spring SpringOptions— — step number— Paso de teclado como fracción del recorrido (0.02–0.5, por defecto 0.1). KenBurnsOptionsinterfaceKenBurnsOptions
KenBurnsOptions Prop Tipo Predeterminado Descripción duration number— ms (0–10000; por defecto según el efecto). easing Easing | EasingPreset— — from CameraPose{ scale: 1.05, x: 0, y: 0 }Pose inicial (por defecto { scale: 1.05, x: 0, y: 0 }).onComplete (result: MotionResult) => void— — progress ProgressSource— Se dirige con una fuente de 0 a 1 en lugar de su propio reloj. reducedMotion ReducedMotion— — repeat number— Ejecuciones extra (0–1000 o Infinity, explícito; por defecto 0). Se pausa fuera de pantalla y con la página oculta.to CameraPose{ scale: 1.18, x: 0.4, y: -0.3 }Pose final (por defecto { scale: 1.18, x: 0.4, y: -0.3 }).trigger ProgressTrigger"visible"Por defecto "visible"(una vez); se ignora conprogress.yoyo booleantrueAlterna la dirección entre ejecuciones (por defecto true). LightboxControlinterfaceLightboxControl
LightboxControl Prop Tipo Predeterminado Descripción close(obligatoria) () => void— Animated close (immediate under reduced motion). destroy(obligatoria) () => void— — open(obligatoria) () => void— — state(obligatoria) "closed" | "open" | "closing"— — LightboxZoomOptionsinterfaceLightboxZoomOptions
LightboxZoomOptions Prop Tipo Predeterminado Descripción dialog(obligatoria) HTMLDialogElement— — duration number— ms del zoom (0–2000, por defecto 380). getThumbnail(obligatoria) () => Element | null— La miniatura desde y hacia la que se amplía (medida al abrir y al cerrar). image(obligatoria) HTMLElement— La imagen grande (o cualquier elemento) que se amplía. onOpenChange (open: boolean) => void— — reducedMotion ReducedMotion— — LoadRevealOptionsinterfaceLoadRevealOptions
LoadRevealOptions Prop Tipo Predeterminado Descripción direction "up" | "down" | "left" | "right"upBorde hacia el que avanza el revelado (por defecto upen inset,righten wipe).duration number— ms (0–10000; por defecto según el efecto). easing Easing | EasingPreset— — onStateChange (state: MediaRevealState) => void— — reducedMotion ReducedMotion— — replay boolean— Anima una imagen que ya estaba cargada (por defecto false: se muestra al instante). revealTimeout number— ms tras los que se muestra igualmente una imagen que sigue cargando (500–60000, por defecto 8000). shape "inset" | "circle" | "wipe"— inset(desde un borde, por defecto),circle(desde el centro) owipe(horizontal).MediaDebugInfointerfaceMediaDebugInfo
MediaDebugInfo Prop Tipo Predeterminado Descripción cells(obligatoria) number— — effects(obligatoria) number— — filters(obligatoria) number— — framesPresented(obligatoria) number— — hidden(obligatoria) number— — scrollLocks(obligatoria) number— — seeksCoalesced(obligatoria) number— — seeksIssued(obligatoria) number— — seeksRequested(obligatoria) number— — surfaces(obligatoria) number— — watchers(obligatoria) number— — MediaRevealControlinterfaceMediaRevealControl
MediaRevealControl Prop Tipo Predeterminado Descripción destroy(obligatoria) () => void— — reveal(obligatoria) () => void— Show the image now (no animation). state(obligatoria) MediaRevealState— — MediaRevealOptionsinterfaceMediaRevealOptions
MediaRevealOptions Prop Tipo Predeterminado Descripción duration number— ms (0–10000; por defecto según el efecto). easing Easing | EasingPreset— — onStateChange (state: MediaRevealState) => void— — reducedMotion ReducedMotion— — replay boolean— Anima una imagen que ya estaba cargada (por defecto false: se muestra al instante). revealTimeout number— ms tras los que se muestra igualmente una imagen que sigue cargando (500–60000, por defecto 8000). MediaSupportinterfaceMediaSupport
MediaSupport Prop Tipo Predeterminado Descripción canvas2d(obligatoria) boolean— — clipPath(obligatoria) boolean— — decode(obligatoria) boolean— — dialog(obligatoria) boolean— — fastSeek(obligatoria) boolean— — inert(obligatoria) boolean— — videoFrameCallback(obligatoria) boolean— — PixelDissolveOptionsinterfacePixelDissolveOptions
PixelDissolveOptions Prop Tipo Predeterminado Descripción cell number— Tamaño de celda en px CSS (4–64, por defecto 16); aumenta si la cuadrícula supera maxCells.duration number— ms (0–10000; por defecto según el efecto). easing Easing | EasingPreset— — index number0Diapositiva inicial (por defecto 0). maxCells number— Límite de celdas (64–4096, por defecto 4096). maxDpr number— Límite de densidad del canvas (1–3, por defecto 2). onIndexChange (index: number) => void— — reducedMotion ReducedMotion— — seed number1Semilla del orden (por defecto 1). ProgressControlinterfaceProgressControl
ProgressControl Prop Tipo Predeterminado Descripción cancel(obligatoria) () => void— — destroy(obligatoria) () => void— Idempotent: stops, releases and restores. drive(obligatoria) (source: ProgressSource) => () => void— Follow a 0–1 source instead of the own clock; returns the unsubscribe. finish(obligatoria) () => void— — finished(obligatoria) Promise<MotionResult>— Promise of the current (or next) run. pause(obligatoria) () => void— — play(obligatoria) () => void— — progress(obligatoria) number— Rendered progress 0–1. reverse(obligatoria) () => void— — seek(obligatoria) (progress: number) => void— Render the effect at a time fraction 0–1 of its run (eased). state(obligatoria) MotionState— — track(obligatoria) (options?: ProgressTrackOptions) => ProgressTrack— A value track for createTimeline().add(…): the timeline clock drives this effect.ProgressEffectOptionsinterfaceProgressEffectOptions
ProgressEffectOptions Prop Tipo Predeterminado Descripción duration number— ms (0–10000; por defecto según el efecto). easing Easing | EasingPreset— — onComplete (result: MotionResult) => void— — progress ProgressSource— Se dirige con una fuente de 0 a 1 en lugar de su propio reloj. reducedMotion ReducedMotion— — trigger ProgressTrigger"visible"Por defecto "visible"(una vez); se ignora conprogress.ProgressSourceinterfaceProgressSource
Any 0–1 progress source (the 011
ScrollProgressand motion values fit).ProgressSource Prop Tipo Predeterminado Descripción get(obligatoria) () => number— — subscribe(obligatoria) (listener: (progress: number) => void) => () => void— — VideoScrubControlinterfaceVideoScrubControl
VideoScrubControl Prop Tipo Predeterminado Descripción destroy(obligatoria) () => void— — drive(obligatoria) (source: ProgressSource) => () => void— Follow another source; returns the unsubscribe. seek(obligatoria) (progress: number) => void— Request a progress 0–1 directly. state(obligatoria) "waiting" | "ready" | "reduced"— waiting(no metadata yet),ready,reduced.target(obligatoria) number— Newest requested time (s) or NaN. VideoScrubOptionsinterfaceVideoScrubOptions
VideoScrubOptions Prop Tipo Predeterminado Descripción precision "exact" | "fast"— exact(por defecto) ofast(búsquedas por fotograma clave confastSeeksi existe).progress ProgressSource— Fuente de 0 a 1 (obligatoria salvo que llames a drive()después).range readonly [number, number]— Intervalo de tiempo en s asignado a 0–1 (por defecto toda la duración). reducedMotion ReducedMotion— — restTime number— s mostrado con movimiento reducido (por defecto: el tiempo actual). restore booleanfalseRestaura el currentTimeoriginal al destruir (por defecto false).tolerance number— s; las diferencias menores no se buscan (0–1, por defecto 1/60). WatchImageOptionsinterfaceWatchImageOptions
WatchImageOptions Prop Tipo Predeterminado Descripción decode booleantrueAwait img.decode()afterload(default true).BlurUpImagePropstypeBlurUpImageProps
BlurUpImageProps Prop Tipo Predeterminado Descripción blur number— Desenfoque del marcador en px (0–40, por defecto 16). controlRef RefObject<C | null>— — duration number— ms (0–10000; por defecto según el efecto). easing Easing | EasingPreset— — frameClassName string— Class of the wrapper span.neshel-blurup.onRevealStateChange BlurUpOptions["onStateChange"]— — placeholder string— Marcador: URL o data URI de una imagen mínima, un degradado CSS o un color (por defecto un tono neutro). reducedMotion ReducedMotion— — replay boolean— Anima una imagen que ya estaba cargada (por defecto false: se muestra al instante). revealTimeout number— ms tras los que se muestra igualmente una imagen que sigue cargando (500–60000, por defecto 8000). También acepta las props de: React DOM attributes.
CompareSliderPropstypeCompareSliderProps
CompareSliderProps Prop Tipo Predeterminado Descripción after(obligatoria) ReactNode— — before(obligatoria) ReactNode— — controlRef RefObject<C | null>— — defaultValue number— — jumps { before: string; after: string; }— Labels of optional "show before"/"show after" buttons (comparison without dragging). label(obligatoria) string— Accessible name of the slider (required). onValueChange (value: number) => void— — orientation "horizontal" | "vertical"— — step number— — value number— Controlled value 0–100. valueText (value: number) => string— — También acepta las props de: React DOM attributes.
CrossfadePropstypeCrossfadeProps
CrossfadeProps Prop Tipo Predeterminado Descripción children(obligatoria) ReactNode— — controlRef RefObject<C | null>— — duration number— ms (0–10000; por defecto según el efecto). easing Easing | EasingPreset— — index number0Diapositiva inicial (por defecto 0). interval number— Intervalo automático en ms (≥ 2000; ninguno por defecto). Se pausa con hover, foco dentro y página oculta. onIndexChange (index: number) => void— — reducedMotion ReducedMotion— — También acepta las props de: React DOM attributes.
DuotonePropstypeDuotoneProps
DuotoneProps Prop Tipo Predeterminado Descripción amount number1Cantidad final de duotono 0–1 (por defecto 1). children(obligatoria) ReactElement— — controlRef RefObject<C | null>— — duration number— ms (0–10000; por defecto según el efecto). easing Easing | EasingPreset— — highlight string#f2c14eColor de las luces (por defecto #f2c14e).onComplete (result: MotionResult) => void— — progress ProgressSource— Se dirige con una fuente de 0 a 1 en lugar de su propio reloj. reducedMotion ReducedMotion— — shadow string#1b1f3aColor de las sombras (por defecto #1b1f3a). Hex#rgb/#rrggbborgb(r g b).trigger ProgressTrigger"visible"Por defecto "visible"(una vez); se ignora conprogress.HoverPanPropstypeHoverPanProps
HoverPanProps Prop Tipo Predeterminado Descripción children(obligatoria) ReactElement— — controlRef RefObject<C | null>— — keyboard boolean— Marco enfocable con desplazamiento por flechas (para imágenes cuyo detalle es información; necesita nombre). label string— Accessible name of the focusable frame (required with keyboard).pointerTypes readonly ("mouse" | "pen" | "touch")[]— Tipos de puntero que desplazan (por defecto ratón y lápiz; el tacto desplaza la página). reducedMotion ReducedMotion— — scale number1.4Zoom con hover 1.05–3 (por defecto 1.4). spring SpringOptions— — step number— Paso de teclado como fracción del recorrido (0.02–0.5, por defecto 0.1). También acepta las props de: React DOM attributes.
ImageLoadStatetypeImage load watcher (Phase 015, internal; research R1, contracts/media-api.md §1). Reports `loading`, `loaded` or `error` for an `<img>` WITHOUT missing a `load` that happened before it was attached: the first report is synchronous from `complete`/`naturalWidth`. `load` waits for `decode()` (rejection tolerated — the state is re-read) so a reveal never shows a half-decoded frame. A MutationObserver on `src`/`srcset`/`sizes` re-evaluates after an explicit source change; answers of an older generation are dropped. Native attributes are never written. A responsive `srcset` candidate swap (viewport/DPR) keeps the current image visible, so it only reports `loaded` again.
"loading" | "loaded" | "error"KenBurnsPropstypeKenBurnsProps
KenBurnsProps Prop Tipo Predeterminado Descripción children(obligatoria) ReactElement— — controlRef RefObject<C | null>— — duration number— ms (0–10000; por defecto según el efecto). easing Easing | EasingPreset— — from CameraPose{ scale: 1.05, x: 0, y: 0 }Pose inicial (por defecto { scale: 1.05, x: 0, y: 0 }).onComplete (result: MotionResult) => void— — progress ProgressSource— Se dirige con una fuente de 0 a 1 en lugar de su propio reloj. reducedMotion ReducedMotion— — repeat number— Ejecuciones extra (0–1000 o Infinity, explícito; por defecto 0). Se pausa fuera de pantalla y con la página oculta.to CameraPose{ scale: 1.18, x: 0.4, y: -0.3 }Pose final (por defecto { scale: 1.18, x: 0.4, y: -0.3 }).trigger ProgressTrigger"visible"Por defecto "visible"(una vez); se ignora conprogress.yoyo booleantrueAlterna la dirección entre ejecuciones (por defecto true). También acepta las props de: React DOM attributes.
LightboxPropstypeLightboxProps
LightboxProps Prop Tipo Predeterminado Descripción children(obligatoria) ReactNode— Large content; its first element zooms from the thumbnail. className string— — closeLabel string— — controlRef RefObject<C | null>— — duration number— — label(obligatoria) string— Accessible name of the dialog (required). onOpenChange (open: boolean) => void— — reducedMotion LightboxOptionsPolicy— — thumbnail(obligatoria) ReactElement— The thumbnail (usually an <img>); rendered inside the trigger button.triggerLabel string— Accessible name of the trigger (default: the thumbnail's alt text). LoadRevealPropstypeLoadRevealProps
LoadRevealProps Prop Tipo Predeterminado Descripción children(obligatoria) ReactElement— One native <img>.controlRef RefObject<C | null>— — direction "up" | "down" | "left" | "right"upBorde hacia el que avanza el revelado (por defecto upen inset,righten wipe).duration number— ms (0–10000; por defecto según el efecto). easing Easing | EasingPreset— — onStateChange (state: MediaRevealState) => void— — reducedMotion ReducedMotion— — replay boolean— Anima una imagen que ya estaba cargada (por defecto false: se muestra al instante). revealTimeout number— ms tras los que se muestra igualmente una imagen que sigue cargando (500–60000, por defecto 8000). shape "inset" | "circle" | "wipe"— inset(desde un borde, por defecto),circle(desde el centro) owipe(horizontal).MediaRevealStatetype"loading" | "revealing" | "shown" | "error"PixelDissolvePropstypePixelDissolveProps
PixelDissolveProps Prop Tipo Predeterminado Descripción cell number— Tamaño de celda en px CSS (4–64, por defecto 16); aumenta si la cuadrícula supera maxCells.children(obligatoria) ReactNode— — controlRef RefObject<C | null>— — duration number— ms (0–10000; por defecto según el efecto). easing Easing | EasingPreset— — index number0Diapositiva inicial (por defecto 0). maxCells number— Límite de celdas (64–4096, por defecto 4096). maxDpr number— Límite de densidad del canvas (1–3, por defecto 2). onIndexChange (index: number) => void— — reducedMotion ReducedMotion— — seed number1Semilla del orden (por defecto 1). También acepta las props de: React DOM attributes.
ProgressTriggertype"visible" | "mount" | "manual"