X Enterprises
nuxt-x-app

Card

A comprehensive set of card components for dashboards — stats, KPIs, progress, quotas, revenue, and chart containers.

Card

The Card category provides building blocks for analytics dashboards. There is a base <XACard> container plus specialised variants for metrics, progress tracking, quotas, and chart visualisations.

Components

<XACard />

Base card container with an optional header (title, description, icon), collapsible body, footer slot, and border variants for status states.

<XACard
  title="Recent Activity"
  description="Last 30 days"
  icon="i-lucide-activity"
  collapsible
  variant="default"
>
  <p>Card body content</p>
  <template #header-actions>
    <UButton size="xs" label="View all" />
  </template>
  <template #footer>
    <span class="text-sm text-neutral-500">Updated just now</span>
  </template>
</XACard>

Props

PropTypeDefaultDescription
titlestring''Card header title.
descriptionstring''Subtitle below the title.
iconstring''Lucide icon name shown in the header.
collapsiblebooleanfalseShow a collapse toggle button.
collapsedbooleanfalseInitial collapsed state.
paddingbooleantrueApply default body padding.
dividerbooleantrueShow divider line under the header.
variant'default' | 'error' | 'warning' | 'success''default'Border color variant.

Slots

default, header-actions, footer


<XACardStat />

Single-metric stat card with automatic number formatting, trend badge, and configurable icon.

<XACardStat
  label="Monthly Revenue"
  :value="48500"
  :trend="12.4"
  trend-label="vs last month"
  icon="i-lucide-dollar-sign"
  icon-color="success"
  format="currency"
  currency-symbol="$"
/>

Props

PropTypeDefaultDescription
labelstringRequired. Metric label.
valuestring | numberRequired. Metric value.
trendnumber | nullundefinedPercentage change (positive = up, negative = down).
trendLabelstring''Descriptive label beside the trend badge.
descriptionstring''Secondary text below the value.
iconstring''Lucide icon name.
iconColor'primary' | 'success' | 'warning' | 'error' | 'neutral''primary'Icon background/color theme.
size'sm' | 'md' | 'lg''md'Value font size.
format'number' | 'currency' | 'percent' | 'none''none'Number formatting mode.
currencySymbolstring'$'Symbol prepended in currency format.

<XAStatsCard />

Option-object-based stats card with full Intl number formatting and color theming.

<XAStatsCard
  title="Total Users"
  :value="12400"
  format="number"
  icon="i-lucide-users"
  color="primary"
  :trend="5.2"
  trend-label="from last month"
/>

Props

PropTypeDefaultDescription
titlestringRequired. Card label.
valuenumber | stringundefinedMetric value.
format'number' | 'currency' | 'percent''number'Number formatting mode.
currencystring'USD'ISO currency code for currency format.
localestring'en-US'Locale for Intl formatting.
iconstring''Lucide icon name.
colorstring'primary'Icon/accent color theme.
trendnumberundefinedPercentage change.
trendLabelstring''Label beside the trend indicator.
descriptionstring''Secondary description text.
loadingbooleanfalseShow loading skeleton.

<XAStatsGrid />

Responsive grid that renders an array of stat objects as <XAStatsCard> components.

<XAStatsGrid
  :stats="[
    { title: 'Revenue', value: 48500, format: 'currency', icon: 'i-lucide-dollar-sign', trend: 12.4 },
    { title: 'Users', value: 3200, format: 'number', icon: 'i-lucide-users', trend: -2.1 },
  ]"
  :columns="2"
  gap="md"
/>

Props

PropTypeDefaultDescription
statsarray[]Array of stat objects (see XAStatsCard props).
columns1 | 2 | 3 | 4 | 5 | 64Number of columns at the widest breakpoint.
gap'sm' | 'md' | 'lg''md'Grid gap size.
localestring'en-US'Locale passed to each child card.

<XACardKpi />

Slot-based KPI card. All content is provided through named slots: label, value, trend, and chart.

<XACardKpi>
  <template #label>Monthly Recurring Revenue</template>
  <template #value>$84,200</template>
  <template #trend>
    <span class="text-success-500">+8.3%</span>
  </template>
  <template #chart>
    <XAChartLine :data="data" :categories="categories" :height="60" />
  </template>
</XACardKpi>

This component has no props — it is entirely slot-driven.


<XACardKpiSimple />

Compact KPI card with automatic currency formatting, an optional trend indicator, and a budget progress bar.

