Skip to Content
Neshel-UI
Animations (experimental)Effects

Hover & Pointer

The 11 effects H01–H11: purpose, API, options, examples, reduced motion and cost.

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.

Hover effects react to a mouse or pen inside the box and to keyboard :focus-visible, except magnetic pull, pointer parallax and the cursor follower, which are decorative and follow the pointer only. Touch is opt-in through pointerTypes. <Hover> accepts one preset or a list. Effects marked with hover.css draw on a package-owned ::before or ::after layer; an element with its own ::before cannot use them. Never put information in a hover effect only.

H01 · Lift

lift raises the element: distance (4 px), optional scale and a shadow drawn on the package layer. Under reduced motion only the shadow remains.

Import
@neshel-ui/animations/hover
API
lift, Hover
Stylesheet
@neshel-ui/animations/hover.css
Reduced motion
static — the decoration or content stays still
Performance
Transform and opacity, one write per frame through the shared scheduler; no layout work per frame.
Preview: H01
Preview theme: H01
h01.tsx
"use client";
import "@neshel-ui/animations/hover.css";
import { Hover, lift } from "@neshel-ui/animations/hover";

export default function H01Example() {
  return (
    <Hover preset={lift} options={{ distance: 8, scale: 1.02 }} asChild>
      <a
        href="#h01"
        className="rounded-xl border border-neshel-border bg-neshel-surface p-6 text-neshel-surface-foreground inline-block"
      >
        Hover or focus me
      </a>
    </Hover>
  );
}
Options: LiftOptions

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").

H02 · Glow

glow draws a ring with a soft halo: color, size (3 px) and blur (16 px). It complements, and does not replace, the visible focus ring of your control.

Import
@neshel-ui/animations/hover
API
glow, Hover
Stylesheet
@neshel-ui/animations/hover.css
Reduced motion
static — the decoration or content stays still
Performance
Repaints the element (colour, gradient, clip, mask, blur or stroke) while it runs; keep the area small.
Preview: H02
Preview theme: H02
h02.tsx
"use client";
import "@neshel-ui/animations/hover.css";
import { glow, Hover } from "@neshel-ui/animations/hover";

export default function H02Example() {
  return (
    <Hover preset={glow} options={{ size: 4, blur: 24 }} asChild>
      <a
        href="#h02"
        className="rounded-xl border border-neshel-border bg-neshel-surface p-6 text-neshel-surface-foreground inline-block"
      >
        Hover or focus me
      </a>
    </Hover>
  );
}
Options: GlowOptions

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").

H03 · Tilt 3D

<Tilt3D> turns the element towards the pointer: by default the corner under the pointer goes inwards; reverse lifts it. Options: maxTilt, perspective, scale, axis, spring and focusTilt for keyboard focus. useTilt3D and createTilt3D offer the same without the component.

Import
@neshel-ui/animations/hover
API
Tilt3D, useTilt3D, createTilt3D, tilt3D
Stylesheet
@neshel-ui/animations/hover.css
Reduced motion
off — no motion at all
Performance
Transform and opacity, one write per frame through the shared scheduler; no layout work per frame.
Preview: H03
Preview theme: H03
h03.tsx
"use client";
import "@neshel-ui/animations/hover.css";
import { Tilt3D } from "@neshel-ui/animations/hover";

export default function H03Example() {
  return (
    <Tilt3D maxTilt={12} scale={1.03} asChild>
      <a
        href="#h03"
        className="rounded-xl border border-neshel-border bg-neshel-surface p-6 text-neshel-surface-foreground inline-block w-64"
      >
        The pressed corner goes inwards; reverse inverts it.
      </a>
    </Tilt3D>
  );
}
Options: Tilt3DOptions

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.

H04 · Magnetic pull

magnetic moves the element towards the pointer: strength (0.35) is the fraction of the distance and max (12 px) the limit. Decorative and pointer only; the hit area keeps the original box.

