Skip to content

Swipe Actions

Pro

A list row that people swipe sideways to show actions under it, as in a mail app. A full swipe runs the main action, and every action is also a button.

  • Base UI
  • Motion
  • React 19
  • Tailwind CSS 4

Added Nov 11, 2026 · Pro license

Playground

Loading the preview

Props

Needs your Pro API key in GELATIN_UI_PRO_TOKEN. Set it up

Pro itemAPI key required

Swipe Actions needs a Pro API key

Try the live preview for free. With Pro, the add command above puts the source in your project.

Files it adds
28
More Pro items, one API key
+327
Your coding agent runs it
1 cmd

$79$129once, for life

Already have Pro? Sign in to set up your API key.

Put the row in SwipeActionsContent, and the actions in a tray per side.

mail-row.tsx

SwipeActions

<div>
PropTypeDefaultDescription
opennull"leading""trailing"—The open tray (controlled). null is closed.
defaultOpennull"leading""trailing"—The tray that is open at first (uncontrolled).
onOpenChange—
disabledboolean—No swipe and no trackpad swipe; the actions leave the Tab order.
fullSwipeboolean—A swipe past the commit point runs the primary action of that side. Default true.
onDismiss—Called after a dismiss action slid the row out and closed its height: remove the item.
driverRef—Drives a swipe from code (DragDriver, no item): a staged scene or a test grabs the row, carries it, and lets go, and the row's own release rules open a tray, commit, or close.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

SwipeActionsContent

<div>
PropTypeDefaultDescription
refRef<HTMLDivElement>—
childrenReactNode—
...props<div> attributes—Every other attribute goes to the <div>.

SwipeActionsTray

<div>
PropTypeDefaultDescription
refRef<HTMLDivElement>—
sideRequired"leading""trailing"—The side of the row: leading (start) or trailing (end). It follows the text direction.
childrenReactNode—
...props<div> attributes—Every other attribute goes to the <div>.

SwipeAction

<div>
PropTypeDefaultDescription
refRef<HTMLButtonElement>—
tone"destructive""info""neutral""primary""success""warning"—
primarybooleanfalseThe action that a full swipe runs on its side (the edge one in a mail app).
dismissbooleanfalseAfter onClick, slide the row out and call the root's onDismiss (a delete, an archive).
childrenReactNode—
...props<div> attributes—Every other attribute goes to the <div>.

SwipeActionsGroup

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • Use it for the actions people repeat many times a day on rows of a list.
  • Use primary on the action that a full swipe runs, and dismiss on an action that removes the row.
  • Use SwipeActionsGroup so that one row is open at a time.
  • For one action that needs a firm yes, such as a payment, use a Swipe to Confirm.
  • For a mouse-first table with many actions, put them in a Context Menu.
  • To swipe whole cards away one at a time, use a Swipe Deck.
TabMoves to the actions of a row. Focus on an action opens its tray.
EnterorSpaceRuns the focused action.
EscCloses the open tray and puts the focus back on the row.

Each action is a real button with its label, so the keyboard and screen readers reach it with no swipe.

A touch that starts 20px or less from the start edge of the screen is left to the browser, so the iOS swipe back still works.

A disabled row takes its actions out of the Tab order.

Release
sheet · 300ms · ease-panel (0.2, 0.4, 0.2, 1) · the row settles at the nearest stop, with the speed of the fling
Commit
indicator · 200ms · ease-panel · the primary action grows over its tray past the commit point
Dismiss
panel · 260ms · ease-panel · the row slides out, then its height closes
  1. AddedSwipe Actions.
Open the release