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]| Flag | Type | Default | Description |
|---|---|---|---|
--avatar-alignment | string | Avatar alignment: center, left, right (optional) | |
--avatar-position | string | Avatar position: inline, top (optional) | |
--avatar-shape | string | Avatar shape: square, circular, … (optional) | |
--avatar-style | string | Avatar style: subtle, … (optional) | |
--badge-icon | string | Badge icon: a column (emitted as &COL.) or a static fa-* class (plugin-badge.icon) | |
--badge-label | string | Badge label (static text or &COL.; plugin-badge.label) | |
--badge-size | string | Badge size: large, … (optional) | |
--badge-state-column | string | Column mapped to the badge state/color (plugin-badge.state) | |
--badge-value-column | string | Column mapped to the badge value (plugin-badge.value) | |
--column | string | Comma-separated columns the SQL projects. Syntax: NAME[:TYPE[:LENGTH]] [required] | |
--column-span | int | 12-col grid span for the region’s layout (0 = omit) | |
--display-avatar | Show an avatar (plugin-avatar.displayAvatar: true) | ||
--display-badge | Show a badge (plugin-badge.displayBadge: true) | ||
--dry-run | Print rendered region to stdout without writing | ||
--force | Replace an existing same-id region on the page | ||
--id | string | Region id (default: kebab-case of —name) | |
--layout | string | Card layout: stacked or 3Columns (optional) | |
--meta-column | string | Column mapped to the meta line (emitted as &COL.) [required] | |
--metric-column | string | Column mapped to the metric value (emitted as &COL.) [required] | |
--metric-css-classes | string | CSS classes applied to the metric, e.g. u-text-title-5 (optional) | |
--name | string | Display name of the region [required] | |
--no-new-row | Emit startNewRow: false so this region sits next to the previous one | ||
--page | string | Target page (numeric ID, alias, or name) [required] | |
--pagination-rows | int | entitiesPerPage for pagination (0 = omit) | |
--pk-column | string | Column to flag as the primary key (optional) | |
--sequence | int | Layout sequence (default: max existing + 10) | |
--slot | string | body | Page slot to place the region in |
--sql | string | Inline SQL query (or @path/to/file.sql; @@ escapes a literal leading @) [required] | |
--title-column | string | Column mapped to the card title (emitted as &COL.) [required] |
Global Flags
Section titled “Global Flags”| Flag | Type | Default | Description |
|---|---|---|---|
--app-dir | string | . | Path to the APEX application directory |
--json-pretty | Output in pretty-printed JSON (human-readable) instead of minified JSON | ||
--toon | Output in TOON format (human-readable, token-efficient) instead of JSON |
Example Generated APEXlang
Section titled “Example Generated APEXlang”Using --dry-run to preview the generated construct (no files are written):
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-runGenerated 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 } ) )