<XACardKpiSimple
  label="Actual Spend"
  :value="63000"
  :trend="-4"
  :budget="80000"
  show-percentage
  color="#10b981"
/>

Props

PropTypeDefaultDescription
labelstringRequired. KPI label.
valuestring | numberRequired. KPI value (numbers are formatted as currency).
trendnumber | nullundefinedPercentage change.
colorstring'#3b82f6'Dot accent color.
showPercentagebooleanfalseShow a progress bar as % of budget.
budgetnumber0Budget cap used to calculate the progress bar.

<XACardProgress />

Progress card that can render a horizontal progress bar, a donut circle, or both.

<XACardProgress
  label="Storage Used"
  :value="73"
  :max="100"
  subtitle="27 GB remaining"
  type="both"
  color="warning"
  size="md"
/>

Props

PropTypeDefaultDescription
labelstringRequired. Metric label.
valuenumberRequired. Current value.
maxnumber100Maximum value.
subtitlestring''Text shown beside the percentage.
type'bar' | 'circle' | 'both''bar'Which visualization to render.
color'primary' | 'success' | 'warning' | 'error' | string'primary'Progress fill color.
size'sm' | 'md' | 'lg''md'Label/circle size variant.

<XACardProgressCircle />

Compact card pairing a XAChartProgressCircle with a text label and formatted value.

<XACardProgressCircle
  label="Task Completion"
  value="48 / 60"
  :progress="80"
/>

Props

PropTypeDefaultDescription
labelstringRequired. Card label.
valuenumber | stringRequired. Displayed value text.
progressnumberRequired. Circle fill percentage (0–100).
colorstringundefinedCustom circle color.

<XACardQuota />

Displays multiple usage quotas in a grid or list layout with warning/critical/exceeded badges and optional overage pricing.

<XACardQuota
  title="Plan Usage"
  :quotas="[
    { label: 'API Calls', used: 8200, limit: 10000, unit: 'calls', icon: 'i-lucide-zap', warningThreshold: 80 },
    { label: 'Storage', used: 4.2, limit: 5, unit: 'GB', icon: 'i-lucide-hard-drive' },
  ]"
  reset-date="2026-04-01"
  show-summary
  current-plan="Pro"
/>

Props

PropTypeDefaultDescription
quotasarrayRequired. Array of quota objects.
titlestring''Card title.
descriptionstring''Card subtitle.
resetDateDate | string | nullnullQuota reset date shown in the header.
layout'grid' | 'list''grid'Layout mode.
columnsnumberNumber of grid columns.
showSummarybooleanfalseShow a footer summarising limits reached.
currentPlanstring''Plan name shown in the summary footer.

Emits

EventPayloadDescription
upgradeFired when the "Upgrade Plan" button is clicked.

<XACardQuotaBar />

Single-resource quota card with a UProgress bar, optional auto-color thresholds, and a footer slot.

<XACardQuotaBar
  title="API Requests"
  subtitle="This billing period"
  :value="7800"
  :max="10000"
  unit="calls"
  color="primary"
  auto-color
  show-percent
/>

Props

PropTypeDefaultDescription
titlestringRequired. Card title.
valuenumberRequired. Current usage value.
maxnumberRequired. Maximum limit.
subtitlestring''Optional subtitle.
unitstring''Unit label (e.g. 'GB').
color'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info' | 'neutral''primary'Progress bar color.
iconstring''Lucide icon name.
showPercentbooleanfalseShow percentage instead of value/max.
decimalsnumber0Decimal places for formatted values.
autoColorbooleanfalseAuto-switch to warning/error color at thresholds.
warningThresholdnumber80Percentage at which to switch to warning color.
errorThresholdnumber95Percentage at which to switch to error color.

<XACardRevenue />

Revenue metric card with an embedded area sparkline, name, value, and optional comparison row.

<XACardRevenue
  name="Net Revenue"
  value="$124,800"
  :data="revenueData"
  :categories="{ revenue: { name: 'Revenue', color: '#3b82f6' } }"
  comparison-label="vs last month"
  comparison-value="+12%"
/>

Props

PropTypeDefaultDescription
namestringRequired. Metric name.
valuestring | numberRequired. Formatted metric value.
dataChartDataItem[]Required. Time-series data array ({ date, ...values }).
categoriesRecord<string, { name: string; color: string }>Required. Chart category definitions.
comparisonLabelstring''Label for the comparison row.
comparisonValuestring | number''Value for the comparison row.
heightnumber90Chart height in px.
xNumTicksnumber4Number of X-axis ticks.
yNumTicksnumber1Number of Y-axis ticks.
curveType'linear' | 'natural' | 'monotone' | 'step''linear'Chart curve type.
hideLegendbooleantrueHide the chart legend.

<XACardRevenueBar />

Revenue card with an embedded grouped bar chart.

<XACardRevenueBar
  name="Sales by Channel"
  value="$84,200"
  :data="salesData"
  :categories="{
    online: { name: 'Online', color: '#3b82f6' },
    retail: { name: 'Retail', color: '#10b981' },
  }"
  :height="328"
/>

Props

PropTypeDefaultDescription
namestringRequired. Chart card name.
valuestring | numberRequired. Summary value.
dataChartDataItem[]Required. Chart data array.
categoriesRecord<string, { name: string; color: string }>Required. Bar categories.
comparisonLabelstring''Comparison row label.
comparisonValuestring | number''Comparison row value.
heightnumber328Chart height in px.
xNumTicksnumber6X-axis ticks.
yNumTicksnumber5Y-axis ticks.
groupPaddingnumber0Padding between bar groups.
barPaddingnumber0.2Padding between bars within a group.
radiusnumber4Bar corner radius.
hideLegendbooleanfalseHide the chart legend.
yGridLinebooleanfalseShow horizontal grid lines.

<XACardIndicator />

Minimal indicator card: uppercase label, large value, and an up/down trend percentage versus the previous month.

<XACardIndicator
  label="Conversion Rate"
  value="3.48%"
  :trend="2.1"
/>

Props

PropTypeDefaultDescription
labelstringRequired. Metric label.
valuenumber | stringRequired. Metric value.
trendnumberRequired. Month-over-month percentage change.

<XACardSparkline />

Stat card with a small inline sparkline (area or line chart) rendered from a flat number array.

<XACardSparkline
  label="Weekly Signups"
  value="1,240"
  :data="[120, 145, 98, 160, 175, 140, 190]"
  :trend="8.5"
  chart-type="area"
  format="number"
  color="#6366f1"
/>

Props

PropTypeDefaultDescription
labelstringRequired. Metric label.
valuestring | numberRequired. Metric value.
datanumber[]Required. Flat array of numeric values for the sparkline.
trendnumber | nullundefinedPercentage trend badge value.
chartType'line' | 'area''area'Sparkline chart type.
colorstring'#06b6d4'Chart line/area color.
format'number' | 'currency' | 'percent' | 'none''none'Value formatting mode.
currencySymbolstring'$'Symbol for currency format.

<XACardDonut />

Donut chart card with a legend table showing name and percentage share for each segment.

<XACardDonut
  title="Revenue by Region"
  total-value="$248,000"
  :data="[
    { name: 'North America', value: 45, color: '#3b82f6' },
    { name: 'Europe', value: 30, color: '#10b981' },
    { name: 'Asia Pacific', value: 25, color: '#f59e0b' },
  ]"
  center-label="Total"
  center-sub-label="$248K"
/>

Props

PropTypeDefaultDescription
titlestringRequired. Card title.
totalValuestringRequired. Formatted total displayed under the title.
data{ name: string; value: number; color: string }[]Required. Donut segments.
centerLabelstringundefinedText on the first line of the donut center.
centerSubLabelstringundefinedText on the second line of the donut center.
legendNameLabelstring'Category'Header for the name column in the legend table.
legendValueLabelstring'Share'Header for the value column in the legend table.

<XACardChart />

Generic area-chart card with a subtitle, comparison row, and optional legend.

<XACardChart
  name="Page Views"
  :value="84200"
  :chart-data="pageViewData"
  :categories="{ views: { name: 'Views', color: '#6366f1' } }"
  comparison-label="vs last month"
  comparison-value="+9.4%"
  :show-legend="false"
/>

Props

PropTypeDefaultDescription
namestringRequired. Card name/subtitle.
valuestring | numberRequired. Summary metric value.
chartDataChartDataItem[]Required. Area chart data ({ date, ...values }).
categoriesRecord<string, { name: string; color: string }>Required. Chart categories.
heightnumber90Chart height in px.
showLegendbooleanfalseShow the chart legend.
curveTypeanyCurveType.LinearCurve interpolation type.

