04.29 · Micro-Interactions
Pull to Refresh
Pulling a list down shows a spinner, then new items. Best for feeds.
Drag it
Drag the list down from the top and let go, or press Show me.
Inside, the dashed line is where letting go refreshes; the arrows show your finger moves farther than the list, which resists. Drag the list down, or press Show me.
No pull: the list ignores your finger and new items just pop in; Pull to refresh: it follows, resisting, and spins until new items arrive. Drag the list, or press Show me.
Try it
Change a setting, then try it again or press Show me.
Pull distance
How far to pull before letting go refreshes.
Resistance
Higher makes the list fight back harder.
Spinner
The shape that turns while it refreshes.
Copy the prompt
Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.
Add pull to refresh to [the scrolling list or feed that should reload]. When the list is already at its top and the visitor drags it down, move it with the finger but make it resist more the further it goes, and show a spinner above it that fades in and turns as it is pulled. Let go past the line and the list stays down while the spinner keeps turning and new items load, then everything slides back up with the new items on top; a shorter pull just springs back. Also offer a refresh button for people who cannot drag. If the visitor has reduced motion turned on, snap back without sliding. Match the settings listed below.
Your settings
Replace the words in brackets with your own element. Your settings are added at the end.
Free and open source. If this helped, a star on GitHub helps other people find it.
Star on GitHubWhat it is
The full explanation is in README.md.