본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

useScrollTop

원문 보기 위키 갱신

useScrollTop은 컨테이너의 맨 위로 스크롤하는 방법을 제공하는 hook이에요.

출처: 문서

본문

사용법 (Usage)

import { useScrollTop } from '@primereact/hooks/use-scrolltop';
const scrollTop = useScrollTop();

예제 (Examples)

기본 (Basic)

useScrollTop은 기본적으로 window 스크롤을 수신해요.

target 옵션을 설정하면 useScrollTop이 스크롤되는 콘텐츠를 가진 이 요소에 바인딩돼요.

요소 (Element)

더 알아보기 (Learn more)