Back to Components
Component that provides parallax effect in response to scrolling. Supports various directions, speeds, and additional effects.
설치
Import
고급/Pro 컴포넌트는 @hua-labs/ui/advanced에서 제공됩니다.
UI 컴포넌트, 모션 훅, i18n을 하나의 패키지로 사용할 수 있습니다.
라이브 데모
기본 사용법
다양한 방향
효과 조합
Props
| 이름 | 타입 | 기본값 | 설명 |
|---|---|---|---|
speed | number | 0.5 | Parallax speed (0-1, 1 is fastest) |
direction | "up" | "down" | "left" | "right" | "up" | Movement direction |
offset | number | 0 | Starting offset in pixels |
disabled | boolean | false | Disable parallax effect |
scale | boolean | false | Add scale effect based on scroll position |
opacity | boolean | false | Add opacity effect based on scroll position |
rotate | boolean | false | Add rotation effect based on scroll position |
rotateDirection | "cw" | "ccw" | "cw" | Rotation direction (clockwise or counter-clockwise) |
코드 예시
접근성
- •모션 줄이기: prefers-reduced-motion 설정을 반영합니다
- •콘텐츠 접근성 무영향: 시각적 효과에만 영향을 미치며 콘텐츠 접근성에는 영향을 주지 않습니다