Pull To Refresh
사용자가 화면을 아래로 당겨 콘텐츠를 새로고침할 수 있게 해주는 컴포넌트입니다. 모바일 환경에서 최신 콘텐츠를 불러올 때 사용됩니다.
Installation
의존성 설치
아래 코드를 복사 후 붙여넣고 사용하세요
Props
PullToRefreshRoot
Prop
Type
asChild?boolean | undefined
Whether the element should be rendered as a child of a slot.
Default
false
threshold?number | undefined
The threshold value to trigger the refresh. (px)
Default
88
displacementMultiplier?number | undefined
The multiplier to calculate displacement from the touch movement.
Default
0.75
onPtrPullStart?((ctx: PullToRefreshContext) => void) | undefined
Callback when the pull-to-refresh has started to pull.
onPtrPullMove?((ctx: PullToRefreshContext) => void) | undefined
Callback when the pull-to-refresh is moving during the pull.
onPtrPullEnd?((ctx: PullToRefreshContext) => void) | undefined
Callback when the pull-to-refresh is released.
It does not matter if it is ready or not. If you want to handle the refresh, use onPtrRefresh.
The context depends on how the pull ended. Releasing the pointer reports the
final coordinates, while a pull aborted by touchcancel/pointercancel or by
disabled flipping on reports the already reset context (y: -1,
displacement: 0), so an interrupted pull never surfaces a stale displacement.
onPtrReady?(() => void) | undefined
Callback when the pull-to-refresh is pulled over the threshold.
onPtrRefresh?(() => Promise<void>) | undefined
Callback when the pull-to-refresh is released after ready.
disabled?boolean | undefined
Whether to disable the pull-to-refresh.
Default
false
PullToRefreshIndicator
Prop
Type
PullToRefreshContent
Prop
Type
asChild?boolean | undefined
Whether the element should be rendered as a child of a slot.
Default
false
Examples
PTR in Tabs
Disabled
disabled 속성을 사용하여 PTR를 비활성화할 수 있습니다.
Prevent Pull
PullToRefresh.preventPull 속성을 사용하여 특정 영역에서 PTR 동작을 방지할 수 있습니다. user-select: auto;등을 통해 텍스트 선택이 가능한 영역에서 주로 사용됩니다.
Last updated on 2026. 8. 2.