useHoverMotion
@hua-labs/hua/motion
bash
npm install @hua-labs/huatsx
import { useHoverMotion } from "@hua-labs/hua/framework";tsx
const hover = useHoverMotion({
hoverScale: 1.05,
hoverY: -2,
duration: 200,
});
return (
<div ref={hover.ref} style={hover.style}>
Hover me for scale + lift effect
</div>
);Scale
Lift
Glow
| duration | number | 200 | Transition duration in milliseconds |
| easing | string | "ease-out" | CSS easing function |
| hoverScale | number | 1.05 | Scale factor on hover |
| hoverY | number | -2 | Vertical offset on hover (px) |
| hoverOpacity | number | 1 | Opacity on hover |
| ref | RefObject<T | null> | Ref to attach to element |
| style | CSSProperties | Animated style with transform, opacity, transition |
| isHovered | boolean | Whether element is currently hovered |
| isVisible | boolean | Visibility state (always true) |
| isAnimating | boolean | Whether hover transition is in progress |
| progress | number | Hover progress (0 or 1) |
| start | () => void | Programmatically activate hover state |
| stop | () => void | Stop animation |
| reset | () => void | Reset to unhovered state |