Overlays
Modals ask, toasts tell, menus offer. Everything that floats above the page uses one of these three, with a veil or a soft shadow and never a browser dialog.
Modal
A white card on an ink veil for anything that needs a decision before the page can continue: confirmations, short forms and option lists. Every modal is a .modal-overlay with an id, opened by any element with data-modal-open="that-id". Don't use one for long forms or content people want to keep open; give that its own page.
| Part | Use for |
|---|---|
.modal-overlay | The fixed veil (--ink-veil). Needs an id and aria-hidden="true"; modal.js toggles .open. |
.modal | The 440px card with role="dialog", aria-modal="true" and aria-labelledby pointing at its heading. Add .modal-wide for rich content such as session details. |
.modal-head | An <h3> title plus the round .modal-close button (aria-label="Close", data-modal-close). |
.modal-body | Content. Start with a muted .modal-sub line that explains the consequence. Add .fstack when the body is a form. |
.modal-actions | Right-aligned button row: secondary dismiss first, then the one primary action. |
- Open with
data-modal-openorwindow.gaicModal.open(id); never write your own show/hide code. - Trust
modal.jsfor accessibility: focus moves into the modal (to[autofocus]or the close button), Tab is trapped, the rest of the page isinert, Esc and a backdrop click close it, and focus returns to the opener. - Keep one primary button per modal.
- Use
window.confirm()oralert(). Every confirmation is a modal. - Stack a modal on top of another modal.
- Put the overlay inside an element with a
transform; it breaks the fixed veil.
Confirm modal
Use before anything destructive or hard to undo: cancelling or deleting an event, disabling a member, sending emails. The title and the primary button both name the action ("Cancel event"), and the sentence underneath says exactly what happens.
- Name the consequence in plain words: "It will become read-only", "This cannot be undone".
- Label the primary button with the action itself, never "OK", "Yes" or "Confirm" on its own.
- When the action is a cancel, label the dismiss button "Back" so there are not two "Cancel" buttons.
- Put the real
<form method="post">(with its anti-forgery token) inside the modal so the submit button posts it.
- Ask "Are you sure?" without saying what happens.
- Confirm routine, easy to undo actions (saving a draft, filtering); just do them and show a toast.
- Make the destructive button the only way out; Back, the close button and Esc must always work.
Confirm before submitting
For a simple "are you sure?" you don't build a modal. Put data-confirm="Question?" on the form (or on one submit button) and js/framework/confirm.js asks in this dialog before the form submits. Destructive wording (delete, remove, cancel, revoke, disable, withdraw, leave) gets the red .btn-danger; set data-confirm-variant to override. The confirm button repeats the submit button's label.
| Attribute | Effect |
|---|---|
data-confirm | The question. On the form, or on a submit button to confirm only that button. |
data-confirm-title | Dialog title; defaults to "Please confirm". |
data-confirm-label | Confirm button label; defaults to the submit button's text. |
data-confirm-variant | danger or primary; otherwise picked from the wording. |
data-confirm-second | A second question for actions that need two steps. |
From script: window.gaicConfirm({ title, message, confirmLabel, danger }).then(function (ok) { ... }).
- Say what happens and whether it can be undone.
- Name the action on the submit button ("Delete event"), so the dialog's button names it too.
- Call
window.confirm(); a test fails on it. - Add a page script for confirmations; the framework already handles
data-confirm.
Form modal
For one or two optional inputs attached to an action, like a personal note on a batch of emails or a schedule time. If the form needs more than a few fields, validation across steps or a file preview, build a page instead.
- Give every input a visible
<label>and use.field-hintfor help text. - Add
autofocusto the first input when typing is the whole point of the modal. - Show server errors in a
.reg-errorsblock withrole="alert"inside the modal, above the actions.
- Close the modal on submit before the request succeeds; a toast confirms success after the redirect.
- Use a placeholder as the only label.
Share & option modal
A list of .modal-option rows, each a link with an icon and an arrow. Use it for share targets and calendar providers. The click-out warning for partner events uses the same card with a highlighted destination host.
- Write each option as a verb plus the destination: "Share on LinkedIn", "Add to Google Calendar".
- Open external targets with
target="_blank" rel="noopener". - Give an icon-only trigger an
aria-label.
- Use brand colours on the option icons; they stay ink and the row warms to cream on hover.
- Link to a partner event directly; mark it with
data-external-eventso the click-out warning appears.
Toast
A short message at the top of the page after something happened: saved, sent, failed. Set TempData["ToastSuccess"] or TempData["ToastError"] before a redirect and the layout renders it; from script, call window.gaicToast(message, "success" | "error").
| Variant | Behaviour |
|---|---|
.toast--success | Green edge and tick. Dismisses itself after 30 seconds or on close. |
.toast--error | Red (--danger) edge and "!". Stays until the person closes it. Scripted errors get role="alert". |
- Say what happened in one sentence, and for errors what to do next.
- Use a toast to confirm a modal action after the redirect.
- Keep the
.toast-stackaria-liveso screen readers announce it.
- Put form validation in a toast only; errors that belong to a field also show next to the form.
- Add buttons or links to a toast; if the person must act, use a callout or a modal.
Map tooltip
The ink card that appears over a world map pin on hover or keyboard focus, showing the event or chapter name and date. world-map.js creates one shared .wm-tip per map; you never write it by hand. Try it on the world map.
- Keep the SVG
<title>on each pin too, so the name is available without hover.
- Use tooltips for anything else; the site has no generic tooltip. Explain disabled buttons with a visible hint or a
title.