
Loaders · €7
Pull to refresh
Pull a list down and a strand of ink snaps into the Bot, which turns round while your refresh runs.
Pay once on Gumroad: the download, plus a licence key for the registry and the MCP server.
Details
- Category
- Loaders
- Plan
- Paid, €7 once
- Code
- React + Tailwind, TypeScript · 295 lines
- Files
- PullToRefresh.tsx
- Needs
- The Bot (installed with it)
- Agents
- MCP server and shadcn registry
About
Pull a list down and a strand of ink stretches between the top and the list, right under your finger. It follows you left and right and gets thinner as you pull. Past the line it snaps: the ends spring back and the middle rolls into a drop that opens its eyes. That's the Bot.
Right where it snapped, the Bot turns round while your refresh runs (face, back, face again), smiles when it's done, and gets sucked back up as the list springs home.
Trackpad (two-finger scroll), mouse drag and touch. The pull gets heavier the further it goes, like rubber. White or black. React + Tailwind and the Bot, no other libraries. Respects reduced motion.
Install
Once: add the StackD registry to components.json, with the licence key from your receipt in STACKD_LICENSE_KEY (in .env.local):
"registries": {
"@stackd": {
"url": "https://www.stackd.codes/r/{name}.json",
"headers": { "X-License-Key": "${STACKD_LICENSE_KEY}" }
}
}With the shadcn CLI:
npx shadcn@latest add @stackd/pull-to-refreshOr let your agent add it through the StackD MCP server:
claude mcp add --transport http stackd https://www.stackd.codes/mcpPrompt for your agent
Paste it into Claude Code, Cursor, Codex or VS Code once the MCP server is connected.
Add the StackD Pull to refresh component to this project. Use the StackD MCP server: call get_component with { "name": "pull-to-refresh" }, write the files at the paths it gives and install any npm packages it lists. Then use it where it fits, following its README for the props, and keep its own styles. It is a paid component: if the server says it needs a licence, tell me where to buy it.Use
- Copy
PullToRefresh.tsxandBot.tsxinto the same folder (for examplecomponents/). - Wrap your list and give it a height:
import { PullToRefresh } from './components/PullToRefresh'
<PullToRefresh onRefresh={() => fetchLatest()} className="h-[480px]">
<ul>{items.map((i) => <li key={i.id}>{i.title}</li>)}</ul>
</PullToRefresh>
onRefresh returns a promise. The Bot keeps turning until it resolves (or fails). The list inside scrolls as usual; pulling only starts when it's at the top.
This Bot.tsx has a turn prop that older copies of the Bot don't have. If you already use the Bot from StackD, replace it with this one; everything else stays the same.
In Next.js the files already start with 'use client'. In other React setups that line does nothing.
Options
| Prop | Default | What it does |
|---|---|---|
onRefresh | Your refresh, returning a promise | |
children | The list | |
threshold | 84 | How far to pull (px) before it snaps and letting go refreshes |
theme | 'light' | 'light' (white, ink strand and Bot) or 'dark' |
labels | What screen readers hear: { pull, release, loading, done } | |
className / style | h-[480px] | The box. Give it a height |
Accessibility
Screen readers hear "Pull to refresh", "Let go to refresh", "Refreshing" and "Up to date". With reduced motion on, nothing springs or turns; the list just moves and comes back.
Colours from StackD
White #FFFFFF · Ink #141310 · Wine #901919 · Olive #6C8544 · Ochre #BE9344 · Lilac #C9B8FF
Licence
You can use it in personal and commercial projects. Don't resell or share the component on its own.
Made by StackD · stackd.codes
