iOS — Liquid Glass JS behaviour

Alert & action sheet

iOS’s two system dialogs: the frosted alert with divided buttons separated by hairlines — and the action sheet rising from the bottom with a vertical list and a separated red destructive action.

Documentation

Real scenarios

The component as it is used in a product — not a specimen grid.

Two dialogs, two weights of intent

The trash on a note opens the 270px frosted alert — buttons split by hairlines, the destructive action in system red — while the ••• button raises the action sheet from the bottom edge with a separated red row. Both really delete (with an undo), and scrim tap or Escape closes either; focus lands on the first button and returns when dismissed.

Notes

۳ یادداشت
Note deleted.

Delete note?

This note will be moved out of your list. You can undo it right after.

…

Important props

Important props
Prop Type Default What it does
alert width '270px' The official alert width; buttons split evenly, or stack for long text.
material blur '40px' The system blur over the backdrop — light and dark for free.
destructive color '#FF3B30' The system red for destructive actions; #FF453A in dark.

Snippet

<dialog class="ioalert">
    <div class="ioalert-body"><h2>حذف یادداشت؟</h2><p>این کار برگشتی ندارد.</p></div>
    <div class="ioalert-actions">
        <button>لغو</button><button data-destructive>حذف</button>
    </div>
</dialog>

<style>
.ioalert { inline-size: 270px; border: none; border-radius: 14px; overflow: clip;
           padding: 0; background: #f2f2f2e6; backdrop-filter: blur(40px) saturate(1.6); }
.ioalert-actions { display: flex; border-block-start: .5px solid #3c3c432e; }
.ioalert-actions button { flex: 1; block-size: 44px; color: #007AFF; }
.ioalert-actions button + button { border-inline-start: .5px solid #3c3c432e; }
[data-destructive] { color: #FF3B30; }
</style>