SwipeItem

List row whose leading/trailing actions are revealed by a horizontal swipe, with keyboard parity

Category: display · WCAG 2.2-AA · display, swipe, list, mobile, gesture, actions

States

Props

PropTypeDefaultDescription
childrenReact.ReactNodeThe row content
leadingActionsSwipeAction[][]Actions revealed by dragging toward the end edge (shown on the start edge)
trailingActionsSwipeAction[][]Actions revealed by dragging toward the start edge (shown on the end edge)
classNamestringAdditional CSS class names merged onto the root element.

Design tokens

When to use

When not to use

How to build an accessible SwipeItem in React →

Examples

Trailing actions

<SwipeItem
  trailingActions={[
    { label: 'Archive', onSelect: archive },
    { label: 'Delete', onSelect: remove, destructive: true },
  ]}
>
  <MessageRow message={message} />
</SwipeItem>

Leading and trailing

<SwipeItem
  leadingActions={[{ label: 'Pin', icon: <PinIcon />, onSelect: pin }]}
  trailingActions={[{ label: 'Delete', onSelect: remove, destructive: true }]}
>
  <TaskRow task={task} />
</SwipeItem>

Related components

← Back to docs