@neshel-ui/animations/media
Every export of @neshel-ui/animations/media, generated from its declarations.
Experimental and not on npm
Signatures, members and defaults, generated from the built declarations. For explanations and examples read the guide.
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 Type Default Description blur number— Placeholder blur in px (0–40, default 16). duration number— ms (0–10000; default per effect). easing Easing | EasingPreset— — image HTMLImageElement— The image (default: the frame's first img).onStateChange (state: MediaRevealState) => void— — placeholder string— Placeholder: a tiny image URL/data URI, a CSS gradient or a colour (default a neutral tint). reducedMotion ReducedMotion— — replay boolean— Animate an image that is already loaded at attach time (default false: shown at once). revealTimeout number— ms after which a still-loading image is revealed anyway (500–60000, default 8000). CameraPoseinterfaceCameraPose
CameraPose Prop Type Default Description 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 Type Default Description destroy(required) () => void— — set(required) (value: number) => void— Set the value (0–100) without animation. value(required) number— — CompareSliderOptionsinterfaceCompareSliderOptions
CompareSliderOptions Prop Type Default Description onValueChange (value: number) => void— — orientation "horizontal" | "vertical"— — step number— Keyboard step (0.1–25, default 1). value number500–100 (default 50): share of the before image. valueText (value: number) => string"N% before, M% after"Value text for assistive technology (default "N% before, M% after"). CrossfadeControlinterfaceCrossfadeControl
CrossfadeControl Prop Type Default Description count(required) number— — destroy(required) () => void— — index(required) number— — next(required) () => void— — pause(required) () => void— Stop autoplay (WCAG 2.2.2). play(required) () => void— — prev(required) () => void— — show(required) (index: number) => void— — CrossfadeOptionsinterfaceCrossfadeOptions
CrossfadeOptions Prop Type Default Description duration number— ms (0–10000; default per effect). easing Easing | EasingPreset— — index number0Initial slide (default 0). interval number— Autoplay interval in ms (≥ 2000; none by default). Paused on hover, focus inside and hidden pages. onIndexChange (index: number) => void— — reducedMotion ReducedMotion— — DissolveControlinterfaceDissolveControl
DissolveControl Prop Type Default Description destroy(required) () => void— — index(required) number— — mode(required) "dissolve" | "fade" | "none"— dissolve(canvas) orfade(fallback) — of the last transition.running(required) boolean— — show(required) (index: number) => void— — DuotoneOptionsinterfaceDuotoneOptions
DuotoneOptions Prop Type Default Description amount number1Final amount of duotone 0–1 (default 1). duration number— ms (0–10000; default per effect). easing Easing | EasingPreset— — highlight string#f2c14eColour of the highlights (default #f2c14e).onComplete (result: MotionResult) => void— — progress ProgressSource— Drive from a 0–1 source instead of the own clock. reducedMotion ReducedMotion— — shadow string#1b1f3aColour of the shadows (default #1b1f3a). Hex#rgb/#rrggbborrgb(r g b).trigger ProgressTrigger"visible"Default "visible"(once); ignored withprogress.GalleryOptionsinterfaceGalleryOptions
GalleryOptions Prop Type Default Description duration number— ms (0–10000; default per effect). easing Easing | EasingPreset— — index number0Initial slide (default 0). onIndexChange (index: number) => void— — reducedMotion ReducedMotion— — HoverPanControlinterfaceHoverPanControl
HoverPanControl Prop Type Default Description destroy(required) () => void— — reset(required) () => void— Back to the rest pose. HoverPanOptionsinterfaceHoverPanOptions
HoverPanOptions Prop Type Default Description keyboard boolean— Focusable frame with arrow-key panning (for images whose detail is information; needs a name). media Element— The element that moves (default: the frame's first element child). pointerTypes readonly ("mouse" | "pen" | "touch")[]— Pointer types that pan (default mouse and pen; touch scrolls the page). reducedMotion ReducedMotion— — scale number1.4Zoom while hovering 1.05–3 (default 1.4). spring SpringOptions— — step number— Keyboard step as a fraction of the pan range (0.02–0.5, default 0.1). KenBurnsOptionsinterfaceKenBurnsOptions
KenBurnsOptions Prop Type Default Description duration number— ms (0–10000; default per effect). easing Easing | EasingPreset— — from CameraPose{ scale: 1.05, x: 0, y: 0 }Start pose (default { scale: 1.05, x: 0, y: 0 }).onComplete (result: MotionResult) => void— — progress ProgressSource— Drive from a 0–1 source instead of the own clock. reducedMotion ReducedMotion— — repeat number— Extra runs (0–1000 or Infinity, explicit; default 0). Paused off-screen and on hidden pages.to CameraPose{ scale: 1.18, x: 0.4, y: -0.3 }End pose (default { scale: 1.18, x: 0.4, y: -0.3 }).trigger ProgressTrigger"visible"Default "visible"(once); ignored withprogress.yoyo booleantrueAlternate direction between runs (default true). LightboxControlinterfaceLightboxControl
LightboxControl Prop Type Default Description close(required) () => void— Animated close (immediate under reduced motion). destroy(required) () => void— — open(required) () => void— — state(required) "closed" | "open" | "closing"— — LightboxZoomOptionsinterfaceLightboxZoomOptions
LightboxZoomOptions Prop Type Default Description dialog(required) HTMLDialogElement— — duration number— ms of the zoom (0–2000, default 380). getThumbnail(required) () => Element | null— The thumbnail to zoom from/to (measured at open and close). image(required) HTMLElement— The large image (or any element) that zooms. onOpenChange (open: boolean) => void— — reducedMotion ReducedMotion— — LoadRevealOptionsinterfaceLoadRevealOptions
LoadRevealOptions Prop Type Default Description direction "up" | "down" | "left" | "right"upEdge the reveal travels toward (default upfor inset,rightfor wipe).duration number— ms (0–10000; default per effect). easing Easing | EasingPreset— — onStateChange (state: MediaRevealState) => void— — reducedMotion ReducedMotion— — replay boolean— Animate an image that is already loaded at attach time (default false: shown at once). revealTimeout number— ms after which a still-loading image is revealed anyway (500–60000, default 8000). shape "inset" | "circle" | "wipe"— inset(edge wipe, default),circle(from the centre) orwipe(horizontal).MediaDebugInfointerfaceMediaDebugInfo
MediaDebugInfo Prop Type Default Description cells(required) number— — effects(required) number— — filters(required) number— — framesPresented(required) number— — hidden(required) number— — scrollLocks(required) number— — seeksCoalesced(required) number— — seeksIssued(required) number— — seeksRequested(required) number— — surfaces(required) number— — watchers(required) number— — MediaRevealControlinterfaceMediaRevealControl
MediaRevealControl Prop Type Default Description destroy(required) () => void— — reveal(required) () => void— Show the image now (no animation). state(required) MediaRevealState— — MediaRevealOptionsinterfaceMediaRevealOptions
MediaRevealOptions Prop Type Default Description duration number— ms (0–10000; default per effect). easing Easing | EasingPreset— — onStateChange (state: MediaRevealState) => void— — reducedMotion ReducedMotion— — replay boolean— Animate an image that is already loaded at attach time (default false: shown at once). revealTimeout number— ms after which a still-loading image is revealed anyway (500–60000, default 8000). MediaSupportinterfaceMediaSupport
MediaSupport Prop Type Default Description canvas2d(required) boolean— — clipPath(required) boolean— — decode(required) boolean— — dialog(required) boolean— — fastSeek(required) boolean— — inert(required) boolean— — videoFrameCallback(required) boolean— — PixelDissolveOptionsinterfacePixelDissolveOptions
PixelDissolveOptions Prop Type Default Description cell number— Cell size in CSS px (4–64, default 16); enlarged when the grid would exceed maxCells.duration number— ms (0–10000; default per effect). easing Easing | EasingPreset— — index number0Initial slide (default 0). maxCells number— Upper bound of cells (64–4096, default 4096). maxDpr number— Canvas DPR cap (1–3, default 2). onIndexChange (index: number) => void— — reducedMotion ReducedMotion— — seed number1Order seed (default 1). ProgressControlinterfaceProgressControl
ProgressControl Prop Type Default Description cancel(required) () => void— — destroy(required) () => void— Idempotent: stops, releases and restores. drive(required) (source: ProgressSource) => () => void— Follow a 0–1 source instead of the own clock; returns the unsubscribe. finish(required) () => void— — finished(required) Promise<MotionResult>— Promise of the current (or next) run. pause(required) () => void— — play(required) () => void— — progress(required) number— Rendered progress 0–1. reverse(required) () => void— — seek(required) (progress: number) => void— Render the effect at a time fraction 0–1 of its run (eased). state(required) MotionState— — track(required) (options?: ProgressTrackOptions) => ProgressTrack— A value track for createTimeline().add(…): the timeline clock drives this effect.ProgressEffectOptionsinterfaceProgressEffectOptions
ProgressEffectOptions Prop Type Default Description duration number— ms (0–10000; default per effect). easing Easing | EasingPreset— — onComplete (result: MotionResult) => void— — progress ProgressSource— Drive from a 0–1 source instead of the own clock. reducedMotion ReducedMotion— — trigger ProgressTrigger"visible"Default "visible"(once); ignored withprogress.ProgressSourceinterfaceProgressSource
Any 0–1 progress source (the 011
ScrollProgressand motion values fit).ProgressSource Prop Type Default Description get(required) () => number— — subscribe(required) (listener: (progress: number) => void) => () => void— — VideoScrubControlinterfaceVideoScrubControl
VideoScrubControl Prop Type Default Description destroy(required) () => void— — drive(required) (source: ProgressSource) => () => void— Follow another source; returns the unsubscribe. seek(required) (progress: number) => void— Request a progress 0–1 directly. state(required) "waiting" | "ready" | "reduced"— waiting(no metadata yet),ready,reduced.target(required) number— Newest requested time (s) or NaN. VideoScrubOptionsinterfaceVideoScrubOptions
VideoScrubOptions Prop Type Default Description precision "exact" | "fast"— exact(default) orfast(keyframe seeks viafastSeekwhere available).progress ProgressSource— 0–1 source (required unless you call drive()later).range readonly [number, number]— Time range in s mapped to 0–1 (default the whole duration). reducedMotion ReducedMotion— — restTime number— s shown under reduced motion (default: the current time). restore booleanfalseRestore the original currentTimeon destroy (default false).tolerance number— s; smaller differences are not sought (0–1, default 1/60). WatchImageOptionsinterfaceWatchImageOptions
WatchImageOptions Prop Type Default Description decode booleantrueAwait img.decode()afterload(default true).BlurUpImagePropstypeBlurUpImageProps
BlurUpImageProps Prop Type Default Description blur number— Placeholder blur in px (0–40, default 16). controlRef RefObject<C | null>— — duration number— ms (0–10000; default per effect). easing Easing | EasingPreset— — frameClassName string— Class of the wrapper span.neshel-blurup.onRevealStateChange BlurUpOptions["onStateChange"]— — placeholder string— Placeholder: a tiny image URL/data URI, a CSS gradient or a colour (default a neutral tint). reducedMotion ReducedMotion— — replay boolean— Animate an image that is already loaded at attach time (default false: shown at once). revealTimeout number— ms after which a still-loading image is revealed anyway (500–60000, default 8000). Also accepts the props of: React DOM attributes.
CompareSliderPropstypeCompareSliderProps
CompareSliderProps Prop Type Default Description after(required) ReactNode— — before(required) ReactNode— — controlRef RefObject<C | null>— — defaultValue number— — jumps { before: string; after: string; }— Labels of optional "show before"/"show after" buttons (comparison without dragging). label(required) 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— — Also accepts the props of: React DOM attributes.
CrossfadePropstypeCrossfadeProps
CrossfadeProps Prop Type Default Description children(required) ReactNode— — controlRef RefObject<C | null>— — duration number— ms (0–10000; default per effect). easing Easing | EasingPreset— — index number0Initial slide (default 0). interval number— Autoplay interval in ms (≥ 2000; none by default). Paused on hover, focus inside and hidden pages. onIndexChange (index: number) => void— — reducedMotion ReducedMotion— — Also accepts the props of: React DOM attributes.
DuotonePropstypeDuotoneProps
DuotoneProps Prop Type Default Description amount number1Final amount of duotone 0–1 (default 1). children(required) ReactElement— — controlRef RefObject<C | null>— — duration number— ms (0–10000; default per effect). easing Easing | EasingPreset— — highlight string#f2c14eColour of the highlights (default #f2c14e).onComplete (result: MotionResult) => void— — progress ProgressSource— Drive from a 0–1 source instead of the own clock. reducedMotion ReducedMotion— — shadow string#1b1f3aColour of the shadows (default #1b1f3a). Hex#rgb/#rrggbborrgb(r g b).trigger ProgressTrigger"visible"Default "visible"(once); ignored withprogress.HoverPanPropstypeHoverPanProps
HoverPanProps Prop Type Default Description children(required) ReactElement— — controlRef RefObject<C | null>— — keyboard boolean— Focusable frame with arrow-key panning (for images whose detail is information; needs a name). label string— Accessible name of the focusable frame (required with keyboard).pointerTypes readonly ("mouse" | "pen" | "touch")[]— Pointer types that pan (default mouse and pen; touch scrolls the page). reducedMotion ReducedMotion— — scale number1.4Zoom while hovering 1.05–3 (default 1.4). spring SpringOptions— — step number— Keyboard step as a fraction of the pan range (0.02–0.5, default 0.1). Also accepts the props of: 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 Type Default Description children(required) ReactElement— — controlRef RefObject<C | null>— — duration number— ms (0–10000; default per effect). easing Easing | EasingPreset— — from CameraPose{ scale: 1.05, x: 0, y: 0 }Start pose (default { scale: 1.05, x: 0, y: 0 }).onComplete (result: MotionResult) => void— — progress ProgressSource— Drive from a 0–1 source instead of the own clock. reducedMotion ReducedMotion— — repeat number— Extra runs (0–1000 or Infinity, explicit; default 0). Paused off-screen and on hidden pages.to CameraPose{ scale: 1.18, x: 0.4, y: -0.3 }End pose (default { scale: 1.18, x: 0.4, y: -0.3 }).trigger ProgressTrigger"visible"Default "visible"(once); ignored withprogress.yoyo booleantrueAlternate direction between runs (default true). Also accepts the props of: React DOM attributes.
LightboxPropstypeLightboxProps
LightboxProps Prop Type Default Description children(required) ReactNode— Large content; its first element zooms from the thumbnail. className string— — closeLabel string— — controlRef RefObject<C | null>— — duration number— — label(required) string— Accessible name of the dialog (required). onOpenChange (open: boolean) => void— — reducedMotion LightboxOptionsPolicy— — thumbnail(required) 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 Type Default Description children(required) ReactElement— One native <img>.controlRef RefObject<C | null>— — direction "up" | "down" | "left" | "right"upEdge the reveal travels toward (default upfor inset,rightfor wipe).duration number— ms (0–10000; default per effect). easing Easing | EasingPreset— — onStateChange (state: MediaRevealState) => void— — reducedMotion ReducedMotion— — replay boolean— Animate an image that is already loaded at attach time (default false: shown at once). revealTimeout number— ms after which a still-loading image is revealed anyway (500–60000, default 8000). shape "inset" | "circle" | "wipe"— inset(edge wipe, default),circle(from the centre) orwipe(horizontal).MediaRevealStatetype"loading" | "revealing" | "shown" | "error"PixelDissolvePropstypePixelDissolveProps
PixelDissolveProps Prop Type Default Description cell number— Cell size in CSS px (4–64, default 16); enlarged when the grid would exceed maxCells.children(required) ReactNode— — controlRef RefObject<C | null>— — duration number— ms (0–10000; default per effect). easing Easing | EasingPreset— — index number0Initial slide (default 0). maxCells number— Upper bound of cells (64–4096, default 4096). maxDpr number— Canvas DPR cap (1–3, default 2). onIndexChange (index: number) => void— — reducedMotion ReducedMotion— — seed number1Order seed (default 1). Also accepts the props of: React DOM attributes.
ProgressTriggertype"visible" | "mount" | "manual"