Swipe actions
List rows that swipe either way to reveal their actions; a long swipe runs the edge action, and the row's own button opens the same actions from the keyboard.
Launch briefFinal copy for the announcement9:41
Client feedbackThree comments need a reply11:08
Design reviewCheck spacing before handoff13:20
Flagged runOne job failed in the retry queueNow
When to use
- List rows on touch screens where Archive and Delete should stay out of the way until needed.
- Inbox, task and project lists with a small set of row-level actions.
When not to use
- The row needs more than three actions; open a menu instead.
- The action is irreversible and unconfirmed; pair it with an undo.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/swipe-actions
Adds its 3 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
SwipeActions
6 props
PropTypeDefaultDescription
label *string—Names the row for its actions button: "Actions for Atlas platform".
children *ReactNode—
actionsreadonly SwipeAction[][]Revealed by swiping left (the trailing edge). The first sits nearest the row; the last, at the edge, runs on a long swipe.
leadingreadonly SwipeAction[][]Revealed by swiping right (the leading edge), in the same order.
fullSwipebooleantrueLet a long swipe run the outermost action.
classNamestring—
Keyboard
- Escape
- Closes or cancels, then returns focus to where it came from.
Accessibility
It is built on native elements and keeps aria-hidden, aria-expanded, aria-label and aria-keyshortcuts in step with state.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/swipe-actions.mdThe index of every part is at /llms.txt.