Skip to content

Swipe actions

Reveal row actions with a swipe, or from the same actions in a menu.

SwipeGestureList
npx shadcn@latest add @silicon-ui/swipe-actions

Installation

With the shadcn CLI

npx shadcn@latest add @silicon-ui/swipe-actions

Manually

  1. Install the dependencies

    npm install @radix-ui/react-dropdown-menu lucide-react motion
  2. Copy these files into your project

    • components/silicon-ui/swipe-actions/swipe-actions.tsx
    • components/silicon-ui/swipe-actions/swipe-actions.module.css
  3. Add the foundation, once per app, for the design and motion tokens

    npx shadcn@latest add @silicon-ui/silicon-foundation

Usage

usage.tsx
import { SwipeActions } from "@/components/silicon-ui/swipe-actions/swipe-actions";

API reference

SwipeActions

PropTypeDefault
label*string—
children*ReactNode—
classNamestring—

SwipeActionsRow

PropTypeDefault
label*

Names the row in its menu button, for example the message subject.

string—
children*ReactNode—
leadingSwipeAction[][]
trailingSwipeAction[][]
fullSwipe

Lets a long swipe commit the outermost action without a tap. On by default.

booleantrue
classNamestring—

Dependencies

npm
@radix-ui/react-dropdown-menulucide-reactmotion
Registry
silicon-motion-tokens