Skip to content
Docs
훅으로 돌아가기

useBounceIn

@hua-labs/hua/motion

탄성 있는 바운스 애니메이션으로 등장

설치

bash
npm install @hua-labs/hua
Import
tsx
import { useBounceIn } from "@hua-labs/hua/framework";

@hua-labs/motion-core의 모션 훅을 @hua-labs/hua/framework에서 통합 제공합니다.

UI 컴포넌트, 모션 훅, i18n을 하나의 패키지로 사용할 수 있습니다.

기본 사용법

tsx
const bounceIn = useBounceIn({ duration: 600 });

return (
  <div ref={bounceIn.ref} style={bounceIn.style}>
    Content bounces in
  </div>
);

라이브 데모

바운스 강도 데모

0.2
Light
intensity: 0.2
0.3
Normal
intensity: 0.3
0.5
Strong
intensity: 0.5

API 레퍼런스

옵션

이름타입기본값설명
durationnumber600docs:hooks.use-bounce-in.options.duration
delaynumber0docs:hooks.use-bounce-in.options.delay
intensitynumber0.3docs:hooks.use-bounce-in.options.intensity
thresholdnumber0.1docs:hooks.use-bounce-in.options.threshold
triggerOncebooleantruedocs:hooks.use-bounce-in.options.triggerOnce
easingstring"cubic-bezier(0.34, 1.56, 0.64, 1)"docs:hooks.use-bounce-in.options.easing
autoStartbooleantruedocs:hooks.use-bounce-in.options.autoStart
onComplete() => void-docs:hooks.use-bounce-in.options.onComplete
onStart() => void-docs:hooks.use-bounce-in.options.onStart
onStop() => void-docs:hooks.use-bounce-in.options.onStop
onReset() => void-docs:hooks.use-bounce-in.options.onReset

반환값

이름타입설명
refRefObject<T | null>docs:hooks.use-bounce-in.returns.ref
styleCSSPropertiesdocs:hooks.use-bounce-in.returns.style
isVisiblebooleandocs:hooks.use-bounce-in.returns.isVisible
isAnimatingbooleandocs:hooks.use-bounce-in.returns.isAnimating
progressnumberdocs:hooks.use-bounce-in.returns.progress
start() => voiddocs:hooks.use-bounce-in.returns.start
stop() => voiddocs:hooks.use-bounce-in.returns.stop
reset() => voiddocs:hooks.use-bounce-in.returns.reset

커스텀 강도

tsx
const bounceIn = useBounceIn({
  intensity: 0.5,  // More pronounced bounce overshoot
  duration: 800,
});

사용 사례

알림

알림 배지 및 팝업 애니메이션

배지

카운트 변경 시 배지 애니메이션

아이콘

아이콘 상태 변경 애니메이션

버튼

버튼 호버 및 클릭 피드백 효과