The smallest, cleanest pull-to-refresh for the web. No framework needed. Plug in, configure one callback, ship.
Grab the handle and pull down. Works with both mouse and touch on any device.
Grab the handle & pull down
The indigo progress bar fills as you drag. When it hits 100% and you release, your async callback fires. The spinner waits for your Promise to resolve — then resets automatically.
onRefresh
promise resolves.A focused library that does one thing and does it perfectly.
require(), or import.One constructor. Three options. One method to clean up.
container is a CSS selector
or HTMLElement.1// ① Import (or use a <script> tag) 2import Pully from 'pullyjs'; 3 4// ② Initialize 5const pully = new Pully('#feed', { 6 // required: your refresh logic 7 onRefresh: async () => { 8 const posts = await fetchLatest(); 9 renderFeed(posts); 10 }, 11 12 // optional: fires on release, before refresh 13 onRelease: () => analytics.track('pull'), 14 15 // optional: pixels to drag (default: 100) 16 threshold: 80, 17}); 18 19// ③ Clean up (e.g. SPA route change) 20pully.destroy();
One command. One constructor. One callback.
Or drop the script tag — no build step needed: