Pull refresh
Pull to refresh you can feel arming: a ring draws as you pull and closes at the line.
On this page
Pull the list down and it gives less the further you go; a ring draws round the arrow and, at the line, closes and turns blue. Let go and it spins, checks green and springs back.
Drag the list down from the top and it gives less the further you go. A ring draws round the arrow as you pull; at the line it closes, the arrow turns over and the ring takes colour, so you know letting go will do it. Let go and the ring spins while it loads, closes into a check and the list springs back up.
Installation
Usage
import { PullRefresh } from "@/components/ui/chatcn/pull-refresh"
<PullRefresh className="h-[480px]" onRefresh={() => refetch()}>
<ThreadList />
</PullRefresh>Pulling is a gesture, so keep a refresh control elsewhere for keyboard and screen reader users.
Props
| Prop | Type | Notes |
|---|---|---|
onRefresh | () => Promise<unknown> | The ring spins until it settles |
threshold | number | Px to pull before letting go refreshes. Default 72 |
Accessibility
- Refreshing and Up to date are announced politely.
Motion
- A
tanhrubber band; the release rides a spring. Touch uses native listeners so normal scrolling is untouched.