This is a draft component and subject to change!
Dialog
Dialogs interrupt users with urgent information, details, or actions. They appear in response to an action the user has performed.
Interactive demo
The demo below allows you to preview the component. You can play with its props, variations, configuration options and dive into its events and even see them trigger in the event log tab.
MedKit Dialog
Icon
Icon
tick
Icon Background
string
Title
string
Required
Text
string
Persistent
boolean
false
Destructive
boolean
false
Is Loading
boolean
false
Dialog Example
A dialog is an opinionated version of a modal.
vue
<template>
<DocExample>
<MedKitButton label="Open Dialog" @click="dialog = true" />
<MedKitDialog v-model="dialog" title="Title" text="Lorem ipsum dolor sit amet, consectetur adipiscing eli.">
<MedKitButton label="Primary Action" kind="primary" @click="dialog = false" />
<MedKitButton label="Secondary Action" kind="secondary" @click="dialog = false" />
<MedKitButton label="Cancel" kind="tertiary" @click="dialog = false" />
</MedKitDialog>
</DocExample>
</template>Destructive Dialog
vue
<template>
<DocExample>
<MedKitButton label="Open Dialog" @click="dialog = true" />
<MedKitDialog v-model="dialog" destructive title="Delete draft?" icon="delete">
<template #text>
<p>This action cannot be undone.</p>
<p>Are you sure you want to continue?</p>
</template>
<MedKitButton label="Destructive Action" kind="primary:destructive" @click="dialog = false" />
<MedKitButton label="Secondary Action" kind="secondary" @click="dialog = false" />
<MedKitButton label="Cancel" kind="tertiary" @click="dialog = false" />
</MedKitDialog>
</DocExample>
</template>Loading State
vue
<template>
<DocExample>
<MedKitButton label="Open Dialog" @click="dialog = true" />
<MedKitDialog v-model="dialog" isLoading title="Processing" text="Please do not refresh or close your browser.">
<MedKitButton label="Close" kind="tertiary" @click="dialog = false" />
</MedKitDialog>
</DocExample>
</template>