| title | Modal |
|---|
Deprecated Since v0.13.0 - use the
ODialogcomponent instead
The Modal component is a classic modal overlay in which you can include any content you like. The content under the overlay is inert, meaning users cannot interact with content outside the active modal window. By default, modal overlays contain their own tab sequence so that users cannot navigate outside the component. The component supports the W3C ARIA APG Dialog (Modal) Pattern as well as the W3C ARIA APG Alert and Message Dialogs Pattern.
Classic modal overlay to include any content you may need.
<o-modal></o-modal>| Prop name | Description | Type | Values | Default |
|---|---|---|---|---|
| active | Whether modal is active or not, use v-model:active to make it two-way binding | boolean | - | false |
| alert | This enables the alertdialog role, allowing assistive technologies and browsers to distinguish alert modals from other modals.Alert modals interrupt the user's workflow to communicate an important messages and acquire an explicit response. |
boolean | - | From config: modal: { |
| animation | Custom animation (transition name) | string | - | From config: modal: { |
| ariaCloseLabel | Accessibility label for the close button | string | - | From config: modal: { |
| ariaLabel | Accessibility aria-label to be passed to the div wrapper element | string | - | From config: modal: { |
| autoFocus | Automatically focus modal when active | boolean | - | From config: modal: { |
| clipScroll | Set true to remove the body scrollbar.When false, a non-scrollable scrollbar will be kept to avoid moving the background,but will set the body to a fixed position, which may break some layouts. |
boolean | - | From config: modal: { |
| closeIcon | Close icon name | string | - | From config: modal: { |
| closeIconSize | Size of close icon | string | small, medium, large |
From config: modal: { |
| closeOnEscape | Close when pressing escape key | boolean | - | From config: modal: { |
| closeOnOutside | Close when clicked outside of the panel | boolean | - | From config: modal: { |
| closeable | Adds close button to the header | boolean | - | From config: modal: { |
| component | Component to be injected. Close the component by emitting a 'close' event — $emit('close') |
C | - | |
| content | Text content, unnecessary when default slot is used | string | - | |
| events | Events to be binded to the injected component | EmitsToProps<ComponentEmit<C>> | - | |
| fullScreen | Display modal as full screen | boolean | - | false |
| iconPack | Icon pack to use | string | mdi, fa, fas and any other custom icon pack |
From config: modal: { |
| mobileBreakpoint | Mobile breakpoint as max-width value |
string | - | From config: modal: { |
| overlay | Show an overlay background | boolean | - | From config: modal: { |
| override | Override existing theme classes completely | boolean | - | |
| props | Props to be binded to the injected component | ComponentProps<C> | - | |
| teleport | Append the component to another part of the DOM. Set true to append the component to the body.In addition, any CSS selector string or an actual DOM node can be used. |
boolean | object | string | - | From config: modal: { |
| trapFocus | Trap focus inside the modal | boolean | - | From config: modal: { |
| width | Width of the Modal | Numberish | - | From config: modal: { |
| Event name | Properties | Description |
|---|---|---|
| update:active | value boolean - updated active prop |
active prop two-way binding |
| close | event Event - native event |
on active state changes to false |
| Name | Description | Bindings |
|---|---|---|
| default | Modal default content, default is content prop | clsoe (...args): void - function to close the component |
| close | Define a custom close icon |
Current theme ➜ Oruga
| SASS Variable | Default |
|---|---|
| $modal-zindex | map.get(vars.$zindex, "fixed") |
| $modal-overlay-background-color | h.useVar("overlay-background-color") |
| $modal-overlay-zindex | map.get(vars.$zindex, "overlay") |
| $modal-content-zindex | map.get(vars.$zindex, "modal") |
| $modal-content-max-height | calc(100vh - 160px) |
| $modal-content-max-width | calc(100vw - 160px) |
| $modal-content-box-shadow | h.useVar("overlay-box-shadow") |
| $modal-content-border-radius | h.useVar("border-radius") |
| $modal-content-background-color | h.useVar("control-background-color") |
| $modal-close-top | 20px |
| $modal-close-right | 20px |
| $modal-close-color | h.useVar("white") |
| $modal-close-size | 2rem |
| $modal-close-border-radius | h.useVar("border-radius-rounded") |
| $modal-close-background-color | h.useVar("control-shadow-color") |
See ➜ 📄 SCSS file
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.