@neshel-ui/animations/hover
Every export of @neshel-ui/animations/hover, 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.
CursorFollowercomponentH11 `<CursorFollower>`: a decorative dot follows the pointer inside the area (mouse/pen; off for reduced motion). Needs `@neshel-ui/animations/hover.css`.
(props: CursorFollowerProps): ElementHovercomponent<Options, Resolved>(props: HoverProps<Options, Resolved>): ElementTilt3Dcomponent({ maxTilt, perspective, scale, axis, reverse, spring, pointerTypes, focusTilt, reducedMotion, disabled, asChild, className, ref, children, ...rest }: Tilt3DProps): ElementcreateTilt3DfunctionImperative 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): Tilt3DControlleruseTilt3Dfunction(ref: RefObject<HTMLElement | null>, options?: Tilt3DOptions | undefined): voidborderSweepconstReadonly<EffectDefinition<BorderSweepOptions, ResolvedBorderSweep>>cursorFollowerconstReadonly<EffectDefinition<CursorFollowerOptions, ResolvedFollower>>glowconstReadonly<EffectDefinition<GlowOptions, ResolvedGlow>>hoverEffectsconstEvery hover definition in catalogue order (H01–H11), for explicit registries.
readonly AnyEffectDefinition[]liftconstReadonly<EffectDefinition<LiftOptions, ResolvedLift>>magneticconstReadonly<EffectDefinition<MagneticOptions, ResolvedMagnetic>>mediaZoomconstReadonly<EffectDefinition<MediaZoomOptions, ResolvedMediaZoom>>parallaxconstReadonly<EffectDefinition<ParallaxOptions, ResolvedParallax>>shineconstReadonly<EffectDefinition<ShineOptions, ResolvedShine>>spotlightconstReadonly<EffectDefinition<SpotlightOptions, ResolvedSpotlight>>tilt3DconstThe Tilt3D definition (`hover/tilt-3d`): one composable `transform` layer, no exclusive channel.
Readonly<EffectDefinition<Tilt3DOptions, ResolvedTilt3DOptions>>underlineconstReadonly<EffectDefinition<UnderlineOptions, ResolvedUnderline>>BorderSweepOptionsinterfaceBorderSweepOptions
H06 — Border gradient sweep: a rotating conic gradient ring on the
::afterlayer.BorderSweepOptions Prop Type Default Description colors readonly [string, string]— Two gradient colours (default indigo and pink). disabled boolean— Turn the effect off and return to rest. duration number— Duration of one turn in ms (500–20000, default 3000). pointerTypes readonly HoverPointerType[]— Pointer types that activate the effect (default mouse and pen; touch is opt-in). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user").spring SpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").width number— Ring width in px (1–8, default 2). CursorFollowerOptionsinterfaceCursorFollowerOptions
CursorFollowerOptions Prop Type Default Description blend boolean— Blend with the content ( mix-blend-mode: difference, default false).disabled boolean— Turn the effect off and return to rest. pointerTypes readonly ("mouse" | "pen")[]— Pointer types that show the follower (default mouse and pen; touch is not supported). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user").size number— Diameter in px (4–160, default 28). spring SpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").CursorFollowerPropsinterfaceCursorFollowerProps
CursorFollowerProps Prop Type Default Description asChild boolean— Apply the effects to the single child element instead of rendering a <div>.blend boolean— Blend with the content ( mix-blend-mode: difference, default false).children ReactNode— — conflicts ConflictPolicy— Conflict reporting for exclusive channels (default: warn in development). disabled boolean— Turn the effect off and return to rest. pointerTypes readonly ("mouse" | "pen")[]— Pointer types that show the follower (default mouse and pen; touch is not supported). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user").ref Ref<HTMLDivElement>— — size number— Diameter in px (4–160, default 28). spring SpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").Also accepts the props of: React DOM attributes.
GlowOptionsinterfaceGlowOptions
H02 — Glow / ring: a soft ring and glow on the decor layer (additive; never replaces focus styles).
GlowOptions Prop Type Default Description blur number— Glow blur in px (0–64, default 16). color string— Glow colour (CSS colour; default the theme ring colour or indigo). disabled boolean— Turn the effect off and return to rest. pointerTypes readonly HoverPointerType[]— Pointer types that activate the effect (default mouse and pen; touch is opt-in). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user").size number— Ring spread in px (0–16, default 3). spring SpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").HoverOptionsinterfaceHoverOptions
Options shared by the hover effects.
HoverOptions Prop Type Default Description disabled boolean— Turn the effect off and return to rest. pointerTypes readonly HoverPointerType[]— Pointer types that activate the effect (default mouse and pen; touch is opt-in). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user").spring SpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").LiftOptionsinterfaceLiftOptions
H01 — Lift: translate up (transform layer) plus a shadow on the decor layer.
LiftOptions Prop Type Default Description disabled boolean— Turn the effect off and return to rest. distance number— Lift distance in px (0–40, default 4). pointerTypes readonly HoverPointerType[]— Pointer types that activate the effect (default mouse and pen; touch is opt-in). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user").scale number— Scale while lifted (1–1.2, default 1). shadow boolean— Render the lift shadow on the decor layer (default true; needs hover.css). spring SpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").MagneticOptionsinterfaceMagneticOptions
H04 — Magnetic pull: the element follows the pointer a little (transform layer, spring).
MagneticOptions Prop Type Default Description disabled boolean— Turn the effect off and return to rest. max number— Largest displacement in px (0–64, default 12). pointerTypes readonly HoverPointerType[]— Pointer types that activate the effect (default mouse and pen; touch is opt-in). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user").spring SpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").strength number— Share of the pointer offset followed (0–1, default 0.35). MediaZoomOptionsinterfaceMediaZoomOptions
H08 — Media zoom inside frame: the frame clips; its media child scales (child transform layer).
MediaZoomOptions Prop Type Default Description disabled boolean— Turn the effect off and return to rest. pointerTypes readonly HoverPointerType[]— Pointer types that activate the effect (default mouse and pen; touch is opt-in). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user").scale number— Zoom factor (1–2, default 1.08). spring SpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").ParallaxOptionsinterfaceParallaxOptions
H09 — Pointer parallax layers: children with
data-neshel-depthmove by depth (transform layers).ParallaxOptions Prop Type Default Description disabled boolean— Turn the effect off and return to rest. pointerTypes readonly HoverPointerType[]— Pointer types that activate the effect (default mouse and pen; touch is opt-in). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user").spring SpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").strength number— Displacement in px at depth 1 and the box edge (0–100, default 16). ResolvedTilt3DOptionsinterfaceResolvedTilt3DOptions
ResolvedTilt3DOptions Prop Type Default Description 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>— — ShineOptionsinterfaceShineOptions
H10 — Shine / glare sweep: one highlight sweep across the decor layer on each activation.
ShineOptions Prop Type Default Description angle number— Gradient angle in degrees (0–360, default 110). color string— Highlight colour (default translucent white). disabled boolean— Turn the effect off and return to rest. duration number— Sweep duration in ms (100–5000, default 700). pointerTypes readonly HoverPointerType[]— Pointer types that activate the effect (default mouse and pen; touch is opt-in). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user").SpotlightOptionsinterfaceSpotlightOptions
H05 — Spotlight: a radial highlight that follows the pointer on the decor layer.
SpotlightOptions Prop Type Default Description color string— Highlight colour (default white). disabled boolean— Turn the effect off and return to rest. intensity number— Strength of the highlight (0–1, default 0.22). pointerTypes readonly HoverPointerType[]— Pointer types that activate the effect (default mouse and pen; touch is opt-in). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user").size number— Radius in px (40–1000, default 240). spring SpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").Tilt3DControllerinterfaceTilt3DController
Tilt3DController Prop Type Default Description 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. Tilt3DOptionsinterfaceTilt3DOptions
Tilt3DOptions Prop Type Default Description axis Tilt3DAxis"both"Which rotation axes follow the pointer (default "both").disabled boolean— Turn the effect off and return to rest. focusTilt booleantrueKeyboard focus inside the element shows a gentle fixed pose (default true). maxTilt number— Largest rotation in degrees at the element's edges (default 10, range 0–45). perspective number— Perspective distance in px; smaller is more dramatic (default 1000, at least 100). pointerTypes readonly 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. reducedMotion ReducedMotion"user"Reduced-motion policy (default "user": followprefers-reduced-motion).reverse booleanfalseInvert the inward default: the region under the pointer comes forward (default false). scale number— Scale while the pointer or keyboard focus is on the element (default 1, range 0.5–2). spring SpringOptions— Spring used to follow the pointer and to return to rest. Tilt3DPropsinterfaceTilt3DProps
Tilt3DProps Prop Type Default Description asChild boolean— Apply the effect to the single child element instead of rendering a <div>.axis Tilt3DAxis"both"Which rotation axes follow the pointer (default "both").children ReactNode— — disabled boolean— Turn the effect off and return to rest. focusTilt booleantrueKeyboard focus inside the element shows a gentle fixed pose (default true). maxTilt number— Largest rotation in degrees at the element's edges (default 10, range 0–45). perspective number— Perspective distance in px; smaller is more dramatic (default 1000, at least 100). pointerTypes readonly 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. reducedMotion ReducedMotion"user"Reduced-motion policy (default "user": followprefers-reduced-motion).ref Ref<HTMLDivElement>— — reverse booleanfalseInvert the inward default: the region under the pointer comes forward (default false). scale number— Scale while the pointer or keyboard focus is on the element (default 1, range 0.5–2). spring SpringOptions— Spring used to follow the pointer and to return to rest. Also accepts the props of: React DOM attributes.
UnderlineOptionsinterfaceUnderlineOptions
H07 — Underline grow: a bar that grows along the bottom edge (decor layer).
UnderlineOptions Prop Type Default Description color stringcurrentColorBar colour (default currentColor).disabled boolean— 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).pointerTypes readonly HoverPointerType[]— Pointer types that activate the effect (default mouse and pen; touch is opt-in). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user").spring SpringOptions | SpringPreset"snappy"Spring of the transition (default "snappy").thickness number— Bar thickness in px (1–8, default 2). HoverPointerTypetype"mouse" | "pen" | "touch"HoverPropstypeHoverProps
HoverProps Prop Type Default Description asChild boolean— Apply the effects to the single child element instead of rendering a <div>.children ReactNode— — conflicts ConflictPolicy— Conflict reporting for exclusive channels (default: warn in development). options undefined | NoInfer<Partial<Options>>— — preset(required) readonly PresetInput<any, any>[] | PresetInput<Options, Resolved>— — ref Ref<HTMLDivElement>— — Also accepts the props of: React DOM attributes.
Tilt3DAxistype"both" | "x" | "y"Tilt3DPointerTypetype"mouse" | "pen" | "touch"Tilt3DStatetypeValue of the `data-neshel-tilt` attribute (styling and test hook).
"rest" | "pointer" | "focus" | "reduced" | "disabled"