Skip to content

PullToRefresh ​

Drag down to reload

Pull down at the top of a list to reload it, the way phone apps do. It only works by touch, so also give a visible refresh button for everyone else.

Basic
  • 第1話
  • 第2話
  • 第3話
  • 第4話
  • 第5話
  • 第6話
Or drag down from the top of the list; past 64px the arrow flips — release to refresh.
  • @refresh gets a done callback; call it when the reload has finished. "Refreshing" (refreshingLabel) is announced meanwhile.
  • threshold is how far to pull; scrollTarget is the container whose top counts, when it isn't the wrapper.

Usage ​

ts
import { BlessPullToRefresh } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
thresholdnumber64px of pull that triggers a refresh
maxnumber96max visual travel
disabledboolean—
scrollTargetHTMLElement | null—scroll container to check; default = the wrapper itself, falling back to window
refreshingLabelstring"Refreshing"announced while refreshing

Events

NamePayloadDescription
refresh[done: () => void]

Slots

NameScopeDescription
indicator{ ready: boolean; busy: boolean; pull: number; }
default—

Released under the MIT License. Character names and artwork belong to their owners.