Components/Dialog
Since 1.0.0BETA

Dialog

Critical confirmations and multi-style dialogs

This page was migrated by AI, please review carefully

Migration is complete, but please validate against source code and manual review.

Dialog

Dialogs surface important information and confirmations, including BottomDialog / BlowDialog / PopperDialog / TouchTip variants.

BottomDialog

Bottom-aligned dialog with customizable buttons and motion.

BottomDialog

Bottom sheet confirmation dialog.

Demo will load when visible.
<template>
  <TxButton @click="bottomOpen = true">Show dialog</TxButton>
  <TxBottomDialog
    v-if="bottomOpen"
    title="Confirm action"
    message="Are you sure you want to continue?"
    :btns="[
      { content: 'Cancel', type: 'info', onClick: () => true },
      { content: 'Confirm', type: 'success', onClick: async () => true },
    ]"
    :close="() => (bottomOpen = false)"
  />
</template>

Button types

EXAMPLE.TS
const btns = [
  { content: 'Info', type: 'info', onClick: () => true },
  { content: 'Warning', type: 'warning', onClick: () => true },
  { content: 'Error', type: 'error', onClick: () => true },
  { content: 'Success', type: 'success', onClick: () => true },
]

Auto confirm timer

EXAMPLE.TS
const btns = [
  {
    content: 'Auto confirm',
    type: 'success',
    time: 5,
    onClick: () => true,
  },
]

Loading state

EXAMPLE.TS
const btns = [
  {
    content: 'Submit',
    type: 'success',
    onClick: async () => {
      await saveData()
      return true
    },
  },
]

BlowDialog

A centered dialog with dramatic animation.

BlowDialog

Focused, high-impact dialog.

Demo will load when visible.
<template>
  <TxButton @click="blowOpen = true">Show blow dialog</TxButton>
  <TxBlowDialog
    v-if="blowOpen"
    title="Welcome"
    message="<strong>Hello!</strong> Welcome to the app."
    :close="() => (blowOpen = false)"
  />
</template>

PopperDialog

PopperDialog

Lightweight popper-style prompt.

Demo will load when visible.
<template>
  <TxButton @click="popperOpen = true">Show popper dialog</TxButton>
  <TxPopperDialog
    v-if="popperOpen"
    title="Tip"
    message="This is a short tip."
    :close="() => (popperOpen = false)"
  />
</template>

TouchTip

TouchTip

Touch-friendly guidance prompt.

Demo will load when visible.
<template>
  <TxButton @click="tipOpen = true">Show TouchTip</TxButton>
  <TxTouchTip
    v-if="tipOpen"
    title="Notice"
    message="Pick an action."
    :buttons="[
      { content: 'Cancel', type: 'info', onClick: () => true },
      { content: 'Confirm', type: 'success', onClick: async () => true },
    ]"
    :close="() => (tipOpen = false)"
  />
</template>

Custom components

EXAMPLE.TS
import CustomContent from './CustomContent.vue'

function showCustomDialog() {
  return h(TxBlowDialog, {
    comp: CustomContent,
    close: () => {},
  })
}

Render function

EXAMPLE.TS
function showRenderDialog() {
  return h(TxBlowDialog, {
    render: () => h('div', [
      h('h2', 'Dynamic content'),
      h('p', 'Created with a render function'),
    ]),
    close: () => {},
  })
}

API

TxBottomDialog props

NameTypeDefaultDescription
titlestring''Dialog title
messagestring''Dialog message
staynumber0Auto close duration (ms)
close() => voidrequiredClose callback
btnsDialogButton[][]Button configs
iconstring''Icon class
indexnumber0z-index offset

DialogButton interface

EXAMPLE.TS
interface DialogButton {
  content: string
  type?: 'info' | 'warning' | 'error' | 'success'
  time?: number
  onClick: () => Promise<boolean> | boolean
  loading?: (done: () => void) => void
}

TxBlowDialog props

NameTypeDefaultDescription
titlestring''Dialog title
messagestring''Message (HTML supported)
close() => voidrequiredClose callback
compComponentundefinedCustom component
render() => VNodeundefinedRender function

TxPopperDialog props

NameTypeDefaultDescription
titlestring''Dialog title
messagestring''Message (HTML supported)
close() => voidrequiredClose callback
compComponentundefinedCustom component
render() => VNodeundefinedRender function

TxTouchTip props

NameTypeDefaultDescription
titlestring''Title
messagestring''Message text
buttonsTouchTipButton[][]Button configs
close() => voidrequiredClose callback

Accessibility

  • ESC to close
  • Focus moves to the dialog container or confirm button on open
  • Focus restore on close
  • role="dialog", aria-modal, and instance-scoped title/description ARIA links by default
  • DialogButton.onClick() closes the dialog when it returns true and keeps it open when it returns false