<XACardChartBlock />

Card variant that wraps a chart slot and overlays a title and description at the bottom. Useful as a decorative/feature card.

<XACardChartBlock
  title="Growth Trajectory"
  text="Steady month-over-month growth across all channels."
>
  <XAChartLine :data="data" :categories="categories" :height="160" />
</XACardChartBlock>

Props

PropTypeDefaultDescription
titlestringRequired. Overlay title.
textstringRequired. Overlay description text.

<XACardChartRevenue />

Revenue card containing a grouped bar chart with configurable axes and legend.

<XACardChartRevenue
  title="Monthly Revenue"
  value="$1.2M YTD"
  :data="revenueData"
  :categories="{
    desktop: { name: 'Desktop', color: '#3b82f6' },
    mobile: { name: 'Mobile', color: '#10b981' },
  }"
  :height="200"
/>

Props

PropTypeDefaultDescription
titlestring''Card title.
valuestring''Summary value shown under the title.
dataRevenueDataItem[]Required. Bar chart data ({ month, desktop, mobile, ... }).
categoriesRevenueCategoriesRequired. Category name/color map.
heightnumber200Chart height in px.
yAxisstring[]['desktop', 'mobile']Data keys for the Y axis.
groupPaddingnumber0Padding between bar groups.
barPaddingnumber0.2Padding between bars.
radiusnumber4Bar corner radius.
yNumTicksnumber4Y-axis tick count.
legendPosition'top' | 'bottom' | 'left' | 'right''top'Legend placement.
hideLegendbooleantrueHide the legend.
yGridLinebooleantrueShow horizontal grid lines.

<XACardChartRevenueLine />

Revenue card with a line chart — designed for current-year vs last-year comparisons.

<XACardChartRevenueLine
  title="Revenue Trend"
  value="$84,200"
  :data="trendData"
  :categories="{
    current: { name: 'This Year', color: '#3b82f6' },
    last_year: { name: 'Last Year', color: '#d1d5db' },
  }"
/>

Props

PropTypeDefaultDescription
titlestring''Card title.
valuestring''Summary value.
dataRevenueLineDataItem[]Required. Line data ({ date, current, last_year }).
categoriesRevenueLineCategoriesRequired. Category map.
heightnumber180Chart height in px.
xNumTicksnumber4X-axis ticks.
yNumTicksnumber3.5Y-axis ticks.
curveType'linear' | 'natural' | 'monotone' | 'step''linear'Curve interpolation.
legendPosition'top' | 'bottom' | 'left' | 'right''top'Legend placement.
hideLegendbooleantrueHide the legend.
hideXAxisbooleantrueHide X-axis labels.
yGridLinebooleantrueShow horizontal grid lines.

<XACardChartExpenses />

Expenses card with a stacked or grouped bar chart and full axis control.

<XACardChartExpenses
  title="Expenses by Product"
  value="$32,400"
  :data="expensesData"
  :categories="{
    sales: { name: 'Sales', color: '#3b82f6' },
    counter: { name: 'Counter', color: '#f59e0b' },
  }"
  stacked
/>

Props

PropTypeDefaultDescription
titlestring''Card title.
valuestring''Summary value.
dataExpensesDataItem[]Required. Bar data ({ product, sales, counter }).
categoriesExpensesCategoriesRequired. Category map.
heightnumber140Chart height in px.
stackedbooleantrueStack bars.
hideXAxisbooleantrueHide X-axis labels.
yNumTicksnumber4Y-axis ticks.
yAxisstring[]['sales', 'counter']Data keys.
legendPosition'top' | 'bottom' | 'left' | 'right''top'Legend placement.
hideLegendbooleanfalseHide the legend.
radiusnumber8Bar corner radius.
barPaddingnumber0.6Bar padding.

<XACardChartFinance />

Finance breakdown card combining a donut chart with a percentage-based legend.

<XACardChartFinance
  :categories="[
    { name: 'Marketing', value: 42000, color: '#3b82f6' },
    { name: 'Engineering', value: 68000, color: '#10b981' },
    { name: 'Operations', value: 24000, color: '#f59e0b' },
  ]"
  center-label="Total Spend"
  currency="USD"
/>

Props

