X Enterprises
Table

TableCellRenderer

Renders table cell content from a column preset (text, email, badge, date, currency, number, boolean, avatar, link).

TableCellRenderer

A renderless cell renderer that picks the appropriate display format based on the column's meta.preset field. Use it inside custom cell templates for <XATable> to keep formatting consistent with the built-in preset column types exposed by useXTableColumns().

Components

<XATableCellRenderer />

<XATableCellRenderer
  :value="row.email"
  :column="{ meta: { preset: 'email' } }"
  :row="row"
/>

Props

PropTypeDefaultDescription
valuestring | number | boolean | Date | object | arraynullThe raw cell value to render.
columnObjectrequiredColumn descriptor. Reads column.meta.preset to pick the renderer.
rowObject{}Full row data — used by the avatar preset to derive name/fallback.

Supported presets

PresetBehavior
text (default)Plain text. Falls back to when the value is null/undefined.
emailClickable mailto: link.
linkExternal link with target="_blank" + rel="noopener noreferrer".
badge<UBadge> whose color comes from column.meta.colorMap[value] or the built-in status→color table.
dateLocalized date. Supports format: 'relative' | 'time' | 'datetime' | 'date' in column.meta.
currencyIntl.NumberFormat currency. Configure with column.meta.currency and column.meta.locale.
numberLocale-formatted number. Configure with column.meta.decimals and column.meta.locale.
booleanCheck / X icon (no text).
avatar<UAvatar> plus optional name. Configure with column.meta.size and column.meta.showName.

Default badge color map

The following strings auto-map to semantic colors when no explicit colorMap is set:

active → success      approved → success    completed → success
inactive → neutral    rejected → error      cancelled → error
pending → warning     draft → neutral       published → success
enabled → success      disabled → neutral   archived → neutral
true → success         false → neutral      yes → success   no → neutral

AI Context

component: XATableCellRenderer
package: "@xenterprises/nuxt-x-app"
category: Table
use-when: >
  Inside custom <XATable> cell templates when you need a single renderer
  that adapts to the column's preset. Pair with useXTableColumns() presets
  to keep column definitions and cell rendering in sync.
preset-resolution: "column.meta.preset ?? 'text'"
Copyright © 2026