Skip to content

Dialog

The Dialog component is a flexible and extensible content container. Dialog are built with as little markup and styles as possible, but still manage to deliver a ton of control and customization. They are particularly well-suited to use with the Modal component.

Examples

Base

A simple dialog is created with a title and content property.

Confirm Check

The component can be used to require decisions or show critical information. Using the confirmButton and cancelButton properties confirm checks can be made.

Slots

The component provides header, title, subtitle, content, footer as well as confirmButton and cancelButton named slots templates to customise HTML content.

Image

You can place an image below the header.

Form

A useful purpose for a dialog is to display forms in it.

Dialog Component

A flexible and extensible content container.

html
<o-dialog></o-dialog>

Props

Prop nameDescriptionTypeValuesDefault
ariaCloseLabelAccessibility label for the close buttonstring-
From config:
dialog: {
  ariaCloseLabel: "Close"
}
buttonPositionPosition of the footer buttons"centered" | "left" | "right"-
cancelButtonRender a cancel button and set text text as labelstring-
cancelVariantColor variant of the cancel buttonstringprimary, info, success, warning, danger, and any other custom color
closeIconClose icon namestring-
From config:
dialog: {
  closeIcon: "close"
}
closeIconSizeClose icon sizestring-
From config:
dialog: {
  closeIconSize: undefined
}
closeableAdds close button to the headerboolean-
From config:
dialog: {
  closeable: false
}
componentComponent to be injected.
Close the component by emitting a 'close' event — $emit('close')
Component-
confirmButtonRender a confirm button and set text as labelstring-
confirmVariantColor variant of the confirm buttonstringprimary, info, success, warning, danger, and any other custom color
contentDialog body content, unnecessary when content slot is usedstring-
disableCancelDisable the cancel buttonboolean-
disableConfirmDisable the confirm buttonboolean-
eventsEvents to be binded to the injected component{}-
iconPackIcon pack to use for the close iconstringmdi, fa, fas and any other custom icon pack
From config:
dialog: {
  iconPack: undefined
}
imageAltDialog image alt, unnecessary when image slot is usedstring-
imageSrcDialog image src, unnecessary when image slot is usedstring-
loadingShow a loading spinner in the dialogboolean-
loadingLabelShow label beside the loading iconstring-
overrideOverride existing theme classes completelyboolean-
propsProps to be binded to the injected componentany-
subtitleDialog header subtitle, unnecessary when subtitle slot is used
Class of the header subtitle element
(string & ComponentClass)-
titleDialog header title, unnecessary when title slot is usedstring-

Events

Event namePropertiesDescription
closeevent Event - native eventclose button click event
confirmevent Event - native eventconfirm button click event

Slots

NameDescriptionBindings
headerOverride the headerclose (event: Event): void - function to emit a close event
titleOverride the header title, default is title prop
subtitleOverride the header subtitle, default is subtitle prop
closeOverride the close icon
imageOverride the image
defaultOverride the default dialog bodyclose (event: Event): void - function to emit a close event
confirm (event: Event): void - function to emit a confirm event
contentOverride the body content, default is content propclose (event: Event): void - function to emit a close event
confirm (event: Event): void - function to emit a confirm event
footerOverride the footerclose (event: Event): void - function to emit a close event
confirm (event: Event): void - function to emit a confirm event
cancelButton
confirmButton

Class Inspector

Classes applied to the element:
Want to know how does the Class Inspector work?
Class propDescriptionPropsSuffixes
rootClassClass of the root element.
headerClassClass of the header element.
titleClassClass of the header title element.
subtitleClass of the header subtitle element.
closeClassClass of the header close element.
imageClass Class of the image container.
figureClassClass of the image figure element.
bodyClass Class of the body element.
contentClassClass of the body content element.
footerClassClass of the footer element.
footerPositionClassClass of the footer element with position.buttonPositionleft
centered
right
confirmButtunClassClass of the footer confirm button element.confirmButton
cancelButtonClassClass of the footer cancel button element.cancelButton

Sass Variables

Current theme ➜ Oruga

The theme does not have any custom variables for this component.

Current theme ➜ Bulma

The theme does not have any custom variables for this component.

Current theme ➜ Bootstrap

The theme does not have any custom variables for this component.

Released under the MIT License.