Swipe Actions
betaA list row that drags toward the inline start to reveal action buttons, which stretch with the drag before the row springs open or shut.
- Data
- 1 file
- 1 npm package
- Accessibility notes
Loading the example…
pnpm dlx @dowel-ui/cli add swipe-actionsnpm packages installed: class-variance-authority.
import { SwipeActions } from "@/components/ui/swipe-actions";Default
Demo
List
<SwipeActions>
| Prop | Type | Default |
|---|---|---|
actions (required)The actions revealed at the inline end, in order. | SwipeAction[] | — |
defaultOpenInitial open state when uncontrolled. | boolean | false |
onOpenChange | (open: boolean) => void | — |
openControlled open state. | boolean | — |
size | "sm" | "md" | "lg" | "md" |
Plus every attribute of <div>.
Swiping is a pointer shortcut, never the only route: the actions are native buttons that stay in the tab order, and focusing one opens the row so it is visible; focus leaving the row closes it. Escape closes the row and returns focus to it, and choosing an action closes it too. Icon-only actions are named by their `label`. The root is a group (name it with aria-label). Directions mirror in RTL. The spring runs on the motion scale, so under reduced motion the row snaps open and shut.
10/10
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — passes
- No fixed widths — passes