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
| Name | Type | Default | Description |
|---|---|---|---|
v-model:open | boolean | false | Shows dlg and dlgscrim (teleported to body). Escape, the × and the scrim close it; focus is trapped and returns to the opener; body scroll locks. |
title | string | — | dlg__t; labels the dialog (#title slot). |
subtitle | string | — | dlg__s: what it is for — or, when destructive, what is lost and that it cannot be undone. |
confirmLabel | string | — | The commit button, last in the footer. Name the consequence, never “OK”. Omit for no default footer. |
cancelLabel | string | "Cancel" | Tertiary button before the commit. |
danger | boolean | false | Commit becomes btn--danger, the only filled button. |
wide | boolean | false | dlg--wide (720px) for a two-column form. |
note | string | — | Left footer note (dlg__n). Without it the footer is dlg__f--end. |
confirmDisabled | boolean | false | Disable the commit until the dialog is complete. |
confirmLoading | boolean | false | The 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. |
dismissible | boolean | true | Close on a scrim click. |
closable | boolean | true | Offer the × and close on Escape and the scrim. False for a dialog that must be answered: only the footer's buttons close it. |
alert | boolean | false | An 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 / #footer | slot | — | Body (dlg__body) and a replacement footer ({ close, cancel }). |
@confirm / @cancel / @close | () => void | — | Commit clicked; Cancel clicked; closed by any route. |