PropTypeDefaultDescription
categoriesFinanceCategory[]Required. Segments: { color, name, value }.
centerLabelstring'Total Spent'Donut center label.
currencystring'USD'Currency for the formatted total.
localestring'en-US'Locale for Intl formatting.
heightnumber200Donut chart height in px.
arcWidthnumber10Donut arc stroke width.
padAnglenumber0.1Padding between segments.
radiusnumber4Segment corner radius.

<XACardChartWinLoss />

Win/loss chart card using a line chart segmented by day.

<XACardChartWinLoss
  title="Daily Win/Loss"
  :data="winLossData"
  :categories="{
    wins: { name: 'Wins', color: '#10b981' },
    losses: { name: 'Losses', color: '#ef4444' },
  }"
/>

Props

PropTypeDefaultDescription
titlestring''Card title.
dataWinLossDataItem[]Required. Data array ({ day, ...values }).
categoriesWinLossCategoriesRequired. Category map.
yAxisstring[][]Data keys for Y axis.
heightnumber160Chart height in px.
stackedbooleanfalseStack the series.
radiusnumber3Bar corner radius.
groupPaddingnumber0.2Group padding.
barPaddingnumber0.2Bar padding.
hideLegendbooleantrueHide the legend.
yNumTicksnumber4Y-axis ticks.

<XACardStatsSummary />

Summary card combining an area chart with a prominent metric value and a comparison note.

<XACardStatsSummary
  title="Total Revenue"
  :value="124800"
  :chart-data="summaryData"
  :categories="{ revenue: { name: 'Revenue', color: '#3b82f6' } }"
  comparison-label="vs Last Months"
  comparison-value="+14.2%"
/>

Props

PropTypeDefaultDescription
titlestringRequired. Card title/label.
valuestring | numberRequired. Featured metric value.
chartDataChartDataItem[]Required. Area chart data ({ date, ...values }).
categoriesRecord<string, { name: string; color: string }>Required. Chart categories.
heightnumber90Chart height in px.
showLegendbooleanfalseShow the chart legend.
curveTypeanyCurveType.LinearCurve interpolation.
comparisonLabelstring'vs Last Months'Comparison label text.
comparisonValuestringundefinedComparison value (shown in success color).

<XACardActiveUsers />

Displays an active-user count with a stacked avatar list, trend indicator, and overflow badge.

<XACardActiveUsers
  label="Active Members"
  count="1,234"
  :users="[
    { name: 'Alice Johnson', avatar: '/avatars/alice.png' },
    { name: 'Bob Smith' },
    { name: 'Carol White', avatar: '/avatars/carol.png' },
  ]"
  :trend="12.5"
  trend-label="from last month"
  :max-display="4"
  subtitle="currently online"
/>

Props

PropTypeDefaultDescription
labelstringRequired. Card label.
countstring | numberRequired. Active user count (can be pre-formatted like '12.4k').
users{ name: string; avatar?: string }[][]Users to show in the avatar stack.
trendnumberundefinedPercentage trend (positive or negative).
trendLabelstring'from previous month'Text label beside the trend.
maxDisplaynumber4Max avatars before showing +X more.
subtitlestring''Text shown beside the avatar stack.

AI Context

category: Card
package: "@xenterprises/nuxt-x-app"
components:
  - XACard
  - XACardStat
  - XAStatsCard
  - XAStatsGrid
  - XACardKpi
  - XACardKpiSimple
  - XACardProgress
  - XACardProgressCircle
  - XACardQuota
  - XACardQuotaBar
  - XACardRevenue
  - XACardRevenueBar
  - XACardIndicator
  - XACardSparkline
  - XACardDonut
  - XACardChart
  - XACardChartBlock
  - XACardChartRevenue
  - XACardChartRevenueLine
  - XACardChartExpenses
  - XACardChartFinance
  - XACardChartWinLoss
  - XACardStatsSummary
  - XACardActiveUsers
use-when: >
  Building dashboard overview pages, KPI panels, analytics summaries,
  or resource usage sections. Use XACard as a general purpose container,
  XAStatsGrid for a row of metrics, and the specialised chart cards
  (Revenue, Sparkline, Donut, etc.) for inline data visualisation.
patterns:
  - XAStatsGrid accepts a flat stats array; individual cards accept discrete props.
  - Chart cards require a `data` array and a `categories` map keyed by data field.
  - XACardQuota manages multiple resources in one card; XACardQuotaBar handles one.
  - Trend props accept positive (up) and negative (down) numbers — colors are automatic.
Copyright © 2026