SwiftUI.js
Components

SwipeActions

SwipeActions adapts SwiftUI's swipe-revealed row actions into an explicit, accessible web row wrapper. On the web, actions are revealed with a toggle instead of relying on touch-only gestures.

SwipeActions adapts SwiftUI's swipe-revealed row actions into an explicit, accessible web row wrapper. On the web, actions are revealed with a toggle instead of relying on touch-only gestures.

Examples

Default

Preview unavailable for this example in the static docs build.

Show code
<SwipeActions
      actions={[
        { label: 'Flag' },
        { label: 'Archive' },
      ]}
    >
      <div style={{ padding: 16, border: '1px solid var(--sw-color-gray-4, #d1d5db)', borderRadius: 14 }}>
        Project update
      </div>
    </SwipeActions>

Variants

Preview unavailable for this example in the static docs build.

Show code
<SwipeActions
      actions={[
        { label: 'Pin' },
        { label: 'Mark unread' },
      ]}
      edge="leading"
      defaultOpen
    >
      <div style={{ padding: 16, border: '1px solid var(--sw-color-gray-4, #d1d5db)', borderRadius: 14 }}>
        Conversation row
      </div>
    </SwipeActions>

Variants

Preview unavailable for this example in the static docs build.

Show code
<SwipeActions
      actions={[
        { label: 'Delete', tint: 'destructive' },
      ]}
      defaultOpen
    >
      <div style={{ padding: 16, border: '1px solid var(--sw-color-gray-4, #d1d5db)', borderRadius: 14 }}>
        Draft message
      </div>
    </SwipeActions>

API

PropTypeRequiredDescription
actionsISwipeActionItem[]YesNo description yet.
edge'leading' | 'trailing'NoNo description yet.
openbooleanNoNo description yet.
defaultOpenbooleanNoNo description yet.
onOpenChange(open: boolean) => voidNoNo description yet.

Inherits additional props from IBaseComponent.

Overview

SwipeActions adapts SwiftUI's swipe-revealed row actions into an explicit, accessible web row wrapper. On the web, actions are revealed with a toggle instead of relying on touch-only gestures.

Notes

  • Use edge="leading" to place actions before the row content.
  • Use controlled open state when a surrounding list needs to coordinate which row is expanded.
  • Expanded actions close on Escape or when focus/pointer interaction moves outside the row, matching the temporary nature of swipe-revealed actions.

On this page