Skip to content

Modal ​

ue-modal is the primary dialog component. It wraps Vuetify's v-dialog and provides a standardised card layout with a title, description body, and confirm/cancel action buttons — all customisable through props and slots.

Usage ​

html
<!-- v-model controlled -->
<ue-modal v-model="showDialog" title="Delete Record" description="Are you sure?">
</ue-modal>

<!-- ref controlled (imperative API) -->
<ue-modal ref="confirmModal" title="Confirm">
</ue-modal>
<!-- open programmatically -->
<script>
  this.$refs.confirmModal.open()
</script>

Common Props ​

PropTypeDefaultDescription
modelValueBooleanfalseControls dialog open state with v-model
titleString—Dialog title
descriptionString—Body text (supports HTML via v-html)
widthTypeString'sm'Preset width: 'xs', 'sm', 'md', 'lg', 'xl', 'full'
persistentBooleanfalsePrevent closing by clicking outside
confirmTextStringi18n fields.confirmLabel for the confirm button
cancelTextStringi18n fields.cancelLabel for the cancel button
noCancelButtonBooleanfalseHide the cancel button
noConfirmButtonBooleanfalseHide the confirm button
noActionsBooleanfalseRemove the entire actions row
hasCloseButtonBooleanfalseShow an × icon in the title bar
hasFullscreenButtonBooleanfalseShow a fullscreen toggle in the title bar
hasTitleDividerBooleanfalseAdd a divider below the title
confirmCallbackFunction—Async function called on confirm — return false to keep modal open
rejectCallbackFunction—Async function called on cancel
titleJustifyString'start'Title alignment (start, center, end)

Slots ​

SlotScopeDescription
default{close, confirm, open, toggleFullscreen, isFullActive}Full custom content — replaces the default card entirely
bodysame scopeReplaces the default card body while keeping the dialog wrapper
body.description{description}Replaces the description text area
body.options{description}Replaces the action buttons row
systembar—Injected above the card when hasSystembar is active

Events ​

EventDescription
update:modelValueEmitted on open/close
openedEmitted when the dialog becomes visible
confirmEmitted after confirm resolves
cancelEmitted after cancel resolves

Imperative API ​

When used with a template ref, the modal exposes these methods:

js
this.$refs.myModal.open()       // open the dialog
this.$refs.myModal.close()      // close the dialog
this.$refs.myModal.toggle()     // toggle open state
this.$refs.myModal.confirm()    // trigger confirm flow programmatically

Example — Confirm Delete ​

html
<ue-modal
  ref="deleteModal"
  title="Delete Item"
  description="This action cannot be undone."
  width-type="sm"
  has-close-button
  :confirm-callback="handleDelete"
>
</ue-modal>

<v-btn color="error" @click="$refs.deleteModal.open()">Delete</v-btn>