Import
@neshel-ui/animations/hover
API
magnetic, Hover
Stylesheet
none needed
Reduced motion
off — no motion at all
Performance
Transform and opacity, one write per frame through the shared scheduler; no layout work per frame.
Preview: H04
Preview theme: H04
h04.tsx
"use client";
import { Hover, magnetic } from "@neshel-ui/animations/hover";
import { Button } from "@neshel-ui/components";

export default function H04Example() {
  return (
    <div className="p-8">
      <Hover preset={magnetic} options={{ strength: 0.5, max: 24 }} asChild>
        <Button>Pulled towards the pointer</Button>
      </Hover>
    </div>
  );
}
Options: MagneticOptions

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).

H05 · Spotlight

spotlight paints a radial light that follows the pointer: color, size (240 px) and intensity (0.22). Under reduced motion the light is centred and does not follow.

Import
@neshel-ui/animations/hover
API
spotlight, Hover
Stylesheet
@neshel-ui/animations/hover.css
Reduced motion
static — the decoration or content stays still
Performance
Repaints the element (colour, gradient, clip, mask, blur or stroke) while it runs; keep the area small.
Preview: H05
Preview theme: H05
h05.tsx
"use client";
import "@neshel-ui/animations/hover.css";
import { Hover, spotlight } from "@neshel-ui/animations/hover";

export default function H05Example() {
  return (
    <Hover preset={spotlight} options={{ size: 200, intensity: 0.35 }} asChild>
      <a
        href="#h05"
        className="rounded-xl border border-neshel-border bg-neshel-surface p-6 text-neshel-surface-foreground block max-w-sm py-12"
      >
        A light follows the pointer
      </a>
    </Hover>
  );
}
Options: SpotlightOptions

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").

H06 · Border sweep

borderSweep runs a gradient along the border while active: width (2 px), two colors and duration (3000 ms). It uses the ::after layer, so it coexists with effects that use ::before.

Import
@neshel-ui/animations/hover
API
borderSweep, Hover
Stylesheet
@neshel-ui/animations/hover.css
Reduced motion
static — the decoration or content stays still
Performance
The package stylesheet renders it on layers owned by the package; your element gets no transition or animation.
Preview: H06
Preview theme: H06
h06.tsx
"use client";
import "@neshel-ui/animations/hover.css";
import { borderSweep, Hover } from "@neshel-ui/animations/hover";

export default function H06Example() {
  return (
    <Hover preset={borderSweep} options={{ width: 2, duration: 2400 }} asChild>
      <a
        href="#h06"
        className="rounded-xl border border-neshel-border bg-neshel-surface p-6 text-neshel-surface-foreground inline-block"
      >
        A gradient runs along the border
      </a>
    </Hover>
  );
}
Options: BorderSweepOptions

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).

H07 · Underline grow

underline draws a line under the element: thickness (2 px), color and origin (left, center or right). In running text keep the native link underline; colour alone does not identify a link.

Import
@neshel-ui/animations/hover
API
underline, Hover
Stylesheet
@neshel-ui/animations/hover.css
Reduced motion
instant — the end state appears at once
Performance
The package stylesheet renders it on layers owned by the package; your element gets no transition or animation.
Preview: H07
Preview theme: H07
h07.tsx
"use client";
import "@neshel-ui/animations/hover.css";
import { Hover, underline } from "@neshel-ui/animations/hover";

export default function H07Example() {
  return (
    <Hover preset={underline} options={{ thickness: 2, origin: "left" }} asChild>
      <a href="#h07" className="inline-block pb-1">
        Read the case study
      </a>
    </Hover>
  );
}
Options: UnderlineOptions

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).

H08 · Media zoom

mediaZoom scales the media inside a frame: scale (1.08, up to 2). The target is the child with data-neshel-media, or the first child, and the frame clips it.

