X Enterprises
Modal

ModalKeyValue

Modal that displays an object or array of key-value pairs using XAFmtData.

Modal

The Modal category provides three composable dialog components built on top of Nuxt UI's UModal. XAModal is the general container; XAModalConfirm handles destructive action confirmations; XAModalKeyValue presents structured data in a readable format. All three support both v-model and internal open-state management, and expose open() / close() methods via defineExpose.

Components

<XAModalKeyValue />

Displays a structured object or array of fields in a modal using XAFmtData. Useful for record detail views, audit logs, or quick-look inspections.

<XAModalKeyValue
  v-model="showDetails"
  title="Order Details"
  :data="{
    orderId: 'ORD-1234',
    status: 'Shipped',
    total: '$149.00',
    createdAt: '2025-03-01'
  }"
  size="lg"
  layout="horizontal"
/>

<!-- With array-form data for full control -->
<XAModalKeyValue
  title="User Details"
  trigger-label="View"
  :data="[
    { key: 'name', label: 'Full Name', value: user.name },
    { key: 'role', label: 'Role', value: user.role, type: 'badge' }
  ]"
/>

Props

PropTypeDefaultDescription
modelValueBooleanundefinedv-model open state
titleString''Modal title
dataObject | Array{}Data to display — plain object or array of field descriptors
sizeString'md'Modal width: sm md lg xl
layoutString'horizontal'Layout passed to XAFmtData
spacingString'md'Spacing passed to XAFmtData
triggerLabelString''Text for the built-in trigger button
triggerIconString''Icon for the built-in trigger button
triggerColorString'primary'Color of the trigger button
triggerVariantString'solid'Variant of the trigger button
triggerSizeString'md'Size of the trigger button

Slots

SlotDescription
triggerReplace the default trigger button
footerOptional footer content below the data

AI Context

component: XAModalKeyValue
package: "@xenterprises/nuxt-x-app"
category: Modal
use-when: >
  Use XAModalKeyValue to surface read-only structured data (record details,
  audit entries) in a quick-look overlay without building a custom layout.
  Pass a plain object for automatic key/value rendering or an array of field
  descriptors for full control over labels and types.
Copyright © 2026