Swipe actions
Reveal row actions with a swipe, or from the same actions in a menu.
npx shadcn@latest add @silicon-ui/swipe-actionsInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/swipe-actionsManually
Install the dependencies
npm install @radix-ui/react-dropdown-menu lucide-react motionCopy these files into your project
- components/silicon-ui/swipe-actions/swipe-actions.tsx
- components/silicon-ui/swipe-actions/swipe-actions.module.css
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
SwipeActions
| Prop | Type | Default |
|---|---|---|
label* | string | — |
children* | ReactNode | — |
className | string | — |
SwipeActionsRow
| Prop | Type | Default |
|---|---|---|
label*Names the row in its menu button, for example the message subject. | string | — |
children* | ReactNode | — |
leading | SwipeAction[] | [] |
trailing | SwipeAction[] | [] |
fullSwipeLets a long swipe commit the outermost action without a tap. On by default. | boolean | true |
className | string | — |