Skip to Content
Neshel-UI
Animations (experimental)Reference

@neshel-ui/animations/advanced

Every export of @neshel-ui/animations/advanced, generated from its declarations.

Experimental and not on npm

@neshel-ui/animations is a private package (0.0.0). It cannot be installed, and its API may change before a first publication. These pages document what exists in the repository.

Signatures, members and defaults, generated from the built declarations. For explanations and examples read the guide.

  • CardFlip component

    D01 — a card with two faces that flips in 3D (`div.neshel-flip`).

    (props: CardFlipProps): Element
  • CornerRecede component

    D05 — the corner under the pointer recedes like a folded page (`div.neshel-corner`).

    (props: CornerRecedeProps): Element
  • CubeRotate component

    D02 — panels (children) that change through a cube rotation (`div.neshel-cube`).

    (props: CubeRotateProps): Element
  • Glitch component

    D07 — RGB split / glitch bursts on text (`span.neshel-glitch`); the text exists once.

    (props: GlitchProps): Element
  • PerspectiveGrid component

    D09 — a decorative perspective grid floor behind the children (`div.neshel-grid-host`).

    (props: PerspectiveGridProps): Element
  • RingCarousel component

    D03 — items (children) on a rotating 3D ring (`div.neshel-ring`).

    (props: RingCarouselProps): Element
  • TiltShift component

    D11 — tilt-shift depth of field over the children (`div.neshel-tiltshift-host`).

    (props: TiltShiftProps): Element
  • createCardFlip function
    (root: HTMLElement, options?: CardFlipOptions | undefined): CardFlipControl
  • createCornerRecede function
    (root: HTMLElement, options?: CornerRecedeOptions | undefined): CornerRecedeControl
  • createCubeRotate function
    (root: HTMLElement, options?: CubeRotateOptions | undefined): CubeControl
  • createGlitch function
    (element: HTMLElement, options?: GlitchOptions | undefined): GlitchControl
  • createPerspectiveGrid function
    (root: HTMLElement, options?: PerspectiveGridOptions | undefined): GridControl
  • createRingCarousel function
    (root: HTMLElement, options?: RingCarouselOptions | undefined): RingControl
  • createTiltShift function
    (root: HTMLElement, options?: TiltShiftOptions | undefined): TiltShiftControl
  • getAdvancedDebugInfo function
    (): AdvancedDebugInfo
  • GLITCH_MAX_RATE const

    Maximum slice changes per second (WCAG 2.3.1 general flash threshold).

    3
  • AdvancedDebugInfo interface

    AdvancedDebugInfo

    AdvancedDebugInfo
    PropTypeDefaultDescription
    attributeEntries(required)number——
    effects(required)number——
    flaps(required)number——
    gateElements(required)number——
    gateObservers(required)number——
    glitchLayers(required)number——
    glitchSteps(required)number——
    layers(required)number——
    listeners(required)number——
    observers(required)number——
  • CardFlipControl interface

    CardFlipControl

    CardFlipControl
    PropTypeDefaultDescription
    destroy(required)() => void——
    drive(required)(source: ProgressSource) => () => void—Follow a 0–1 source; returns the unsubscribe.
    flip(required)(side?: FlipSide) => void——
    mode(required)"3d" | "fade"—"3d" or "fade" (reduced motion with reducedEffect: "fade", or no preserve-3d).
    progress(required)number—0 front … 1 back.
    seek(required)(progress: number) => void—Render an exact pose (no animation).
    side(required)FlipSide—The face currently facing the viewer.
    target(required)FlipSide—The side the card is moving to (or resting on).
    toggle(required)() => void——
    track(required)(options?: ProgressTrackOptions) => ProgressTrack—A value track for a C01 timeline.
  • CardFlipOptions interface

    CardFlipOptions

    CardFlipOptions
    PropTypeDefaultDescription
    axis"y" | "x"——
    backHTMLElement——
    direction1 | -1——
    flippedbooleanfalseStart on the back (default false).
    frontHTMLElement—Faces (default: the inner element's first two element children).
    innerHTMLElement—The rotating element (default: the root's first element child).
    onFlip(side: FlipSide) => void—The visible face changed (the rotation crossed 90°).
    onToggle(side: FlipSide) => void—A toggle (in-face control or toggle()) changed the intended side — the user's intent, before any motion.
    perspectivenumber1200px 200–4000 (default 1200).
    reducedEffect"fade" | "instant"—Under reduced motion: cross-fade (default) or jump.
    reducedMotionReducedMotion——
    springSpringOptions——
    toggleSelectorstring | false—Elements inside the faces that toggle on click (native buttons); false disables.
  • CornerRecedeControl interface

    CornerRecedeControl

    CornerRecedeControl
    PropTypeDefaultDescription
    amount(required)number—Rendered fold amount 0–1.
    corner(required)Corner——
    destroy(required)() => void——
    reset(required)() => void——
    seek(required)(corner: Corner, amount: number) => void—Render a pose exactly (no animation).
    set(required)(corner: Corner, amount: number) => void—Animate to a pose (programmatic or external progress).
  • CornerRecedeOptions interface

    CornerRecedeOptions

    CornerRecedeOptions
    PropTypeDefaultDescription
    anglenumber60Maximum fold angle, deg 10–85 (default 60).
    cornersreadonly Corner[]—Corners that may fold (default all four).
    flap"clone" | "plain""clone""clone": inert ID-free copy of the surface; "plain": a surface-coloured triangle (default "clone").
    focusCornerCorner | false"top-right"Corner folded at 35 % while focus inside is :focus-visible; false disables (default "top-right").
    perspectivenumber900px 300–3000 perspective of the flap (default 900).
    pointerTypesreadonly ("mouse" | "pen" | "touch")[]——
    reducedMotionReducedMotion——
    reversebooleanfalseLift the corner toward the viewer instead of receding (default false).
    shadenumber0.3Flap darkening 0–0.6 (default 0.3).
    sizenumber0.35Fold leg as a fraction of the shorter side 0.1–0.6 (default 0.35).
    springSpringOptions——
    surfaceHTMLElement—The live content element that is clipped (default: the root's first element child).
    thresholdnumber0.3Neutral zone around the centre 0–0.9 (default 0.3).
  • CubeControl interface

    CubeControl

    CubeControl
    PropTypeDefaultDescription
    cancel(required)() => void——
    count(required)number——
    destroy(required)() => void——
    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.
    go(required)(index: number, options?: { direction?: 1 | -1; }) => void——
    index(required)number—Logical active panel.
    mode(required)"3d" | "fade"——
    next(required)() => void——
    pause(required)() => void——
    play(required)() => void——
    previous(required)() => void——
    progress(required)number—Rendered progress 0–1.
    refresh(required)() => void—Re-read the panels (children changed).
    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.
  • CubeRotateOptions interface

    CubeRotateOptions

    CubeRotateOptions
    PropTypeDefaultDescription
    axisAxis3D——
    durationnumber700ms 0–10000 (default 700).
    easingEasing | EasingPreset——
    indexnumber0Initial panel (default 0).
    loopbooleantrueWrap around at the ends (default true).
    onChange(index: number) => void——
    perspectivenumber1600px 200–6000 (default 1600).
    reducedMotionReducedMotion——
  • GlitchControl interface

    GlitchControl

    GlitchControl
    PropTypeDefaultDescription
    active(required)boolean——
    destroy(required)() => void——
    play(required)() => void——
    stop(required)() => void——
  • GlitchOptions interface

    GlitchOptions

    GlitchOptions
    PropTypeDefaultDescription
    colorsreadonly [string, string]—Two CSS colours of the channel layers.
    durationnumber600Burst length ms 100–2000 (default 600).
    intensitynumber—0–1 (offset ≤ 6 px; default 0.4).
    ratenumber—Slice changes per second 1–3 (hard cap 3; default 3).
    reducedMotionReducedMotion——
    seednumber1Integer seed of the slice pattern (default 1).
    triggerGlitchTrigger——
  • GridControl interface

    GridControl

    GridControl
    PropTypeDefaultDescription
    destroy(required)() => void——
    pause(required)() => void——
    play(required)() => void——
    state(required)GridState——
  • PerspectiveGridOptions interface

    PerspectiveGridOptions

    PerspectiveGridOptions
    PropTypeDefaultDescription
    anglenumber72Plane tilt, deg 45–85 (default 72).
    cellnumber48Cell size px 8–256 (default 48).
    colorstringcurrentColorLine colour (default currentColor).
    driftnumber0Lateral cells per second −4–4 (default 0).
    durationnumber5000Running time ms 0–600000 or Infinity (default 5000).
    fadebooleantrueFade toward the horizon (default true).
    horizonnumber0.45Horizon as a fraction of the height 0–0.9 (default 0.45).
    linenumber2Line width px 1–6 (default 2).
    opacitynumber0.8Opacity 0.05–1 (default 0.8).
    reducedMotionReducedMotion——
    speednumber1Cells per second toward the viewer 0–8 (default 1).
    vanishingnumber0.5Horizontal vanishing point 0–1 (default 0.5).
  • ProgressSource interface

    ProgressSource

    Any 0–1 progress source (the 011 ScrollProgress and motion values fit).

    ProgressSource
    PropTypeDefaultDescription
    get(required)() => number——
    subscribe(required)(listener: (progress: number) => void) => () => void——
  • ProgressTrack interface

    ProgressTrack

    A C01 value track (timeline.add(effect.track())).

    ProgressTrack
    PropTypeDefaultDescription
    duration(required)number——
    easing(required)Easing | EasingPreset——
    from(required)number——
    idstring——
    to(required)number——
    value(required)MotionValue——
  • RingCarouselOptions interface

    RingCarouselOptions

    RingCarouselOptions
    PropTypeDefaultDescription
    announce(index: number, count: number) => string"Slide n of N"Text of the live announcement (default "Slide n of N").
    dragboolean——
    gapnumber—px 0–400 between items (auto radius; default 24).
    indexnumber——
    keyboardboolean——
    labelstring—Accessible name of the carousel (required unless the root is labelled).
    onChange(index: number) => void——
    perspectivenumber1400px 200–6000 (default 1400).
    radius"auto" | number—"auto" (from the item width) or px 50–4000.
    reducedMotionReducedMotion——
    springSpringOptions——
  • RingControl interface

    RingControl

    RingControl
    PropTypeDefaultDescription
    angle(required)number—Current ring angle (deg).
    count(required)number——
    destroy(required)() => void——
    go(required)(index: number) => void——
    index(required)number——
    next(required)() => void——
    previous(required)() => void——
    refresh(required)() => void——
  • TiltShiftControl interface

    TiltShiftControl

    TiltShiftControl
    PropTypeDefaultDescription
    destroy(required)() => void——
    drive(required)(source: ProgressSource) => () => void——
    focus(required)number——
    mode(required)"backdrop" | "tint" | "none"——
    setFocus(required)(center: number) => void——
  • TiltShiftOptions interface

    TiltShiftOptions

    TiltShiftOptions
    PropTypeDefaultDescription
    bandsnumber2Bands per side 1–2 (default 2).
    blurnumber6Maximum blur px 0–12 (default 6).
    fallback"tint" | "none"—Without backdrop-filter: a tint gradient (default) or nothing.
    focusnumber0.5Focal centre 0–1 (default 0.5).
    orientation"horizontal" | "vertical" | "radial"——
    progressProgressSource—0–1 source moving the focal centre.
    reducedMotionReducedMotion——
    sizenumber0.35Focal band 0.1–0.9 (default 0.35).
    springSpringOptions——
    tintstring——
  • CardFlipProps type

    CardFlipProps

    CardFlipProps
    PropTypeDefaultDescription
    axis"y" | "x"——
    back(required)ReactNode——
    controlRefRefObject<C | null>——
    defaultFlippedboolean——
    direction1 | -1——
    flippedboolean—Controlled side (true = back).
    front(required)ReactNode——
    onFlip(side: FlipSide) => void—The visible face changed (the rotation crossed 90°).
    onFlippedChange(flipped: boolean) => void—The user asked for the other side (in-face toggle): the intent, reported before any motion.
    perspectivenumber1200px 200–4000 (default 1200).
    reducedEffect"fade" | "instant"—Under reduced motion: cross-fade (default) or jump.
    reducedMotionReducedMotion——
    springSpringOptions——
    toggleSelectorstring | false—Elements inside the faces that toggle on click (native buttons); false disables.

    Also accepts the props of: React DOM attributes.

  • Corner type
    "top-left" | "top-right" | "bottom-left" | "bottom-right"
  • CornerRecedeProps type

    CornerRecedeProps

    CornerRecedeProps
    PropTypeDefaultDescription
    anglenumber60Maximum fold angle, deg 10–85 (default 60).
    children(required)ReactElement—One element: the live surface whose corner recedes.
    controlRefRefObject<C | null>——
    cornersreadonly Corner[]—Corners that may fold (default all four).
    flap"clone" | "plain""clone""clone": inert ID-free copy of the surface; "plain": a surface-coloured triangle (default "clone").
    focusCornerCorner | false"top-right"Corner folded at 35 % while focus inside is :focus-visible; false disables (default "top-right").
    perspectivenumber900px 300–3000 perspective of the flap (default 900).
    pointerTypesreadonly ("mouse" | "pen" | "touch")[]——
    reducedMotionReducedMotion——
    reversebooleanfalseLift the corner toward the viewer instead of receding (default false).
    shadenumber0.3Flap darkening 0–0.6 (default 0.3).
    sizenumber0.35Fold leg as a fraction of the shorter side 0.1–0.6 (default 0.35).
    springSpringOptions——
    thresholdnumber0.3Neutral zone around the centre 0–0.9 (default 0.3).

    Also accepts the props of: React DOM attributes.

  • CubeRotateProps type

    CubeRotateProps

    CubeRotateProps
    PropTypeDefaultDescription
    axisAxis3D——
    controlRefRefObject<C | null>——
    defaultIndexnumber——
    durationnumber700ms 0–10000 (default 700).
    easingEasing | EasingPreset——
    indexnumber—Controlled panel index.
    loopbooleantrueWrap around at the ends (default true).
    onIndexChange(index: number) => void——
    perspectivenumber1600px 200–6000 (default 1600).
    reducedMotionReducedMotion——

    Also accepts the props of: React DOM attributes.

  • FlipSide type
    "front" | "back"
  • GlitchProps type

    GlitchProps

    GlitchProps
    PropTypeDefaultDescription
    colorsreadonly [string, string]—Two CSS colours of the channel layers.
    controlRefRefObject<C | null>——
    durationnumber600Burst length ms 100–2000 (default 600).
    intensitynumber—0–1 (offset ≤ 6 px; default 0.4).
    ratenumber—Slice changes per second 1–3 (hard cap 3; default 3).
    reducedMotionReducedMotion——
    seednumber1Integer seed of the slice pattern (default 1).
    triggerGlitchTrigger——

    Also accepts the props of: React DOM attributes.

  • GlitchTrigger type
    "hover-focus" | "hover" | "focus" | "visible" | "manual"
  • GridState type
    "running" | "paused" | "completed" | "reduced" | "static"
  • PerspectiveGridProps type

    PerspectiveGridProps

    PerspectiveGridProps
    PropTypeDefaultDescription
    anglenumber72Plane tilt, deg 45–85 (default 72).
    cellnumber48Cell size px 8–256 (default 48).
    colorstringcurrentColorLine colour (default currentColor).
    controlRefRefObject<C | null>——
    driftnumber0Lateral cells per second −4–4 (default 0).
    durationnumber5000Running time ms 0–600000 or Infinity (default 5000).
    fadebooleantrueFade toward the horizon (default true).
    horizonnumber0.45Horizon as a fraction of the height 0–0.9 (default 0.45).
    linenumber2Line width px 1–6 (default 2).
    opacitynumber0.8Opacity 0.05–1 (default 0.8).
    reducedMotionReducedMotion——
    speednumber1Cells per second toward the viewer 0–8 (default 1).
    vanishingnumber0.5Horizontal vanishing point 0–1 (default 0.5).

    Also accepts the props of: React DOM attributes.

  • RingCarouselProps type

    RingCarouselProps

    RingCarouselProps
    PropTypeDefaultDescription
    announce(index: number, count: number) => string"Slide n of N"Text of the live announcement (default "Slide n of N").
    controlRefRefObject<C | null>——
    defaultIndexnumber——
    dragboolean——
    gapnumber—px 0–400 between items (auto radius; default 24).
    indexnumber——
    keyboardboolean——
    label(required)string—Accessible name of the carousel.
    onIndexChange(index: number) => void——
    perspectivenumber1400px 200–6000 (default 1400).
    radius"auto" | number—"auto" (from the item width) or px 50–4000.
    reducedMotionReducedMotion——
    springSpringOptions——

    Also accepts the props of: React DOM attributes.

  • TiltShiftProps type

    TiltShiftProps

    TiltShiftProps
    PropTypeDefaultDescription
    bandsnumber2Bands per side 1–2 (default 2).
    blurnumber6Maximum blur px 0–12 (default 6).
    controlRefRefObject<C | null>——
    fallback"tint" | "none"—Without backdrop-filter: a tint gradient (default) or nothing.
    focusnumber0.5Focal centre 0–1 (default 0.5).
    orientation"horizontal" | "vertical" | "radial"——
    progressProgressSource—0–1 source moving the focal centre.
    reducedMotionReducedMotion——
    sizenumber0.35Focal band 0.1–0.9 (default 0.35).
    springSpringOptions——
    tintstring——

    Also accepts the props of: React DOM attributes.

Edit on GitHub