Pull to Refresh
betaA sheet you pull down to refresh, with rubber-band resistance, a dot ring that fills as you pull and springs that carry the pull's velocity.
- Feedback
- 1 file
- 2 npm packages
- Accessibility notes
- Animates with motion
pnpm dlx @dowel-ui/cli add pull-to-refreshnpm packages installed: class-variance-authority, motion.
import { PullToRefresh } from "@/components/ui/pull-to-refresh";Default
Gallery
Scrolling Feed
<PullToRefresh>
| Prop | Type | Default |
|---|---|---|
cornerSheet radius in px, 0–40. Default 26. | number | 26 |
disabled | boolean | false |
dotsDots in the ring, 3–10. Default 6. | number | 6 |
fill | "light" | "dark" | "light" |
hintInstructions linked to the sheet with aria-describedby. | string | "Pull down, or press Enter, to refresh." |
labelNames the sheet. Default "Refreshable content". | string | "Refreshable content" |
minDurationShortest time the refreshing state shows, so a fast refresh still reads (ms). Default 600. | number | 600 |
onRefreshRuns the refresh. The sheet stays in the refreshing state until a returned promise settles. | () => Promise<unknown> | void | — |
refreshButtonLabelThe refresh button's text. Default "Refresh". | string | "Refresh" |
refreshedLabelAnnounced when a refresh ends. Default "Refreshed". | string | "Refreshed" |
refreshingControlled refreshing state. Leave undefined to let the promise drive it. | boolean | — |
refreshingLabelAnnounced when a refresh starts. Default "Refreshing…". | string | "Refreshing…" |
showRefreshButtonRenders a visible Refresh button under the sheet. Default true. | boolean | true |
spinRing rotation speed, 0–100 (2400ms per turn at 50). Default 50. | number | 50 |
strokeA 1px inset hairline on the sheet. | boolean | false |
thresholdPull distance (px) that arms the refresh; also the resting offset while refreshing. Default 58. | number | 58 |
children | ReactNode | — |
Plus every attribute of <div> except onRefresh.
8/8
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — does not apply
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes