useRepeat
@hua-labs/hua/motion
bash
npm install @hua-labs/huatsx
import { useRepeat } from "@hua-labs/hua/framework";tsx
const repeat = useRepeat({ type: "pulse", intensity: 0.1 });
return (
<div ref={repeat.ref} style={repeat.style}>
Pulsing element
</div>
);count: -1 (infinite)
count: 3
: 0/3
| type | "pulse" | "bounce" | "wave" | "fade" | "pulse" | Preset animation type |
| duration | number | 1000 | Animation cycle duration in milliseconds |
| delay | number | 0 | Delay before starting |
| intensity | number | 0.1 | Animation intensity (scale/opacity amount) |
| autoStart | boolean | true | Start repeating automatically |
| ref | RefObject<T | null> | Ref to attach to element |
| style | CSSProperties | Animated style (transform + opacity + transition) |
| isVisible | boolean | Visibility state (always true) |
| isAnimating | boolean | Whether animation is active |
| progress | number | Current cycle progress (0-1) |
| start | () => void | Start repeating |
| stop | () => void | Stop repeating and reset |
| reset | () => void | Reset to initial state |