X Enterprises
Data

KeyValue

Single key-value row with automatic type rendering for text, badge, boolean, link, email, phone, currency, date, copy, and code.

Data

Data components handle the rendering of structured information in detail views, sidebars, and list pages. They cover everything from a single formatted number to a full activity feed with date grouping.

Components

<XAKeyValue />

A single label-value row (<dt> / <dd>) that automatically renders the value according to its type. Accepts a default slot for fully custom value rendering.

<XAKeyValue label="Email" value="alice@example.com" type="email" />
<XAKeyValue label="Status" value="active" type="badge" badge-color="success" />
<XAKeyValue label="Created" value="2025-03-15" type="date" date-format="long" />
<XAKeyValue label="API Key" value="sk-abc123" type="copy" />
<XAKeyValue label="Verified" :value="true" type="boolean" />

Props

PropTypeDefaultDescription
labelstringRequired. The key/label text.
valuestring | number | boolean | Date | objectundefinedThe value to display.
type'text' | 'badge' | 'boolean' | 'link' | 'email' | 'phone' | 'currency' | 'date' | 'copy' | 'code''text'Rendering type.
layout'horizontal' | 'vertical' | 'inline''horizontal'Label/value layout direction.
size'sm' | 'md' | 'lg''md'Font size variant.
iconstring''Lucide icon shown before the label.
emptyTextstring'—'Text shown when the value is empty/null/undefined.
currencystring'USD'ISO currency code for type="currency".
dateFormat'date' | 'time' | 'datetime' | 'relative' | 'short' | 'long''date'Date display format for type="date".
badgeColorstring'neutral'Badge color for type="badge".
linkTextstring''Link label for type="link" (defaults to the URL).
showBooleanLabelbooleantrueShow Yes/No label beside the boolean icon.
trueLabelstring'Yes'Label for true in boolean type.
falseLabelstring'No'Label for false in boolean type.
noBorderbooleanfalseRemove the bottom border/divider.

AI Context

component: XAKeyValue
package: "@xenterprises/nuxt-x-app"
auto-import: true
prefix: XA
category: Data
use-when: Rendering a single labeled field in a detail view. Handles 10 value types automatically (text, badge, boolean, link, email, phone, currency, date, copy, code) — prefer it over custom formatting.
Copyright © 2026