UI Micro-interactions
Pull to Refresh
A phone-frame list supports pointer/touch pull and a native Refresh button. First input stops attract refreshes; manual refresh completes its spinner, row flash and settling, or completes immediately with reduced motion.
css+canvasmedium complexitymoderate motionpointer+keyboardmobile-ready
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
1
When to use it
Demoing mobile pull-to-refresh patterns, onboarding flows showing gesture affordances, or UI kit showcases.
When not to
Production data refresh without connecting the local action to a request. This mockup updates local visual feedback only.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Tune MAX=60 pull distance, SPIN_MS=1400 refresh duration, SETTLE_MS=260 return duration and the --c06-* palette tokens. Preserve native Refresh button, Enter/Space activation, pointer capture/cancel, finite manual work, elapsed-time suspension while hidden and permanent attract stop at first input. The idle demo delay is 2400ms and runs only while demo is enabled. Theme: :root tokens, [data-theme="light"] and forever:theme message hook.
Safe to edit
- pull threshold and maximum pull (MAX=60; clamp MAX*1.3)
- refresh spin duration (SPIN_MS=1400)
- settle duration (SETTLE_MS=260)
- guarded idle demo delay (2400ms)
- row count (7), responsive dimensions and row flash timing (300ms +40ms stagger)
- theme tokens (--c06-* and [data-theme=light])
Keep intact
- IIFE wrapper and um06 namespace
- native Refresh button, visible focus, Enter/Space and status announcements
- unified Pointer Events, pointer capture/cancel and touch-action:none
- finite spin/settle state, idle renderer sleep and visibility elapsed-time pause/resume
- meaningful reduced-motion refresh completion
- demo-v1 lifecycle; initial __foreverPreview.demoEnabled flag and forever:interactive event stop attract only
- theme bootstrap and forever:theme message listener
Known limitations
- Refresh visual feedback is local; no network request or data persistence is connected.
- Input during an active manual refresh is ignored until it completes; the first input can interrupt an attract refresh.
- Format/theme remount preserves takeover, not local refresh count or component values.
More UI Micro-interactions components
- Add to Cart FlyNative Add button flings a product clone into a cart; first input cancels unfinished attract flights, while each manual action keeps its full 680ms flight…
- Notification BellSVG bell swings and rings with a ripple wave on click; a red badge counter pops in with a springy bounce and increments each ring. Auto-cycles every 2…
- Copy ConfirmCopy icon morphs to a drawn-stroke checkmark with a green button flash and a "Copied!" toast on click; auto-cycles as a demo loop.
- Swipe Card StackTinder-style draggable card stack — drag the top card left/right to reveal NOPE/LIKE stamps; fling-away animates it off-screen and cycles to the next card.
- Accordion ExpandThree FAQ panels smoothly expand and collapse with a CSS height transition; a chevron rotates 180 degrees to indicate open state. Auto-cycles as demo.
- Tooltip PopHeart icon button springs a mint-green tooltip above it on hover with a cubic-bezier spring pop; click triggers a subtle press-bounce via Web Animations API.