Skip to Content
Neshel-UI
Animations (experimental)Reference

@neshel-ui/animations/hover

Every export of @neshel-ui/animations/hover, 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.

  • CursorFollower component

    H11 `<CursorFollower>`: a decorative dot follows the pointer inside the area (mouse/pen; off for reduced motion). Needs `@neshel-ui/animations/hover.css`.

    (props: CursorFollowerProps): Element
  • Hover component
    <Options, Resolved>(props: HoverProps<Options, Resolved>): Element
  • Tilt3D component
    ({ maxTilt, perspective, scale, axis, reverse, spring, pointerTypes, focusTilt, reducedMotion, disabled, asChild, className, ref, children, ...rest }: Tilt3DProps): Element
  • createTilt3D function

    Imperative controller with a Tilt3D-shaped handle. Tilt3D only composes `transform`, so it is attached without the exclusive-channel arbiter (smaller bundle); behaviour equals `attachEffect`.

    (element: HTMLElement, options?: Tilt3DOptions | undefined): Tilt3DController
  • useTilt3D function
    (ref: RefObject<HTMLElement | null>, options?: Tilt3DOptions | undefined): void
  • borderSweep const
    Readonly<EffectDefinition<BorderSweepOptions, ResolvedBorderSweep>>
  • cursorFollower const
    Readonly<EffectDefinition<CursorFollowerOptions, ResolvedFollower>>
  • glow const
    Readonly<EffectDefinition<GlowOptions, ResolvedGlow>>
  • hoverEffects const

    Every hover definition in catalogue order (H01–H11), for explicit registries.

    readonly AnyEffectDefinition[]
  • lift const
    Readonly<EffectDefinition<LiftOptions, ResolvedLift>>
  • magnetic const
    Readonly<EffectDefinition<MagneticOptions, ResolvedMagnetic>>
  • mediaZoom const
    Readonly<EffectDefinition<MediaZoomOptions, ResolvedMediaZoom>>
  • parallax const
    Readonly<EffectDefinition<ParallaxOptions, ResolvedParallax>>
  • shine const
    Readonly<EffectDefinition<ShineOptions, ResolvedShine>>
  • spotlight const
    Readonly<EffectDefinition<SpotlightOptions, ResolvedSpotlight>>
  • tilt3D const

    The Tilt3D definition (`hover/tilt-3d`): one composable `transform` layer, no exclusive channel.

    Readonly<EffectDefinition<Tilt3DOptions, ResolvedTilt3DOptions>>
  • underline const
    Readonly<EffectDefinition<UnderlineOptions, ResolvedUnderline>>
  • BorderSweepOptions interface

    BorderSweepOptions

    H06 — Border gradient sweep: a rotating conic gradient ring on the ::after layer.

    BorderSweepOptions
    PropTypeDefaultDescription
    colorsreadonly [string, string]—Two gradient colours (default indigo and pink).
    disabledboolean—Turn the effect off and return to rest.
    durationnumber—Duration of one turn in ms (500–20000, default 3000).
    pointerTypesreadonly HoverPointerType[]—Pointer types that activate the effect (default mouse and pen; touch is opt-in).
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user").
    springSpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").
    widthnumber—Ring width in px (1–8, default 2).
  • CursorFollowerOptions interface

    CursorFollowerOptions

    CursorFollowerOptions
    PropTypeDefaultDescription
    blendboolean—Blend with the content (mix-blend-mode: difference, default false).
    disabledboolean—Turn the effect off and return to rest.
    pointerTypesreadonly ("mouse" | "pen")[]—Pointer types that show the follower (default mouse and pen; touch is not supported).
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user").
    sizenumber—Diameter in px (4–160, default 28).
    springSpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").
  • CursorFollowerProps interface

    CursorFollowerProps

    CursorFollowerProps
    PropTypeDefaultDescription
    asChildboolean—Apply the effects to the single child element instead of rendering a <div>.
    blendboolean—Blend with the content (mix-blend-mode: difference, default false).
    childrenReactNode——
    conflictsConflictPolicy—Conflict reporting for exclusive channels (default: warn in development).
    disabledboolean—Turn the effect off and return to rest.
    pointerTypesreadonly ("mouse" | "pen")[]—Pointer types that show the follower (default mouse and pen; touch is not supported).
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user").
    refRef<HTMLDivElement>——
    sizenumber—Diameter in px (4–160, default 28).
    springSpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").

    Also accepts the props of: React DOM attributes.

  • GlowOptions interface

    GlowOptions

    H02 — Glow / ring: a soft ring and glow on the decor layer (additive; never replaces focus styles).

    GlowOptions
    PropTypeDefaultDescription
    blurnumber—Glow blur in px (0–64, default 16).
    colorstring—Glow colour (CSS colour; default the theme ring colour or indigo).
    disabledboolean—Turn the effect off and return to rest.
    pointerTypesreadonly HoverPointerType[]—Pointer types that activate the effect (default mouse and pen; touch is opt-in).
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user").
    sizenumber—Ring spread in px (0–16, default 3).
    springSpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").
  • HoverOptions interface

    HoverOptions

    Options shared by the hover effects.

    HoverOptions
    PropTypeDefaultDescription
    disabledboolean—Turn the effect off and return to rest.
    pointerTypesreadonly HoverPointerType[]—Pointer types that activate the effect (default mouse and pen; touch is opt-in).
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user").
    springSpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").
  • LiftOptions interface

    LiftOptions

    H01 — Lift: translate up (transform layer) plus a shadow on the decor layer.

    LiftOptions
    PropTypeDefaultDescription
    disabledboolean—Turn the effect off and return to rest.
    distancenumber—Lift distance in px (0–40, default 4).
    pointerTypesreadonly HoverPointerType[]—Pointer types that activate the effect (default mouse and pen; touch is opt-in).
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user").
    scalenumber—Scale while lifted (1–1.2, default 1).
    shadowboolean—Render the lift shadow on the decor layer (default true; needs hover.css).
    springSpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").
  • MagneticOptions interface

    MagneticOptions

    H04 — Magnetic pull: the element follows the pointer a little (transform layer, spring).

    MagneticOptions
    PropTypeDefaultDescription
    disabledboolean—Turn the effect off and return to rest.
    maxnumber—Largest displacement in px (0–64, default 12).
    pointerTypesreadonly HoverPointerType[]—Pointer types that activate the effect (default mouse and pen; touch is opt-in).
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user").
    springSpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").
    strengthnumber—Share of the pointer offset followed (0–1, default 0.35).
  • MediaZoomOptions interface

    MediaZoomOptions

    H08 — Media zoom inside frame: the frame clips; its media child scales (child transform layer).

    MediaZoomOptions
    PropTypeDefaultDescription
    disabledboolean—Turn the effect off and return to rest.
    pointerTypesreadonly HoverPointerType[]—Pointer types that activate the effect (default mouse and pen; touch is opt-in).
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user").
    scalenumber—Zoom factor (1–2, default 1.08).
    springSpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").
  • ParallaxOptions interface

    ParallaxOptions

    H09 — Pointer parallax layers: children with data-neshel-depth move by depth (transform layers).

    ParallaxOptions
    PropTypeDefaultDescription
    disabledboolean—Turn the effect off and return to rest.
    pointerTypesreadonly HoverPointerType[]—Pointer types that activate the effect (default mouse and pen; touch is opt-in).
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user").
    springSpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").
    strengthnumber—Displacement in px at depth 1 and the box edge (0–100, default 16).
  • ResolvedTilt3DOptions interface

    ResolvedTilt3DOptions

    ResolvedTilt3DOptions
    PropTypeDefaultDescription
    axis(required)Tilt3DAxis——
    disabled(required)boolean——
    focusTilt(required)boolean——
    maxTilt(required)number——
    perspective(required)number——
    pointerTypes(required)ReadonlySet<string>——
    reducedMotion(required)ReducedMotion——
    reverse(required)boolean——
    scale(required)number——
    spring(required)Required<SpringOptions>——
  • ShineOptions interface

    ShineOptions

    H10 — Shine / glare sweep: one highlight sweep across the decor layer on each activation.

    ShineOptions
    PropTypeDefaultDescription
    anglenumber—Gradient angle in degrees (0–360, default 110).
    colorstring—Highlight colour (default translucent white).
    disabledboolean—Turn the effect off and return to rest.
    durationnumber—Sweep duration in ms (100–5000, default 700).
    pointerTypesreadonly HoverPointerType[]—Pointer types that activate the effect (default mouse and pen; touch is opt-in).
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user").
  • SpotlightOptions interface

    SpotlightOptions

    H05 — Spotlight: a radial highlight that follows the pointer on the decor layer.

    SpotlightOptions
    PropTypeDefaultDescription
    colorstring—Highlight colour (default white).
    disabledboolean—Turn the effect off and return to rest.
    intensitynumber—Strength of the highlight (0–1, default 0.22).
    pointerTypesreadonly HoverPointerType[]—Pointer types that activate the effect (default mouse and pen; touch is opt-in).
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user").
    sizenumber—Radius in px (40–1000, default 240).
    springSpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").
  • Tilt3DController interface

    Tilt3DController

    Tilt3DController
    PropTypeDefaultDescription
    destroy(required)() => void—Remove every listener, stop the frame task and restore the element's own styles.
    state(required)Tilt3DState——
    update(required)(options?: Tilt3DOptions) => void—Apply new options (validated); the current pose follows them.
  • Tilt3DOptions interface

    Tilt3DOptions

    Tilt3DOptions
    PropTypeDefaultDescription
    axisTilt3DAxis"both"Which rotation axes follow the pointer (default "both").
    disabledboolean—Turn the effect off and return to rest.
    focusTiltbooleantrueKeyboard focus inside the element shows a gentle fixed pose (default true).
    maxTiltnumber—Largest rotation in degrees at the element's edges (default 10, range 0–45).
    perspectivenumber—Perspective distance in px; smaller is more dramatic (default 1000, at least 100).
    pointerTypesreadonly Tilt3DPointerType[]—Pointer types that drive the tilt (default mouse and pen). Touch is opt-in because a finger moving over a card usually means scrolling.
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user": follow prefers-reduced-motion).
    reversebooleanfalseInvert the inward default: the region under the pointer comes forward (default false).
    scalenumber—Scale while the pointer or keyboard focus is on the element (default 1, range 0.5–2).
    springSpringOptions—Spring used to follow the pointer and to return to rest.
  • Tilt3DProps interface

    Tilt3DProps

    Tilt3DProps
    PropTypeDefaultDescription
    asChildboolean—Apply the effect to the single child element instead of rendering a <div>.
    axisTilt3DAxis"both"Which rotation axes follow the pointer (default "both").
    childrenReactNode——
    disabledboolean—Turn the effect off and return to rest.
    focusTiltbooleantrueKeyboard focus inside the element shows a gentle fixed pose (default true).
    maxTiltnumber—Largest rotation in degrees at the element's edges (default 10, range 0–45).
    perspectivenumber—Perspective distance in px; smaller is more dramatic (default 1000, at least 100).
    pointerTypesreadonly Tilt3DPointerType[]—Pointer types that drive the tilt (default mouse and pen). Touch is opt-in because a finger moving over a card usually means scrolling.
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user": follow prefers-reduced-motion).
    refRef<HTMLDivElement>——
    reversebooleanfalseInvert the inward default: the region under the pointer comes forward (default false).
    scalenumber—Scale while the pointer or keyboard focus is on the element (default 1, range 0.5–2).
    springSpringOptions—Spring used to follow the pointer and to return to rest.

    Also accepts the props of: React DOM attributes.

  • UnderlineOptions interface

    UnderlineOptions

    H07 — Underline grow: a bar that grows along the bottom edge (decor layer).

    UnderlineOptions
    PropTypeDefaultDescription
    colorstringcurrentColorBar colour (default currentColor).
    disabledboolean—Turn the effect off and return to rest.
    origin"left" | "center" | "right""left"Where the bar grows from (default "left"; logical start/end are not mirrored in RTL).
    pointerTypesreadonly HoverPointerType[]—Pointer types that activate the effect (default mouse and pen; touch is opt-in).
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user").
    springSpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").
    thicknessnumber—Bar thickness in px (1–8, default 2).
  • HoverPointerType type
    "mouse" | "pen" | "touch"
  • HoverProps type

    HoverProps

    HoverProps
    PropTypeDefaultDescription
    asChildboolean—Apply the effects to the single child element instead of rendering a <div>.
    childrenReactNode——
    conflictsConflictPolicy—Conflict reporting for exclusive channels (default: warn in development).
    optionsundefined | NoInfer<Partial<Options>>——
    preset(required)readonly PresetInput<any, any>[] | PresetInput<Options, Resolved>——
    refRef<HTMLDivElement>——

    Also accepts the props of: React DOM attributes.

  • Tilt3DAxis type
    "both" | "x" | "y"
  • Tilt3DPointerType type
    "mouse" | "pen" | "touch"
  • Tilt3DState type

    Value of the `data-neshel-tilt` attribute (styling and test hook).

    "rest" | "pointer" | "focus" | "reduced" | "disabled"
Edit on GitHub