Feature Library

Swipe a row for actions

<0.01 CPU ms
A still of the Swipe a row for actions demo
Still
The live demo starts when it’s in view.Swipe or drag a message left or right · swipe far to delete · focus one and press ← or Menu · Delete, E and P work too

Swipe a list row, as on a phone: a short swipe shows its buttons, a long one runs the outer action (delete), a quick flick opens and a flick back closes.

What it costs a frame

<0.01 ms
GPU
not used
CPU, median
<0.01 ms
CPU, 95th pct
0.20 ms
Draw calls
0
Weight
Light

Measured 11 November 2026 on 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 157, 1920×1080 at 1×. 600 frames × 3 rounds, median kept. What ran: Measured with the demo swiping by itself: synthetic pointer events open a row (24 frames), it rests, closes, then a long swipe deletes the next row (30 frames), it slides out and closes up, the undo toast shows and Undo puts it back. Each moving frame writes three custom properties on one row and its spring; nothing runs between gestures. Phones: tiers are being measured next.

On every machine it was measured on
MachineGPU msCPU msCPU p95
unknown GPU · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring toolnot timed<0.010.20
apple · Apple A19 Proin a browser tab · 16 November 2026not timed<0.010.10
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 2026not timed<0.010.15

Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.

What it needs

Renders with
DOM and CSSPlain DOM and CSS: every current browser.
Your browser
Runs hereNo WebGPU needed
Depends on
NothingNo other packages

What it’s for

  1. Delete, archive and pin in an inbox or a to-do list
  2. Mail, chat and notification lists on phones
  3. Shopping and packing lists
  4. Settings rows with a remove button
  5. Any list where an undo beats a confirm dialog

Pitfalls, in brief

  1. Import swipe-actions.base.css, then swipe-actions.css (or your own look).
  2. The row clips (overflow: clip), so a focus ring drawn outside the content is cut off: draw it inside (a negative outline-offset).
  3. The content slides with the translate property.
  4. A removing action calls onAction only after the row has slid out and closed up (about 0.4 s; at once under reduced motion).
  5. Presses on a row never select its text or drag its links and images (selectstart and dragstart are cancelled while a press is followed).
4 more in brief
  1. Keys are read on the row, so a row whose content takes the arrow keys itself (a slider) should turn arrows off, or the arrows open the actions too.
  2. Any scroll on the page closes the open row, as phones do.
  3. If a framework re-renders a row, the module notices (a MutationObserver on the list’s children) and wires the new one; call refresh() after changing a row’s text in place so its More button is named again.
  4. Screen-reader gestures replace swiping, so the More button and the keys are the way in for those users: keep more on, or offer the same actions in the row’s own detail view.
9 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

From My other apps. Fully custom code.

Swipe actions on iOS list rows (Apple Human Interface Guidelines): The behaviour it imitates: buttons revealed behind a row, a full swipe running the outer one. No code from it.

WAI-ARIA Authoring Practices Guide (W3C): The More button as a disclosure (aria-expanded, aria-controls) and a named group of buttons.

swipegesturelistrow actionsdeletearchiveundotoasttouchmousekeyboardspringlive regionaccessibilityrtlreduced motiondomcssno dependencies

Near it in the frame