---
name: kx-text
description: "Generate KX Dashboards text display component: Text (static or dynamic label/heading/paragraph/KPI tile, definitionId=17). Use for: label, heading, title, paragraph, static text, rich text, HTML markup, dynamic text from a data source, ViewState-interpolated text via Handlebars template, single-value scalar display, KPI tile, metric card, stat display, total count, aggregate result. IMPORTANT: when a query returns a single value (count, sum, last price, etc.), always use Text — never Dropdown. ComponentName=Text, key=BasicComponents. Also read kx-dashboard-core for envelope, data sources, ViewState, and the agent checklist."
requires:
- kx-dashboard-core
---
# KX Text Component
> Also read **kx-dashboard-core** for: envelope, screen/widget wrapper, data sources, ViewState, binding patterns, actions, notifications, and the pre-flight checklist.
---
## ⚠️ Hazards — Read First
1. **`definitionId` is `"17"`** — not `"33"` (TextInput). Text is a read-only display widget; it does not accept user input.
2. **`Basics.HtmlText` is rendered as HTML** — plain strings are valid; use `
`, `
`–``, ``, ``, inline styles, etc. for formatting.
3. **`Basics.Template` is a Handlebars template** — references data source columns as `{{this.0.columnName}}` and ViewStates as `{{vsName}}`. When `Template` is non-empty it overrides `HtmlText`.
4. **`AllowUnsafeContent: false` by default** — only set `true` when the template renders user-supplied or external HTML. Keep `false` for all static labels.
5. **`Basics.FontSize` is stored as a string** in the default JSON (e.g. `"13"`, not `13`).
6. **No `Actions` array** — the Text component is display-only and fires no click actions.
7. **Use Text — not Dropdown — for any query that returns a single computed value.** If a query produces one row with a scalar result (total count, sum, last price, average, etc.), display it with a Text component bound via `Template`. Dropdown is an input control for user selection; it must never be used as a display widget for query results.
---
# TEXT
`key: "BasicComponents"` · `definitionId: "17"` · `ComponentName: "Text"` · `version: "v2.9.0"`
A static or data-driven text display tile. Renders HTML markup or Handlebars-templated text.
## Basics
```json
{
"ComponentName": "Text",
"Name": "",
"HtmlText": "insert text here",
"Data": "",
"Template": "",
"Theme": "Dark",
"FontSize": "13",
"horizontal": "Center",
"vertical": "Middle",
"tooltip": "",
"AllowUnsafeContent": false,
"version": "v2.9.0"
}
```
| Field | Values / Notes |
|---|---|
| `HtmlText` | Static text or HTML markup shown when `Template` is empty. Rendered directly as HTML. |
| `Data` | Optional data source binding (`{ "_dashboardsType": "data", "value": "" }`). When set, the component subscribes to row changes and the first row is exposed to `Template`. |
| `Template` | Handlebars template string. References data columns via `{{this.0.columnName}}` and ViewStates via `{{vsName}}`. Overrides `HtmlText` when non-empty. |
| `FontSize` | String (default `"13"`). Font size in px applied to the tile. |
| `horizontal` | `"Left"` \| `"Center"` (default) \| `"Right"` — horizontal alignment of the content block. |
| `vertical` | `"Top"` \| `"Middle"` (default) \| `"Bottom"` — vertical position of the content block. |
| `AllowUnsafeContent` | `true` allows `