This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Reference Expo UI Jetpack Compose PullToRefreshBox A Jetpack Compose PullToRefreshBox component for pull-to-refresh interactions.
Recommended version:
~58.1.0
For a cross-platform list with pull-to-refresh, see List — built on top of PullToRefreshBox on Android.
Expo UI PullToRefreshBox matches the official Jetpack Compose PullToRefreshBox API. It wraps scrollable content and shows a refresh indicator when pulled.
Installation
- npx expo install @expo/ui
- yarn expo install @expo/ui
- pnpm expo install @expo/ui
- bun expo install @expo/ui
If you are installing this in an existing React Native app , make sure to install expo in your project.
Usage
Basic pull to refresh
Wrap scrollable content in a PullToRefreshBox to add pull-to-refresh behavior.
import { useState, useCallback } from 'react' ;
import {
Host ,
PullToRefreshBox ,
LazyColumn ,
ListItem ,
Text ,
} from '@expo/ui/jetpack-compose' ;
export default function BasicPullToRefresh ( ) {
const [ refreshing, setRefreshing] = useState ( false ) ;
const onRefresh = useCallback ( ( ) => {
setRefreshing ( true ) ;
setTimeout ( ( ) => {
setRefreshing ( false ) ;
} , 2000 ) ;
} , [ ] ) ;
return (
< Host style = { { height: 400 } } >
< PullToRefreshBox
isRefreshing = { refreshing}
onRefresh = { onRefresh} >
< LazyColumn >
< ListItem >
< ListItem.HeadlineContent >
< Text > Item 1 </ Text >
</ ListItem.HeadlineContent >
</ ListItem >
< ListItem >
< ListItem.HeadlineContent >
< Text > Item 2 </ Text >
</ ListItem.HeadlineContent >
</ ListItem >
< ListItem >
< ListItem.HeadlineContent >
< Text > Item 3 </ Text >
</ ListItem.HeadlineContent >
</ ListItem >
< ListItem >
< ListItem.HeadlineContent >
< Text > Item 4 </ Text >
</ ListItem.HeadlineContent >
</ ListItem >
< ListItem >
< ListItem.HeadlineContent >
< Text > Item 5 </ Text >
</ ListItem.HeadlineContent >
</ ListItem >
</ LazyColumn >
</ PullToRefreshBox >
</ Host >
) ;
}
Custom indicator colors
Use the indicator prop to customize the spinner and container colors.
CustomIndicatorColors.tsx import { useState, useCallback } from 'react' ;
import {
Host ,
PullToRefreshBox ,
LazyColumn ,
ListItem ,
Text ,
} from '@expo/ui/jetpack-compose' ;
export default function CustomIndicatorColors ( ) {
const [ refreshing, setRefreshing] = useState ( false ) ;
const onRefresh = useCallback ( ( ) => {
setRefreshing ( true ) ;
setTimeout ( ( ) => {
setRefreshing ( false ) ;
} , 2000 ) ;
} , [ ] ) ;
return (
< Host style = { { height: 400 } } >
< PullToRefreshBox
isRefreshing = { refreshing}
onRefresh = { onRefresh}
indicator = { { color: '#6200EE' , containerColor: '#F5F5F5' } } >
< LazyColumn >
< ListItem >
< ListItem.HeadlineContent >
< Text > Item 1 </ Text >
</ ListItem.HeadlineContent >
</ ListItem >
< ListItem >
< ListItem.HeadlineContent >
< Text > Item 2 </ Text >
</ ListItem.HeadlineContent >
</ ListItem >
< ListItem >
< ListItem.HeadlineContent >
< Text > Item 3 </ Text >
</ ListItem.HeadlineContent >
</ ListItem >
</ LazyColumn >
</ PullToRefreshBox >
</ Host >
) ;
}
API
import { PullToRefreshBox } from '@expo/ui/jetpack-compose' ;
Component Type: React.Element < PullToRefreshBoxProps >
A pull-to-refresh container that wraps scrollable content and shows a refresh indicator when pulled,
matching Compose's PullToRefreshBox.
Optional • Type: ContentAlignment • Default: 'topStart'
Alignment of children within the box.
Optional • Type: PullToRefreshIndicatorProps
Configuration for the loading indicator shown during pull-to-refresh.
Optional • Type: boolean • Default: false
Whether the content is refreshing.
Optional • Type: ModifierConfig[]
Modifiers for the component.
Optional • Type: ( ) => void
Callback that is called when the user pulls to refresh.