--- description: Display a modal within your application. links: - label: GitHub icon: i-simple-icons-github to: https://github.com/nuxtlabs/ui/blob/dev/src/runtime/components/overlays/Modal.vue - label: 'Dialog' icon: i-simple-icons-headlessui to: 'https://headlessui.com/vue/dialog' --- ## Usage Use a `v-model` to control the Modal state. ::component-example #default :modal-example-basic #code ```vue ``` :: You can put a [Card](/layout/card) component inside your Modal to handle forms and take advantage of `header` and `footer` slots: ::component-example #default :modal-example-card #code ```vue ``` :: ### Disable overlay Set the `overlay` prop to `false` to disable it. ::component-example #default :modal-example-disable-overlay #code ```vue ``` :: ### Disable transition Set the `transition` prop to `false` to disable it. ::component-example #default :modal-example-disable-transition #code ```vue ``` :: ### Prevent close :u-badge{label="New" class="ml-2 align-text-bottom !rounded-full"} Use the `prevent-close` prop to disable the outside click alongside the `esc` keyboard shortcut. ::component-example #default :modal-example-prevent-close #code ```vue ``` :: You can still handle the `esc` shortcut yourself by using our [defineShortcuts](/getting-started/shortcuts#defineshortcuts) composable. ```vue ``` ## Props :component-props ## Preset :component-preset