Controls

Pull to Refresh

Pull to Refresh
Activity
  • Deployed main to production7m ago
  • Merged fix for login redirect14m ago
  • Preview ready for feat/search21m ago
  • Rolled back edge config28m ago
  • Build cache warmed35m ago
  • Opened issue: flaky e2e test42m ago
  • Bumped motion to 12.4049m ago
  • Deployed docs site56m ago
Drag the feed down and let go

Pull to Refresh

A pull-to-refresh container with a masked pixel hero who climbs into the gap and holds up the page.

Dependencies

motion

Installation

npx shadcn@latest add ikislay/pixel-ui/pull-to-refresh

How to use

import { PullToRefresh } from "@/components/ui/pull-to-refresh";
export default function Demo() {
return (
<PullToRefresh className="h-96" onRefresh={() => fetch("/api/feed")}>
{/* your scrollable content */}
</PullToRefresh>
);
}

Source Code

// Loading…

Props

Options you can pass to customize this component.

Prop
Type
Description
onRefresh
() => void | Promise<void>

Runs when you let go after the hero jumps. The page stays open until it settles, for at least 1.1 seconds.

className
string

Classes applied to the root. Give it a height; the content scrolls inside it.