@neshel-ui/animations/svg
Todas las exportaciones de @neshel-ui/animations/svg, 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.
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 Tipo Predeterminado Descripción duration number— ms (0–10000; por defecto según el efecto). easing Easing | EasingPreset— — lines(obligatoria) string | Element | Iterable<Element>— Elementos de línea (o un selector dentro del svg). onComplete (result: MotionResult) => void— — points string | Element | Iterable<Element>— Marcadores revelados cuando la línea pasa por ellos (selector o elementos). progress ProgressSource— Se dirige con una fuente de 0 a 1 en lugar de su propio reloj. reducedMotion ReducedMotion— — stagger number150ms entre líneas (por defecto 150). trigger ProgressTrigger"visible"Por defecto "visible"(una vez); se ignora conprogress.CheckmarkOptionsinterfaceCheckmarkOptions
CheckmarkOptions Prop Tipo Predeterminado Descripción checkElement Element— Elemento de la marca (por defecto: el último path/polylinedel svg).circle booleantrueTraza primero el círculo (por defecto true). circleElement Element— Elemento del círculo (por defecto: el primer circle/pathdel svg cuandocirclees true).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.DashFlowOptionsinterfaceDashFlowOptions
DashFlowOptions Prop Tipo Predeterminado Descripción dash number— Longitud del guion (unidades de usuario, por defecto 6). duration number— Un ciclo, ms. gap number— Longitud del hueco (unidades de usuario, por defecto 4). onComplete () => void— — reducedMotion ReducedMotion— — repeat number— Ciclos extra (0–1000 o Infinity, explícito).speed number— Unidades por segundo; negativa invierte (−400–400; por defecto 40). trigger "visible" | "mount" | "manual"— visible/mountinician al crearse (por defecto);manualespera aplay().GradientStopinterfaceGradientStop
GradientStop Prop Tipo Predeterminado Descripción color readonly [string, string]— — offset readonly [number, number]— — opacity readonly [number, number]— — GradientStopsOptionsinterfaceGradientStopsOptions
GradientStopsOptions Prop Tipo Predeterminado Descripción duration number— Un ciclo, ms. onComplete () => void— — reducedMotion ReducedMotion— — repeat number— Ciclos extra (0–1000 o Infinity, explícito).stops(obligatoria) readonly (GradientStop | undefined)[]— Por parada (según su índice entre los <stop>del degradado).trigger "visible" | "mount" | "manual"— visible/mountinician al crearse (por defecto);manualespera aplay().yoyo booleantrueVa y vuelve dentro de un ciclo (por defecto true). IconMorphControlinterfaceIconMorphControl
IconMorphControl 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. name(obligatoria) string— The current (target) state name. 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). set(obligatoria) (name: string) => Promise<unknown>— — state(obligatoria) PathMorphControl["state"]— — track(obligatoria) (options?: ProgressTrackOptions) => ProgressTrack— A value track for createTimeline().add(…): the timeline clock drives this effect.IconMorphOptionsinterfaceIconMorphOptions
IconMorphOptions Prop Tipo Predeterminado Descripción duration number— ms (0–10000; por defecto según el efecto). easing Easing | EasingPreset— — incompatible "error" | "swap"— "error"(por defecto) o"swap".normalize "exact" | "cubic"— "exact"(por defecto) o"cubic"(líneas y cuadráticas convertidas a cúbicas).onComplete (result: MotionResult) => void— — precision number3Decimales de salida 0–6 (por defecto 3). reducedMotion ReducedMotion— — shapes(obligatoria) Readonly<Record<string, string>>— Formas compatibles con nombre (p. ej. menuCloseShapes).state string— Nombre del estado inicial (por defecto: la primera clave). LogoRevealOptionsinterfaceLogoRevealOptions
LogoRevealOptions Prop Tipo Predeterminado Descripción duration number— ms (0–10000; por defecto según el efecto). easing Easing | EasingPreset— — onComplete (result: MotionResult) => void— — outline Element | Iterable<Element>— Rutas de contorno decorativas trazadas antes de abrir la máscara. pattern LogoRevealPattern— — progress ProgressSource— Se dirige con una fuente de 0 a 1 en lugar de su propio reloj. reducedMotion ReducedMotion— — softness number0.15Suavidad del borde 0–0.5 (por defecto 0.15). trigger ProgressTrigger"visible"Por defecto "visible"(una vez); se ignora conprogress.LoopEffectControlinterfaceLoopEffectControl
Control of a continuous effect (loop) — also seekable, timeline- and source-driven.
LoopEffectControl Prop Tipo Predeterminado Descripción destroy(obligatoria) () => void— — drive(obligatoria) (source: ProgressSource) => () => void— Follow a 0–1 source (own clock paused); returns the unsubscribe. pause(obligatoria) () => void— — play(obligatoria) () => void— — progress(obligatoria) number— Progress 0–1 of the whole run (of one cycle when repeatisInfinity).seek(obligatoria) (progress: number) => void— — state(obligatoria) LoopState— — stop(obligatoria) () => void— Stop and show the rest state. track(obligatoria) (options?: ProgressTrackOptions) => ProgressTrack— A value track for createTimeline().add(…)(finite runs; one cycle when infinite).LoopSvgOptionsinterfaceLoopSvgOptions
LoopSvgOptions Prop Tipo Predeterminado Descripción duration number— Un ciclo, ms. onComplete () => void— — reducedMotion ReducedMotion— — repeat number— Ciclos extra (0–1000 o Infinity, explícito).trigger "visible" | "mount" | "manual"— visible/mountinician al crearse (por defecto);manualespera aplay().MorphOptionsinterfaceMorphOptions
MorphOptions Prop Tipo Predeterminado Descripción normalize "exact" | "cubic"— "exact"(por defecto) o"cubic"(líneas y cuadráticas convertidas a cúbicas).precision number3Decimales de salida 0–6 (por defecto 3). MotionPathControlinterfaceMotionPathControl
MotionPathControl 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. mode(obligatoria) "native" | "js"— "native"or"js"— the mechanism actually used.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.MotionPathOptionsinterfaceMotionPathOptions
MotionPathOptions Prop Tipo Predeterminado Descripción duration number— ms (0–10000; por defecto según el efecto). easing Easing | EasingPreset— — mode "auto" | "native" | "js"— "auto"(nativo si existe; por defecto),"native"o"js".onComplete (result: MotionResult) => void— — path(obligatoria) string | Element— Datos de ruta en px CSS (relativos al elemento), o un <path>cuyodse usa tal cual.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).rotate "auto" | "reverse" | number— "auto"(tangente; por defecto),"reverse"o un ángulo fijo en grados.trigger ProgressTrigger"visible"Por defecto "visible"(una vez); se ignora conprogress.yoyo boolean— Alterna la dirección en las repeticiones. PathDrawOptionsinterfacePathDrawOptions
PathDrawOptions 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— — release booleantrueRestaura tus estilos de guiones al completar el trazo hacia delante (por defecto true). reverse booleanfalseTraza desde el final hacia el inicio (por defecto false). stagger number— ms entre rutas consecutivas (0–5000; por defecto 0). trigger ProgressTrigger"visible"Por defecto "visible"(una vez); se ignora conprogress.PathGeometryinterfacePathGeometry
PathGeometry Prop Tipo Predeterminado Descripción bounds(obligatoria) () => { x: number; y: number; width: number; height: number; }— — length(obligatoria) number— — pointAt(obligatoria) (distance: number) => PathPoint— — subpaths(obligatoria) readonly { start: number; length: number; closed: boolean; }[]— — PathMorphControlinterfacePathMorphControl
PathMorphControl 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. index(obligatoria) number— Index of the target shape. 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— — to(obligatoria) (index: number) => Promise<unknown>— Morph to a shape. track(obligatoria) (options?: ProgressTrackOptions) => ProgressTrack— A value track for createTimeline().add(…): the timeline clock drives this effect.trackTo(obligatoria) (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 Tipo Predeterminado Descripción duration number— ms (0–10000; por defecto según el efecto). easing Easing | EasingPreset— — incompatible "error" | "swap"— "error"(por defecto) o"swap".initial number— Índice mostrado al crear (por defecto 0; el dde la ruta no cambia hasta que empieza una transformación).normalize "exact" | "cubic"— "exact"(por defecto) o"cubic"(líneas y cuadráticas convertidas a cúbicas).onComplete (result: MotionResult) => void— — precision number3Decimales de salida 0–6 (por defecto 3). reducedMotion ReducedMotion— — shapes(obligatoria) readonly string[]— Las formas (datos de ruta), compatibles entre sí. PathPointinterfacePathPoint
PathPoint Prop Tipo Predeterminado Descripción angle(obligatoria) number— Tangent direction in degrees. x(obligatoria) number— — y(obligatoria) number— — 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.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— — SvgDebugInfointerfaceSvgDebugInfo
SvgDebugInfo Prop Tipo Predeterminado Descripción attributeWrites(obligatoria) number— — effects(obligatoria) number— — filters(obligatoria) number— — measures(obligatoria) number— — morphs(obligatoria) number— — SvgSupportinterfaceSvgSupport
SvgSupport Prop Tipo Predeterminado Descripción colorMix(obligatoria) boolean— — cssD(obligatoria) boolean— — mask(obligatoria) boolean— — offsetPath(obligatoria) boolean— — TurbulenceOptionsinterfaceTurbulenceOptions
TurbulenceOptions Prop Tipo Predeterminado Descripción amplitude number6Desplazamiento en px 0–24 (por defecto 6). duration number— Un ciclo, ms. frequency number0.02Frecuencia base 0.001–0.2 (por defecto 0.02). octaves number1Octavas 1–3 (por defecto 1). onComplete () => void— — rate number20Actualizaciones del filtro por segundo 1–30 (por defecto 20). reducedMotion ReducedMotion— — region number0.1Margen de la región del filtro 0–0.25 (por defecto 0.1). repeat number— Ciclos extra (0–1000 o Infinity, explícito).speed number0.5Oscilación de la frecuencia, ciclos por segundo 0–2 (por defecto 0.5). trigger "visible" | "mount" | "manual"— visible/mountinician al crearse (por defecto);manualespera aplay().LogoRevealPatterntype"wipe-right" | "wipe-left" | "wipe-up" | "wipe-down" | "circle"MorphCompatibilitytypeMorphCompatibility
MorphCompatibility Prop Tipo Predeterminado Descripción compatible(obligatoria) boolean— — index(obligatoria) number— — reason(obligatoria) string— — MorphIconPropstypeMorphIconProps
MorphIconProps Prop Tipo Predeterminado Descripción controlRef RefObject<IconMorphControl | null>— — duration number— — shapes(obligatoria) Readonly<Record<string, string>>— Named compatible shapes in a 24×24 viewBox (e.g. menuCloseShapes).state(obligatoria) string— — title string— Accessible title: omitted → decorative ( aria-hidden); name the button instead.También acepta las props de: React DOM attributes.
PathCommandtypePathCommand
PathCommand Prop Tipo Predeterminado Descripción angle(obligatoria) number— — large(obligatoria) boolean— — rx(obligatoria) number— — ry(obligatoria) number— — sweep(obligatoria) boolean— — type(obligatoria) "M" | "L" | "C" | "Q" | "A" | "Z"— — x(obligatoria) number— — x1(obligatoria) number— — x2(obligatoria) number— — y(obligatoria) number— — y1(obligatoria) number— — y2(obligatoria) number— — PathDrawPropstypePathDrawProps
PathDrawProps Prop Tipo Predeterminado Descripción children(obligatoria) ReactElement— One SVG geometry element ( <path>,<circle>, …).controlRef RefObject<ProgressControl | null>— — 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— — release booleantrueRestaura tus estilos de guiones al completar el trazo hacia delante (por defecto true). reverse booleanfalseTraza desde el final hacia el inicio (por defecto false). stagger number— ms entre rutas consecutivas (0–5000; por defecto 0). trigger ProgressTrigger"visible"Por defecto "visible"(una vez); se ignora conprogress.SuccessCheckPropstypeSuccessCheckProps
SuccessCheckProps Prop Tipo Predeterminado Descripción circle booleantrueTraza primero el círculo (por defecto true). controlRef RefObject<ProgressControl | null>— — 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— — size number— — title string— Accessible title: omitted → decorative ( aria-hidden); announce success in your own status text.trigger ProgressTrigger"visible"Por defecto "visible"(una vez); se ignora conprogress.También acepta las props de: React DOM attributes.
SvgEffectOptionstypeSvgEffectOptions
SvgEffectOptions 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.SvgTriggertypeProgressTrigger