Skip to content
Docs
컴포넌트로 돌아가기

ScrollIndicator

@hua-labs/ui
v1.1.0

스크롤 가능함을 표시하는 애니메이션 인디케이터입니다. 클릭 시 대상 요소나 다음 섹션으로 스크롤합니다.

설치

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

@hua-labs/ui의 UI 컴포넌트를 @hua-labs/hua에서 통합 제공합니다.

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

라이브 데모

데모 영역

Props

이름타입기본값설명
targetIdstring-Element ID to scroll to on click
textstring"Scroll down"Display text
position"bottom-center" | "bottom-left" | "bottom-right""bottom-center"Display position
variant"default" | "primary" | "secondary" | "outline""default"Color variant
size"sm" | "md" | "lg""md"Text size
animatedbooleantrueEnable bounce animation
autoHidebooleantrueAuto hide on scroll
hideThresholdnumber100Hide after scrolling this many pixels
iconNameIconName-Icon to display
iconSizenumber-Icon size (pixels)

Code Examples

docs:common.basicUsagetsx
1import { ScrollIndicator } from '@hua-labs/ui/navigation';
2 
3<div className="relative min-h-screen">
4 <ScrollIndicator />
5</div>
docs:components.scrollIndicator.examples.scrollToElementtsx
1<ScrollIndicator
2 targetId="features-section"
3 text="See Features"
4 position="bottom-right"
5 variant="primary"
6/>
docs:components.scrollIndicator.examples.customSettingstsx
1<ScrollIndicator
2 text="더 보기"
3 animated
4 autoHide={false}
5 size="lg"
6/>

접근성

  • aria-label: 버튼에 text prop 값이 aria-label로 포함
  • 버튼에 키보드로 포커스 및 클릭 가능: 버튼에 키보드로 포커스 및 클릭 가능