Koala logo Design
Esc
No matches for “
↑↓ navigate open Esc close
Components Modals

Modals

Centered confirmation dialog with icon-circle, body, and Cancel / Confirm buttons. Backdrop dismisses; ESC closes; the form posts to a handler and swaps the page underneath via Alpine-AJAX.

<koala-confirm-modal>

Canonical

Click the trigger to open the real <koala-confirm-modal>. ESC closes; backdrop dismisses; the form would post to a handler in a real page.

Variants

2 variants
Danger
variant="Danger"
Primary
variant="Primary"

States

3 states
Closed
Click to open the dialog
ESC
ESC dismiss
ESC closes via x-on:keydown.escape.window
Backdrop dismiss
Click outside the dialog to close

Props

11 attributes
Attribute Values Notes
flag string Alpine variable controlling open/closed. Defaults to confirmOpen. The parent x-data must declare it.
variant Danger, Primary Icon-circle colour, confirm-button colour, and default icon.
title string Bold heading above the body content.
icon IconName Override the variant's default icon.
form-handler string Razor page handler name. Posts to ?handler={name}.
form-action URL Override the action URL entirely.
form-route-id Guid Appended as ?id= to the handler URL.
form-route-note-id Guid Appended as ?noteId= when present.
form-target string Alpine-AJAX target element id. Defaults to main.
form-target-push bool Defaults to true. Pushes a new history entry on swap.
confirm-text / cancel-text string Button labels. Default to Confirm / Cancel.

Do & don't

Do Use verb-led button labels that describe the outcome. “Yes, cancel” and “Keep it” read as decisions, not OK/Cancel boilerplate.
Don't Don't use OK / Cancel. They force the user to re-read the body to learn what each button does.

Generic modal

<koala-modal> with optional <koala-modal-header> / <koala-modal-content> / <koala-modal-footer> children. Owns the scrim, scroll-lock, focus-trap, ESC-to-close, and click-outside-to-close. Use this for richer interactions where the confirm modal isn't expressive enough.

Quick form
title="Edit branch"
Custom header
<koala-modal-header> child

Sizes

size Use for
max-w-md (default)Short forms, 1–3 fields.
max-w-lgStandard edit modals (3–6 fields).
max-w-2xlDetail views, side-by-side fields.
max-w-4xlEmbedded maps / tables.