Hover reveal
Content that smoothly reveals on hover with spring physics. Revealed section springs in with opacity, height, and translateY all driven by a damped spring. Pastel border line shifts colour with cursor position.
- Spring Physics
- requestAnimationFrame
- pastelColour
hover-reveal
Pricing
Features
Support
Hover each item to reveal details.
Usage
Drop it in
import { HoverReveal } from "@/app/lib/components/hover-reveal";<HoverReveal revealContent={<p>Hidden detail</p>}>
<span>Hover me</span>
</HoverReveal>
<HoverReveal direction="up" revealContent="Above">Below</HoverReveal>API
Props
| Prop | Type | Default |
|---|---|---|
children*Always-visible content | ReactNode | — |
revealContent*Content revealed on hover | ReactNode | — |
directionDirection the reveal opens toward. Default: "down" | "up" | "down" | "down" |
classNameAdditional class names on the outer wrapper | string | "" |
Read from the component's source at build time. * required.
Accessibility
Works with
- Cursor
- Reacts to where the pointer is, not just whether it's over the element.
- Touch
- Follows your finger while it's down, then settles a moment after you lift.
- Keyboard
- Focus lights it up the way the cursor does. Every action has a key.
- Reduced motion
- Nothing moves or springs. Colour still answers, without drifting.