Skip to main content

Migrate from react-native-swipe-list-view

- import { SwipeListView } from 'react-native-swipe-list-view';
+ import { List, ListItem, SwipeableRow } from 'patine-ui';

- <SwipeListView
- data={mail}
- renderItem={({ item }) => <MailRow mail={item} />}
- renderHiddenItem={({ item }) => <HiddenDeleteButton onPress={() => remove(item.id)} />}
- rightOpenValue={-75}
- closeOnRowOpen
- />
+ <List>
+ {mail.map((item) => (
+ <SwipeableRow key={item.id} fullSwipe trailingActions={[{ label: 'Delete', variant: 'destructive', onPress: () => remove(item.id) }]}>
+ <ListItem title={item.subject} />
+ </SwipeableRow>
+ ))}
+ </List>
react-native-swipe-list-viewPatine UI
renderHiddenItemleadingActions / trailingActions: { label, icon?, variant?, color?, onPress }[]
rightOpenValue / leftOpenValuethe actions' width (74–88pt each, by design)
closeOnRowOpenalways: opening a row closes the others
closeOnRowPressalways: tapping an open row closes it
rightActivationValue + onRightActionfullSwipe: a long swipe runs the edge action
disableRightSwipe / disableLeftSwipeleave that side's actions out
onRowOpen / onRowCloseonOpenChange(side | null)
SwipeRowSwipeableRow

Wrap rows in any list you use, a FlatList included. Screen readers reach the actions without swiping, and on the web the arrow keys open a focused row.

See all migration guides for other libraries, and Comparison for when another library is the better choice.