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.
<o-dialog></o-dialog>Props
| Prop name | Description | Type | Values | Default |
|---|---|---|---|---|
| ariaCloseLabel | Accessibility label for the close button | string | - | From config: dialog: { |
| buttonPosition | Position of the footer buttons | "centered" | "left" | "right" | - | |
| cancelButton | Render a cancel button and set text text as label | string | - | |
| cancelVariant | Color variant of the cancel button | string | primary, info, success, warning, danger, and any other custom color | |
| closeIcon | Close icon name | string | - | From config: dialog: { |
| closeIconSize | Close icon size | string | - | From config: dialog: { |
| closeable | Adds close button to the header | boolean | - | From config: dialog: { |
| component | Component to be injected. Close the component by emitting a 'close' event — $emit('close') | Component | - | |
| confirmButton | Render a confirm button and set text as label | string | - | |
| confirmVariant | Color variant of the confirm button | string | primary, info, success, warning, danger, and any other custom color | |
| content | Dialog body content, unnecessary when content slot is used | string | - | |
| disableCancel | Disable the cancel button | boolean | - | |
| disableConfirm | Disable the confirm button | boolean | - | |
| events | Events to be binded to the injected component | {} | - | |
| iconPack | Icon pack to use for the close icon | string | mdi, fa, fas and any other custom icon pack | From config: dialog: { |
| imageAlt | Dialog image alt, unnecessary when image slot is used | string | - | |
| imageSrc | Dialog image src, unnecessary when image slot is used | string | - | |
| loading | Show a loading spinner in the dialog | boolean | - | |
| loadingLabel | Show label beside the loading icon | string | - | |
| override | Override existing theme classes completely | boolean | - | |
| props | Props to be binded to the injected component | any | - | |
| subtitle | Dialog header subtitle, unnecessary when subtitle slot is used Class of the header subtitle element | (string & ComponentClass) | - | |
| title | Dialog header title, unnecessary when title slot is used | string | - |
Events
| Event name | Properties | Description |
|---|---|---|
| close | event Event - native event | close button click event |
| confirm | event Event - native event | confirm button click event |
Slots
| Name | Description | Bindings |
|---|---|---|
| header | Override the header | close (event: Event): void - function to emit a close event |
| title | Override the header title, default is title prop | |
| subtitle | Override the header subtitle, default is subtitle prop | |
| close | Override the close icon | |
| image | Override the image | |
| default | Override the default dialog body | close (event: Event): void - function to emit a close eventconfirm (event: Event): void - function to emit a confirm event |
| content | Override the body content, default is content prop | close (event: Event): void - function to emit a close eventconfirm (event: Event): void - function to emit a confirm event |
| footer | Override the footer | close (event: Event): void - function to emit a close eventconfirm (event: Event): void - function to emit a confirm event |
| cancelButton | ||
| confirmButton |
Class Inspector
| Class prop | Description | Props | Suffixes | |
|---|---|---|---|---|
| rootClass | Class of the root element. | |||
| headerClass | Class of the header element. | |||
| titleClass | Class of the header title element. | |||
| subtitle | Class of the header subtitle element. | |||
| closeClass | Class of the header close element. | |||
| imageClass | Class of the image container. | |||
| figureClass | Class of the image figure element. | |||
| bodyClass | Class of the body element. | |||
| contentClass | Class of the body content element. | |||
| footerClass | Class of the footer element. | |||
| footerPositionClass | Class of the footer element with position. | buttonPosition | left | |
| confirmButtunClass | Class of the footer confirm button element. | confirmButton | ||
| cancelButtonClass | Class 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.
