Skip to content

PraxisDialog

A modal dialog component. Supports header, content, and footer slots. Renders with an overlay backdrop and traps focus when open.

Usage

vue
<script setup>
import { ref } from 'vue'
import { PraxisDialog } from 'praxis-vue-ui'

const visible = ref(false)
</script>

<template>
  <button @click="visible = true">Open Dialog</button>

  <PraxisDialog v-model:visible="visible" header="Confirm Action">
    <p>Are you sure you want to proceed?</p>
    <template #footer>
      <button @click="visible = false">Cancel</button>
      <button @click="confirm">Confirm</button>
    </template>
  </PraxisDialog>
</template>

Props

PropTypeDefaultDescription
visiblerequiredbooleanControls dialog visibility. Use with v-model:visible.
headerstringundefinedDialog title text. Also overridable via the header slot.
modalbooleantrueWhen true, shows an overlay backdrop.
closablebooleantrueShows the × close button in the header.
dismissableMaskbooleanfalseCloses the dialog when clicking the overlay backdrop.
stylestring | objectundefinedInline styles for the dialog container.

Emits

EventPayloadDescription
update:visiblebooleanEmitted when the dialog is closed. Set visible to false.
hidevoidEmitted after the dialog finishes its close transition.

Slots

SlotDescription
defaultMain dialog body content.
headerCustom header content (replaces header prop text).
footerFooter content, typically action buttons.

Built with VitePress