Warp Mobile demo — a Filament panel that feels like a phone app. Try it in the phone on the right; the data is reset every hour. warpui.com About Warp Mobile Docs Ask a question Support
Skip to content

Swipe actions

Swipe a card sideways to show buttons behind it, like in a mail app. The buttons are the table’s own row actions, chosen by name: their labels, colours, confirmations and permissions stay the same.

1Swipe part of the way

The buttons stay open until you tap one or tap somewhere else.

Try it

  1. In “Deliveries”, press the mouse button on the card of Olivia Bennett, drag about a third of the way to the left and let go.
  2. “Not home” and “Edit” are now open on the right of the card (“Edit”, at the edge, is the first one).
  3. Tap the title “Today’s deliveries” to close them.

What happens

The card slides back. Swiping another card also closes the open one.

The code
$table
    ->recordActions([
        ActionGroup::make([
            Action::make('delivered')->requiresConfirmation()->...,
            Action::make('notHome')->requiresConfirmation()->...,
            EditAction::make(),
        ]),
    ])
    // The names of the row actions, for each side
    ->swipeActions(leading: 'delivered', trailing: ['edit', 'notHome'])

2Swipe all the way

Swiping past the middle runs the first button of that side.

Try it

  1. Press the mouse button on the card of Noah Fischer and drag all the way to the left edge of the phone, then let go.

What happens

The first button on that side (“Edit”, at the edge) runs: the delivery of Noah Fischer opens. fullSwipe: false turns this off.

The code
// On by default. To turn it off:
->swipeActions(leading: 'delivered', trailing: ['edit', 'notHome'], fullSwipe: false)

3A button that asks first

A button with requiresConfirmation() asks before it runs, as in the ⋮ menu.

Try it

  1. Drag the card of Marcus Reed a little to the right and let go.
  2. Tap the green “Mark as delivered” button that appeared on the left.
  3. Tap “Confirm” in the sheet that opens from the bottom.

What happens

The status of Marcus Reed changes to “Delivered”.

The code
Action::make('delivered')
    ->requiresConfirmation()
    ->action(fn (Delivery $record) => $record->update(['status' => 'delivered']))

4Buttons that are not shown for a row

A button that is hidden for a row (visible(), hidden(), a policy) cannot be reached by swiping either.

Try it

  1. Drag the card of Hannah Kim (already delivered) to the right.
  2. Drag it to the left.
  3. Drag the card of Emily Carter (cancelled) to the left and to the right.

What happens

Hannah Kim does not move to the right, because “Mark as delivered” is hidden for a delivered parcel. To the left she has “Edit” only. Emily Carter has no buttons at all, so her card does not move.

The code
Action::make('delivered')
    ->visible(fn (Delivery $record): bool => in_array($record->status, ['scheduled', 'out', 'not_home'])),
EditAction::make()
    ->hidden(fn (Delivery $record): bool => $record->status === 'cancelled'),

Click to tap. To swipe or pull, press the mouse button and drag — the mouse works like a finger here.

You are on a phone

The phone frame is for computers. On your phone, open the app itself and follow the steps with your finger.

Open the app