Swipe Action Row
Use Swipe Action Row to reveal contextual actions on either side of a list item. It coordinates sibling rows, supports pointer, touch, and keyboard input, and lets a safe action take over after a decisive full swipe.
Preview
Installation
Basic usage
Examples
Swipe right to reveal the left actions or left to reveal the right actions. A focused row also responds to the left and right arrow keys. Put fullSwipe on one safe action per side when a decisive gesture should run it immediately.
Usage
API
| Property | Type | Default | Description |
|---|---|---|---|
threshold | number | 0.5 | Fraction of the action strip crossed before the row opens. |
velocityFactor | number | 0.2 | Seconds of release velocity projected onto the resting position. |
fullSwipeThreshold | number | 0.5 | Fraction of row width crossed before a full-swipe action arms. |
disabled | boolean | false | Prevents pointer and keyboard gesture interaction. |
closeOnScroll | boolean | false | Closes an open row when the page scrolls. |
onOpenChange | (state: SwipeActionRowState) => void | undefined | Called when the row becomes closed, left-open, or right-open. |
Accessibility
Closed action strips are inert, so their controls stay outside the tab order and accessibility tree. Focus the row content and use the left or right arrow key to expose a strip, then tab to its actions. Escape and outside click close the row. Give icon-only actions an accessible name, keep destructive actions explicit, and provide undo when removal is reversible. Reduced-motion preferences replace settling motion with immediate state changes.
Behavior
SwipeActionRow.Root coordinates sibling items so only one stays open. Each Item owns its gesture and accepts open, velocity, full-swipe, disabled, and scroll-dismissal controls. Place one Actions strip on either or both physical sides, then assign fullSwipe to the action that should take over that side. Your application continues to own action effects and list data.
The foreground tracks the pointer continuously. On release, velocity is projected into the resting decision, and the row either closes, reveals the measured strip, or arms the selected full-swipe action. Keyboard opening is immediate and does not add decorative motion.
Contact
Found a bug or need help using this component? Open an issue on GitHub.
License & Usage
Sona UI is available under the MIT license. You may use, modify, and distribute this component in personal and commercial projects.
Was this component useful?
Your feedback helps us improve the documentation.