Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Pull to Refresh

Preview

Pull to refresh

Activity

Pull down to check for updates

live

Motion review approved

4m

The pull request is ready to merge.

New component feedback

18m

The spring feels much closer to native now.

Registry checks passed

31m

All component files resolved successfully.

Preview deployed

1h

The latest build is ready to inspect.

Docs comment resolved

2h

The usage example now covers async refreshes.

Install

Add it with your package manager, or copy the source manually.

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/pull-to-refresh

Import the shared styles once in your application.

TSUsage
import PullToRefresh from '@/components/beui/layout/PullToRefresh.vue'
import '@/components/beui/styles.css'

API Reference

onRefresh
() => void | Promise<void>

Runs after the user pulls beyond the threshold and releases. A prop rather than an event, because the pull waits for the returned promise.

Default—
refreshing?
boolean

Keeps the indicator active while an externally managed refresh runs.

Defaultfalse
disabled?
boolean
Defaultfalse
threshold?
number

Resisted pull distance in pixels required to refresh.

Default76
maxPull?
number

Maximum resisted pull distance in pixels.

Default132
holdDistance?
number

Content offset in pixels while refreshing.

Default68
pullingLabel?
string

Text shown while pulling. The `pullingLabel` slot takes over for rich content.

Default—
releaseLabel?
string

Text shown once the pull passes the threshold. The `releaseLabel` slot takes over for rich content.

Default—
refreshingLabel?
string

Text shown while refreshing. The `refreshingLabel` slot takes over for rich content.

Default—
ariaLabel?
string
Default—
labels?
Partial<typeof pullToRefreshMessages>

Override any built-in string.

Default—
className?
string

Same as `class`.

Default—
contentClassName?
string
Default—
indicatorClassName?
string
Default—
label?
string

Accessible name of the keyboard refresh button.

Default—
@error?
(reason: unknown) => void
Default—
#default?
{ refresh: () => Promise<void>; state: PullToRefreshStatus }
Default—
#pullingLabel?
slot

Label while pulling; replaces `pullingLabel`.

Default—
#releaseLabel?
slot

Label once the pull passes the threshold; replaces `releaseLabel`.

Default—
#refreshingLabel?
slot

Label while refreshing; replaces `refreshingLabel`.

Default—

Updated