Import
@neshel-ui/animations/hover
API
mediaZoom, Hover
Stylesheet
@neshel-ui/animations/hover.css
Reduced motion
static — the decoration or content stays still
Performance
Transform and opacity, one write per frame through the shared scheduler; no layout work per frame.
Preview: H08
Preview theme: H08

Loading the example…

h08.tsx
"use client";
import "@neshel-ui/animations/hover.css";
import { Hover, mediaZoom } from "@neshel-ui/animations/hover";
import { picture } from "./picture";

export default function H08Example() {
  return (
    <Hover
      preset={mediaZoom}
      options={{ scale: 1.15 }}
      className="w-80 max-w-full overflow-hidden rounded-xl"
    >
      <img src={picture("Zoom", 210, 260)} alt="Blue gradient" width={640} height={400} />
    </Hover>
  );
}
Options: MediaZoomOptions

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").

H09 · Pointer parallax

parallax moves layers by different amounts with the pointer. Mark them with data-neshel-depth between −2 and 2; strength (16 px) is the amplitude. Decorative and pointer only.

Import
@neshel-ui/animations/hover
API
parallax, Hover
Stylesheet
none needed
Reduced motion
off — no motion at all
Performance
Transform and opacity, one write per frame through the shared scheduler; no layout work per frame.
Preview: H09
Preview theme: H09

Two layers, two depths

h09.tsx
"use client";
import { Hover, parallax } from "@neshel-ui/animations/hover";

export default function H09Example() {
  return (
    <Hover
      preset={parallax}
      options={{ strength: 24 }}
      className="relative grid h-48 max-w-md place-items-center overflow-hidden rounded-xl bg-neshel-muted"
    >
      <div
        data-neshel-depth="-1"
        className="absolute size-32 rounded-full bg-neshel-accent"
        aria-hidden="true"
      />
      <p
        data-neshel-depth="1"
        className="rounded-xl border border-neshel-border bg-neshel-surface p-6 text-neshel-surface-foreground relative"
      >
        Two layers, two depths
      </p>
    </Hover>
  );
}
Options: ParallaxOptions

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).

H10 · Shine sweep

shine crosses the element once with a band of light each time it becomes active: color, angle (110°) and duration (700 ms). Nothing is drawn under reduced motion.

Import
@neshel-ui/animations/hover
API
shine, Hover
Stylesheet
@neshel-ui/animations/hover.css
Reduced motion
static — the decoration or content stays still
Performance
The package stylesheet renders it on layers owned by the package; your element gets no transition or animation.
Preview: H10
Preview theme: H10
h10.tsx
"use client";
import "@neshel-ui/animations/hover.css";
import { Hover, shine } from "@neshel-ui/animations/hover";

export default function H10Example() {
  return (
    <Hover preset={shine} options={{ angle: 110, duration: 800 }} asChild>
      <a
        href="#h10"
        className="rounded-xl border border-neshel-border bg-neshel-surface p-6 text-neshel-surface-foreground inline-block"
      >
        A glare crosses the card
      </a>
    </Hover>
  );
}
Options: ShineOptions

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").

H11 · Cursor follower

<CursorFollower> renders a decorative, aria-hidden circle that follows a fine pointer inside its area with a spring (size, spring, blend). The real cursor stays visible.

Import
@neshel-ui/animations/hover
API
cursorFollower, CursorFollower
Stylesheet
@neshel-ui/animations/hover.css
Reduced motion
off — no motion at all
Performance
Transform and opacity, one write per frame through the shared scheduler; no layout work per frame.
Preview: H11
Preview theme: H11
Move a mouse or pen here
h11.tsx
"use client";
import "@neshel-ui/animations/hover.css";
import { CursorFollower } from "@neshel-ui/animations/hover";

export default function H11Example() {
  return (
    <CursorFollower
      size={48}
      className="grid h-40 max-w-md place-items-center rounded-xl bg-neshel-muted"
    >
      Move a mouse or pen here
    </CursorFollower>
  );
}
Options: CursorFollowerOptions

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").
Edit on GitHub

On this page