Skip to content
API Reference

@hua-labs/motion-core

v1.0.0-alpha

25개 이상의 애니메이션 훅. 의존성 없이 순수 CSS/JS로 구현.

Installation

pnpm add @hua-labs/motion-core

Available Hooks

25개의 애니메이션 훅

useFadeInFade in animation
useFadeOutFade out animation
useSlideUpSlide up from bottom
useSlideDownSlide down from top
useSlideLeftSlide in from right
useSlideRightSlide in from left
useScaleScale animation
useRotateRotation animation
useBlurBlur transition
useBounceBounce effect
useFloatFloating animation
useShakeShake effect
usePulsePulse animation
useFlip3D flip
useTypewriterTypewriter text effect
useCounterNumber counting animation
useParallaxParallax scroll effect
useStaggerStaggered list animation
useMorphShape morphing
useGlowGlow effect
useWaveWave animation
useSpringSpring physics
useGestureGesture-based animation
useScrollScroll-linked animation
useInViewIntersection observer wrapper

Basic Usage

import { useFadeIn, useSlideUp } from '@hua-labs/motion-core';

function MyComponent() {
  const fadeIn = useFadeIn({ duration: 800, delay: 0 });

  return (
    <div ref={fadeIn.ref} style={fadeIn.style}>
      Content fades in on mount
    </div>
  );
}

Hook Return Value

interface MotionResult {
  ref: React.RefObject<HTMLElement>;  // Attach to element
  style: React.CSSProperties;         // Apply to element
  isVisible: boolean;                 // Currently visible
  isAnimating: boolean;               // Animation in progress
  progress: number;                   // 0-1 progress
  start: () => void;                  // Start animation
  stop: () => void;                   // Stop animation
  reset: () => void;                  // Reset to initial
  pause: () => void;                  // Pause animation
  resume: () => void;                 // Resume animation
}

Features

  • Zero dependencies - 순수 CSS transform + opacity
  • GPU accelerated - 60fps 부드러운 애니메이션
  • SSR compatible - 서버 렌더링 안전
  • Respects prefers-reduced-motion - 접근성 고려
  • TypeScript - 완전한 타입 지원

각 훅별 상세 옵션은 별도 문서 사이트에서 제공 예정.