StealThis .dev

Pull to Refresh

Pull-down-to-refresh indicator for mobile lists. Shows a spinner when the user pulls past the threshold, then resets the list. No libraries.

Open in Lab
vanilla-js css
Targets: JS HTML React Native

Expo Snack

Code

Pull to Refresh

A native-feeling pull-to-refresh interaction for scrollable lists. Pulling down past a threshold reveals a spinner and triggers a simulated refresh with new content.

How it works

  1. touchstart records the initial Y position only when the list is scrolled to the top
  2. touchmove translates the list downward and rotates the pull arrow as a progress indicator
  3. Past the 80px threshold the arrow becomes a spinner and .triggered state is set
  4. On touchend a short async “refresh” runs, new items prepend to the list, and the indicator retracts

Performance

  • Uses transform: translateY (not top) to keep the pull animation on the compositor thread
  • The pull indicator is absolutely positioned above the scroll container so no layout reflow occurs

When to use it

  • Mobile feeds and social timelines
  • Notification or message lists
  • Any scrollable list that benefits from manual refresh