@neshel-ui/animations/svg
Every export of @neshel-ui/animations/svg, 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.
MorphIconcomponentS04 — a decorative stroked icon morphing between named states.
({ shapes, state, duration, title, controlRef, ...rest }: MorphIconProps): ElementPathDrawcomponentS01 — draw the single SVG geometry child.
({ children, controlRef, ...options }: PathDrawProps): ElementSuccessCheckcomponentS10 — success checkmark (decorative by default; no role or live region is added).
(props: SuccessCheckProps): ElementcreateChartDrawfunctionS06 — draw the consumer's chart lines; reveal points as the line passes them (no charting engine).
(svg: Element, options: ChartDrawOptions): ProgressControlcreateCheckmarkfunctionS10 — draw a success checkmark (circle, then check). Adds no role or live region.
(svg: Element, options?: CheckmarkOptions | undefined): ProgressControlcreateDashFlowfunctionS09 — marching ants: dashes flowing along paths while visible.
(paths: Element | Iterable<Element>, options?: DashFlowOptions | undefined): LoopEffectControlcreateGradientStopsfunctionS05 — animate the colours, opacities and offsets of a gradient's stops.
(gradient: Element, options: GradientStopsOptions): LoopEffectControlcreateIconMorphfunctionS04 — morph an icon path between named states.
(path: Element, options: IconMorphOptions): IconMorphControlcreateLogoRevealfunction(element: Element, options?: LogoRevealOptions | undefined): ProgressControlcreateMotionPathfunction(element: Element, options: MotionPathOptions): MotionPathControlcreatePathDrawfunctionS01 — draw one or more SVG geometry elements.
(paths: Element | Iterable<Element>, options?: PathDrawOptions | undefined): ProgressControlcreatePathMorphfunctionS02 — morph a `<path>` between compatible shapes.
(path: Element, options: PathMorphOptions): PathMorphControlcreateTurbulencefunctionS07 — turbulence wobble through a package SVG filter (bounded; off under reduced motion).
(element: Element, options?: TurbulenceOptions | undefined): LoopEffectControlgetPathGeometryfunctionGeometry of a path (`d` string or parsed commands).
(path: string | readonly PathCommand[]): PathGeometrygetPathMorphCompatibilityfunctionWhether two paths can be morphed under the policy (parse errors propagate).
(from: string, to: string, options?: MorphOptions | undefined): MorphCompatibilitygetSvgDebugInfofunction(): SvgDebugInfogetSvgSupportfunction(): SvgSupportinterpolatePathfunction`t ↦ d` between two compatible paths; throws `NeshelAnimationsError` naming the first mismatch.
(from: string, to: string, options?: MorphOptions | undefined): (t: number) => stringmeasurePathfunctionLength in user units: native `getTotalLength()` when available and finite, else the JS geometry.
(element: Element): numberparsePathDatafunctionParse path data into the exact normal form (contracts/svg-geometry.md §1).
(d: string): PathCommand[]serializePathDatafunctionSerialise commands (absolute) rounded to `precision` decimals (0–6, default 3).
(commands: readonly PathCommand[], precision?: number | undefined): stringuseChartDrawfunctionS06
(ref: RefObject<Element | null>, options: ChartDrawOptions): RefObject<ProgressControl | null>useDashFlowfunctionS09
(ref: RefObject<Element | null>, options?: DashFlowOptions | undefined): RefObject<LoopEffectControl | null>useGradientStopsfunctionS05
(ref: RefObject<Element | null>, options: GradientStopsOptions): RefObject<LoopEffectControl | null>useLogoRevealfunctionS08
(ref: RefObject<Element | null>, options?: LogoRevealOptions | undefined): RefObject<ProgressControl | null>useMotionPathfunctionS03
(ref: RefObject<Element | null>, options: MotionPathOptions): RefObject<MotionPathControl | null>usePathDrawfunctionS01
(ref: RefObject<Element | null>, options?: PathDrawOptions | undefined): RefObject<ProgressControl | null>usePathMorphfunctionS02
(ref: RefObject<Element | null>, options: PathMorphOptions): RefObject<PathMorphControl | null>useTurbulencefunctionS07
(ref: RefObject<Element | null>, options?: TurbulenceOptions | undefined): RefObject<LoopEffectControl | null>menuCloseShapesconstA compatible menu ↔ close pair (24×24 viewBox, three strokes each; the middle bar becomes a diagonal).
Readonly<{ menu: "M4 6L20 6M4 12L20 12M4 18L20 18"; close: "M6 6L18 18M6 6L18 18M6 18L18 6"; }>ChartDrawOptionsinterfaceChartDrawOptions
ChartDrawOptions Prop Type Default Description duration number— ms (0–10000; default per effect). easing Easing | EasingPreset— — lines(required) string | Element | Iterable<Element>— Line elements (or a selector inside the svg). onComplete (result: MotionResult) => void— — points string | Element | Iterable<Element>— Point markers revealed when the line passes them (selector or elements). progress ProgressSource— Drive from a 0–1 source instead of the own clock. reducedMotion ReducedMotion— — stagger number150ms between lines (default 150). trigger ProgressTrigger"visible"Default "visible"(once); ignored withprogress.CheckmarkOptionsinterfaceCheckmarkOptions
CheckmarkOptions Prop Type Default Description checkElement Element— Check element (default: the last path/polylinein the svg).circle booleantrueDraw the circle first (default true). circleElement Element— Circle element (default: the first circle/pathin the svg whencircleis true).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.DashFlowOptionsinterfaceDashFlowOptions
DashFlowOptions Prop Type Default Description dash number— Dash length (user units, default 6). duration number— One cycle, ms. gap number— Gap length (user units, default 4). onComplete () => void— — reducedMotion ReducedMotion— — repeat number— Extra cycles (0–1000 or Infinity, explicit).speed number— Units per second, negative reverses (−400–400; default 40). trigger "visible" | "mount" | "manual"— visible/mountstart on creation (default);manualwaits forplay().GradientStopinterfaceGradientStop
GradientStop Prop Type Default Description color readonly [string, string]— — offset readonly [number, number]— — opacity readonly [number, number]— — GradientStopsOptionsinterfaceGradientStopsOptions
GradientStopsOptions Prop Type Default Description duration number— One cycle, ms. onComplete () => void— — reducedMotion ReducedMotion— — repeat number— Extra cycles (0–1000 or Infinity, explicit).stops(required) readonly (GradientStop | undefined)[]— Per stop (by index among the gradient's <stop>children).trigger "visible" | "mount" | "manual"— visible/mountstart on creation (default);manualwaits forplay().yoyo booleantrueAlternate back and forth inside a cycle (default true). IconMorphControlinterfaceIconMorphControl
IconMorphControl 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. name(required) string— The current (target) state name. 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). set(required) (name: string) => Promise<unknown>— — state(required) PathMorphControl["state"]— — track(required) (options?: ProgressTrackOptions) => ProgressTrack— A value track for createTimeline().add(…): the timeline clock drives this effect.IconMorphOptionsinterfaceIconMorphOptions
IconMorphOptions Prop Type Default Description duration number— ms (0–10000; default per effect). easing Easing | EasingPreset— — incompatible "error" | "swap"— "error"(default) or"swap".normalize "exact" | "cubic"— "exact"(default) or"cubic"(lines and quadratics promoted to cubics).onComplete (result: MotionResult) => void— — precision number3Output decimals 0–6 (default 3). reducedMotion ReducedMotion— — shapes(required) Readonly<Record<string, string>>— Named compatible shapes (e.g. menuCloseShapes).state string— Initial state name (default: the first key). LogoRevealOptionsinterfaceLogoRevealOptions
LogoRevealOptions Prop Type Default Description duration number— ms (0–10000; default per effect). easing Easing | EasingPreset— — onComplete (result: MotionResult) => void— — outline Element | Iterable<Element>— Decorative outline paths drawn before the mask opens. pattern LogoRevealPattern— — progress ProgressSource— Drive from a 0–1 source instead of the own clock. reducedMotion ReducedMotion— — softness number0.15Edge softness 0–0.5 (default 0.15). trigger ProgressTrigger"visible"Default "visible"(once); ignored withprogress.LoopEffectControlinterfaceLoopEffectControl
Control of a continuous effect (loop) — also seekable, timeline- and source-driven.
LoopEffectControl Prop Type Default Description destroy(required) () => void— — drive(required) (source: ProgressSource) => () => void— Follow a 0–1 source (own clock paused); returns the unsubscribe. pause(required) () => void— — play(required) () => void— — progress(required) number— Progress 0–1 of the whole run (of one cycle when repeatisInfinity).seek(required) (progress: number) => void— — state(required) LoopState— — stop(required) () => void— Stop and show the rest state. track(required) (options?: ProgressTrackOptions) => ProgressTrack— A value track for createTimeline().add(…)(finite runs; one cycle when infinite).LoopSvgOptionsinterfaceLoopSvgOptions
LoopSvgOptions Prop Type Default Description duration number— One cycle, ms. onComplete () => void— — reducedMotion ReducedMotion— — repeat number— Extra cycles (0–1000 or Infinity, explicit).trigger "visible" | "mount" | "manual"— visible/mountstart on creation (default);manualwaits forplay().MorphOptionsinterfaceMorphOptions
MorphOptions Prop Type Default Description normalize "exact" | "cubic"— "exact"(default) or"cubic"(lines and quadratics promoted to cubics).precision number3Output decimals 0–6 (default 3). MotionPathControlinterfaceMotionPathControl
MotionPathControl 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. mode(required) "native" | "js"— "native"or"js"— the mechanism actually used.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.MotionPathOptionsinterfaceMotionPathOptions
MotionPathOptions Prop Type Default Description duration number— ms (0–10000; default per effect). easing Easing | EasingPreset— — mode "auto" | "native" | "js"— "auto"(native when supported; default),"native"or"js".onComplete (result: MotionResult) => void— — path(required) string | Element— Path data in CSS px (element-relative), or a <path>whosedis used as is.progress ProgressSource— Drive from a 0–1 source instead of the own clock. reducedMotion ReducedMotion— — repeat number— Extra runs (0–1000 or Infinity, explicit).rotate "auto" | "reverse" | number— "auto"(tangent; default),"reverse", or a fixed angle in degrees.trigger ProgressTrigger"visible"Default "visible"(once); ignored withprogress.yoyo boolean— Alternate direction on repeats. PathDrawOptionsinterfacePathDrawOptions
PathDrawOptions 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— — release booleantrueRestore the consumer's dash styles when the draw completes forwards (default true). reverse booleanfalseDraw from the end towards the start (default false). stagger number— ms between consecutive paths (0–5000; default 0). trigger ProgressTrigger"visible"Default "visible"(once); ignored withprogress.PathGeometryinterfacePathGeometry
PathGeometry Prop Type Default Description bounds(required) () => { x: number; y: number; width: number; height: number; }— — length(required) number— — pointAt(required) (distance: number) => PathPoint— — subpaths(required) readonly { start: number; length: number; closed: boolean; }[]— — PathMorphControlinterfacePathMorphControl
PathMorphControl 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. index(required) number— Index of the target shape. 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— — to(required) (index: number) => Promise<unknown>— Morph to a shape. track(required) (options?: ProgressTrackOptions) => ProgressTrack— A value track for createTimeline().add(…): the timeline clock drives this effect.trackTo(required) (index: number, options?: { id?: string; duration?: number; }) => ReturnType<ProgressControl["track"]>— Value track morphing from the current shape to indexinside a C01 timeline.PathMorphOptionsinterfacePathMorphOptions
PathMorphOptions Prop Type Default Description duration number— ms (0–10000; default per effect). easing Easing | EasingPreset— — incompatible "error" | "swap"— "error"(default) or"swap".initial number— Index shown at creation (default 0; the path's dis not changed until a morph starts).normalize "exact" | "cubic"— "exact"(default) or"cubic"(lines and quadratics promoted to cubics).onComplete (result: MotionResult) => void— — precision number3Output decimals 0–6 (default 3). reducedMotion ReducedMotion— — shapes(required) readonly string[]— The shapes (path data), all compatible with each other. PathPointinterfacePathPoint
PathPoint Prop Type Default Description angle(required) number— Tangent direction in degrees. x(required) number— — y(required) number— — 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.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— — SvgDebugInfointerfaceSvgDebugInfo
SvgDebugInfo Prop Type Default Description attributeWrites(required) number— — effects(required) number— — filters(required) number— — measures(required) number— — morphs(required) number— — SvgSupportinterfaceSvgSupport
SvgSupport Prop Type Default Description colorMix(required) boolean— — cssD(required) boolean— — mask(required) boolean— — offsetPath(required) boolean— — TurbulenceOptionsinterfaceTurbulenceOptions
TurbulenceOptions Prop Type Default Description amplitude number6Displacement in px 0–24 (default 6). duration number— One cycle, ms. frequency number0.02Base frequency 0.001–0.2 (default 0.02). octaves number1Octaves 1–3 (default 1). onComplete () => void— — rate number20Filter updates per second 1–30 (default 20). reducedMotion ReducedMotion— — region number0.1Filter region padding 0–0.25 (default 0.1). repeat number— Extra cycles (0–1000 or Infinity, explicit).speed number0.5Frequency oscillation, cycles per second 0–2 (default 0.5). trigger "visible" | "mount" | "manual"— visible/mountstart on creation (default);manualwaits forplay().LogoRevealPatterntype"wipe-right" | "wipe-left" | "wipe-up" | "wipe-down" | "circle"MorphCompatibilitytypeMorphCompatibility
MorphCompatibility Prop Type Default Description compatible(required) boolean— — index(required) number— — reason(required) string— — MorphIconPropstypeMorphIconProps
MorphIconProps Prop Type Default Description controlRef RefObject<IconMorphControl | null>— — duration number— — shapes(required) Readonly<Record<string, string>>— Named compatible shapes in a 24×24 viewBox (e.g. menuCloseShapes).state(required) string— — title string— Accessible title: omitted → decorative ( aria-hidden); name the button instead.Also accepts the props of: React DOM attributes.
PathCommandtypePathCommand
PathCommand Prop Type Default Description angle(required) number— — large(required) boolean— — rx(required) number— — ry(required) number— — sweep(required) boolean— — type(required) "M" | "L" | "C" | "Q" | "A" | "Z"— — x(required) number— — x1(required) number— — x2(required) number— — y(required) number— — y1(required) number— — y2(required) number— — PathDrawPropstypePathDrawProps
PathDrawProps Prop Type Default Description children(required) ReactElement— One SVG geometry element ( <path>,<circle>, …).controlRef RefObject<ProgressControl | null>— — 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— — release booleantrueRestore the consumer's dash styles when the draw completes forwards (default true). reverse booleanfalseDraw from the end towards the start (default false). stagger number— ms between consecutive paths (0–5000; default 0). trigger ProgressTrigger"visible"Default "visible"(once); ignored withprogress.SuccessCheckPropstypeSuccessCheckProps
SuccessCheckProps Prop Type Default Description circle booleantrueDraw the circle first (default true). controlRef RefObject<ProgressControl | null>— — 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— — size number— — title string— Accessible title: omitted → decorative ( aria-hidden); announce success in your own status text.trigger ProgressTrigger"visible"Default "visible"(once); ignored withprogress.Also accepts the props of: React DOM attributes.
SvgEffectOptionstypeSvgEffectOptions
SvgEffectOptions 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.SvgTriggertypeProgressTrigger