StealThis .dev

Action Sheet

An iOS-style action sheet that slides up from the bottom with a list of actions and a separate cancel button. No libraries.

Open in Lab
vanilla-js css
Targets: JS HTML

Code

Action Sheet

An iOS-style action sheet that slides up from the bottom of the screen. Features a title, a scrollable list of contextual actions, and a separate Cancel button that is always visible.

How it works

  1. Trigger button opens the sheet by adding .open to both the backdrop and the sheet
  2. The sheet uses translateY(100%)translateY(0) for the slide-up animation
  3. The Cancel button is rendered as a separate card below the actions, matching native iOS style
  4. Tapping the backdrop or Cancel closes the sheet

Variants in the demo

  • Share — share, copy link, save image, embed
  • Delete — destructive confirmation pattern with a red action

When to use it

  • Contextual actions on a selected item
  • Share sheets and save dialogs
  • Confirmation for destructive actions (delete, leave, cancel subscription)