The row follows horizontal drags, resists past its actions and settles with your release speed.
With dismiss, a long swipe or a throw slides the row out, collapses its height and then calls onDismiss(side).
Vertical scrolling keeps working, and only one row stays open.
A tap on an open row closes it, and keyboard focus on an action reveals it.
Use it for
Archive or delete in an inbox.
Pin a conversation.
Remove an item from a list.
Props
Prop
Type
Default
Description
children
ReactNode
The row content.
startActions
ReactNode
Revealed at the inline start when the row is dragged toward the end.
endActions
ReactNode
Revealed at the inline end when the row is dragged toward the start.
dismiss
'start' | 'end' | 'both'
Sides where a long swipe or a throw removes the row.
onDismiss
(side) => void
Runs after the row slid out and collapsed; remove the item from your data here.
onOpenChange
(side | null) => void
Runs with the open side, or null when the row closes.
disabled
boolean
false
Turns swiping off.
contentClassName
string
Class for the row content; contentStyle sets its inline style.
transition
Transition
spring
A timing curve { duration, easing } or a spring { tempo: 'spring', spring }. Springs keep their momentum when interrupted.
Other props go to the rendered element, so className, style and event handlers work as usual.
Web and React Native
startActions appear when dragging toward the inline end, endActions when dragging toward the start. Give the row content a background with contentClassName.