Vue Dialog Component API
Dialog API
Explore the API reference for the Vue Dialog component and discover how to effectively utilize its props for customization.
CDialog
import { CDialog } from '@coreui/vue'
Props
| Property | Default | Type |
|---|
| animation | true | boolean, string |
How the dialog comes in. Left out it fades in place, false turns the animation off, and a variant name picks one — the value names the variant, so further ones are added to the stylesheet rather than to this prop. |
| backdrop | true | boolean, string |
Apply a backdrop while the dialog is open. 'static' keeps the dialog open on a backdrop click and bounces it instead. |
| backdropVariant6.0.0+ | - | string |
Pick the backdrop's look: the dark scrim or the translucent tint of the page. Left out, the component keeps its own default. |
| dark6.0.0+ | - | boolean |
Flip the dialog to the dark color mode, whatever the page around it uses. |
| fullscreen | - | boolean, string |
Cover the whole viewport — always with true, or only below the given breakpoint. |
| keyboard | true | boolean |
Closes the dialog when escape key is pressed. |
| modal | true | boolean |
Open the dialog modally, taking over the page. Set it to false for a dialog that leaves the rest of the page interactive. |
| scrollable | - | boolean |
Create a scrollable dialog that allows scrolling the dialog body. |
| show6.0.0+ | undefined | boolean |
Control the open state. When set, the dialog renders what show says and dismiss gestures only emit update:show — nothing closes until the parent flips the prop. |
| size | - | string |
Size the component small, large, or extra large. |
| unmountOnClose | true | boolean |
By default the component is unmounted after close animation, if you want to keep the component mounted set this property to false. |
| visibleDeprecated 6.0.0 | undefined | boolean |
Toggle the visibility of the dialog component. Use show / v-model:show instead — visible is ignored when show is set. |
Events
| Event name |
|---|
| close |
Callback fired once the component has closed. |
| close-prevented |
Callback fired when the dialog is shown, its backdrop is static and a click outside the dialog or an escape key press is performed with the keyboard option set to false. |
| show |
Callback fired when the component requests to be shown. |
| update:show |
Callback fired when the dialog requests an open-state change — a dismiss gesture (Escape, backdrop click) or any internal toggle. In controlled mode update show yourself, or the dialog stays as it is. |
CDialogBody
import { CDialogBody } from '@coreui/vue'
import { CDialogFooter } from '@coreui/vue'
import { CDialogHeader } from '@coreui/vue'
CDialogTitle
import { CDialogTitle } from '@coreui/vue'