For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /examples/pull-to-refresh.md.

Pull to Refresh

A list that reloads when you pull it down, built from the <refresh> and <refresh-header> elements.

What it shows

  • <refresh> — wraps a header and a <scroll-view>, and adds the pull-down gesture. It has h-full w-full, because without a size it draws nothing. See <refresh>.
  • <refresh-header> — the content revealed while you pull. Here it reads "Pull down to refresh" or "Refreshing...".
  • (bindstartrefresh) — fires when a refresh starts. The handler sets refreshing, then replaces the items after a delay.
  • finishRefresh — once the items are replaced, invoke('finishRefresh') on the <refresh> element hides the header. Without it, the header stays open. See Call element methods.
  • setTimeout as a stand-in — the delay simulates loading. Fetching data from a component isn't supported yet. See Network requests.