Skip to content

uc-apx create region metric-card

Insert a themeTemplateComponent/metricCard region backed by an inline SQL query — KPI tiles, one card per row, each with a title, a metric and a meta line.

Required mappings: —title-column, —metric-column, —meta-column.

Optional: —layout stacked|3Columns, an avatar (—display-avatar + —avatar-), and a badge (—display-badge + —badge-).

uc-apx create region metric-card [flags]
FlagTypeDefaultDescription
--avatar-alignmentstringAvatar alignment: center, left, right (optional)
--avatar-positionstringAvatar position: inline, top (optional)
--avatar-shapestringAvatar shape: square, circular, … (optional)
--avatar-stylestringAvatar style: subtle, … (optional)
--badge-iconstringBadge icon: a column (emitted as &COL.) or a static fa-* class (plugin-badge.icon)
--badge-labelstringBadge label (static text or &COL.; plugin-badge.label)
--badge-sizestringBadge size: large, … (optional)
--badge-state-columnstringColumn mapped to the badge state/color (plugin-badge.state)
--badge-value-columnstringColumn mapped to the badge value (plugin-badge.value)
--columnstringComma-separated columns the SQL projects. Syntax: NAME[:TYPE[:LENGTH]] [required]
--column-spanint12-col grid span for the region’s layout (0 = omit)
--display-avatarShow an avatar (plugin-avatar.displayAvatar: true)
--display-badgeShow a badge (plugin-badge.displayBadge: true)
--dry-runPrint rendered region to stdout without writing
--forceReplace an existing same-id region on the page
--idstringRegion id (default: kebab-case of —name)
--layoutstringCard layout: stacked or 3Columns (optional)
--meta-columnstringColumn mapped to the meta line (emitted as &COL.) [required]
--metric-columnstringColumn mapped to the metric value (emitted as &COL.) [required]
--metric-css-classesstringCSS classes applied to the metric, e.g. u-text-title-5 (optional)
--namestringDisplay name of the region [required]
--no-new-rowEmit startNewRow: false so this region sits next to the previous one
--pagestringTarget page (numeric ID, alias, or name) [required]
--pagination-rowsintentitiesPerPage for pagination (0 = omit)
--pk-columnstringColumn to flag as the primary key (optional)
--sequenceintLayout sequence (default: max existing + 10)
--slotstringbodyPage slot to place the region in
--sqlstringInline SQL query (or @path/to/file.sql; @@ escapes a literal leading @) [required]
--title-columnstringColumn mapped to the card title (emitted as &COL.) [required]
FlagTypeDefaultDescription
--app-dirstring.Path to the APEX application directory
--json-prettyOutput in pretty-printed JSON (human-readable) instead of minified JSON
--toonOutput in TOON format (human-readable, token-efficient) instead of JSON

Using --dry-run to preview the generated construct (no files are written):

Terminal window
uc-apx --app-dir examples/brookstrut create region metric-card --page 46 --name KPIs --sql select ticker, price, company from stocks --column TICKER,PRICE,COMPANY --title-column TICKER --metric-column PRICE --meta-column COMPANY --dry-run
Generated APEXlang
region kpis (
name: KPIs
type: themeTemplateComponent/metricCard
source {
location: localDatabase
type: sqlQuery
sqlQuery:
```sql
select ticker, price, company from stocks
```
}
layout {
sequence: 50
slot: body
}
appearance {
template: @/blank-with-attributes
templateOptions: #DEFAULT#
}
componentAppearance {
display: report
}
settings {
title: &TICKER.
metric: &PRICE.
meta: &COMPANY.
}
column TICKER (
layout {
sequence: 10
}
source {
databaseColumn: TICKER
dataType: varchar2
}
)
column PRICE (
layout {
sequence: 20
}
source {
databaseColumn: PRICE
dataType: varchar2
}
)
column COMPANY (
layout {
sequence: 30
}
source {
databaseColumn: COMPANY
dataType: varchar2
}
)
)