Feedback & overlays / Dialog

Feedback & overlays

Dialog

The centred modal: a title with one line of what it is for, a scrolling body, and a footer whose last button commits.

import { EcoDialog } from "vue-ecosphere"

Picker

Open it, filter the list, pick one. Tab stays inside; Escape closes.

Destructive

No body: a confirmation only has to say what is lost and name the action.

Loading

confirm-loading while the commit runs: the button shows its spinner and the dialog holds until you close it. For a plain yes-or-no question, useConfirm does this for you.

Must be answered

closable false: no ×, and Escape and the scrim do nothing. Keep it for a step the app cannot continue without, and give the footer the one way on.

Wide, with a list of sub-records

dlg--wide for a two-column form; dlgrow for the sub-records.

API

NameTypeDefaultDescription
v-model:openbooleanfalseShows dlg and dlgscrim (teleported to body). Escape, the × and the scrim close it; focus is trapped and returns to the opener; body scroll locks.
titlestring—dlg__t; labels the dialog (#title slot).
subtitlestring—dlg__s: what it is for — or, when destructive, what is lost and that it cannot be undone.
confirmLabelstring—The commit button, last in the footer. Name the consequence, never “OK”. Omit for no default footer.
cancelLabelstring"Cancel"Tertiary button before the commit.
dangerbooleanfalseCommit becomes btn--danger, the only filled button.
widebooleanfalsedlg--wide (720px) for a two-column form.
notestring—Left footer note (dlg__n). Without it the footer is dlg__f--end.
confirmDisabledbooleanfalseDisable the commit until the dialog is complete.
confirmLoadingbooleanfalseThe commit is running: the commit button shows loading, Cancel and × are disabled, and Escape and the scrim do nothing. Close it yourself on success; clear it on failure.
dismissiblebooleantrueClose on a scrim click.
closablebooleantrueOffer the × and close on Escape and the scrim. False for a dialog that must be answered: only the footer's buttons close it.
alertbooleanfalseAn interruption that asks for a decision, like a confirmation: role="alertdialog". The subtitle describes every dialog (aria-describedby), so it is read with the title.
#default / #footerslot—Body (dlg__body) and a replacement footer ({ close, cancel }).
@confirm / @cancel / @close() => void—Commit clicked; Cancel clicked; closed by any route.