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.

Updates

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.

More optionsFewer options

Refresh time

How long it spins before new items arrive.

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.

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 GitHub

What it is

The full explanation is in README.md.

Good for

  • Feeds
  • Inboxes
  • Notifications
  • Order lists

Avoid on

  • Desktop-only pages
  • Lists that rarely change