Skip to content
GitHub

Text

Text manifests define text values that can be used directly or as children of layouts and cards. They can optionally bind to one or more datasets and support font-size scaling to fit the available space.

This is the smallest well-formed Text: the required value plus the dataset the commentary reads its numbers from.

apiVersion: bino.bi/v1alpha1
kind: Text
metadata:
  name: reportSubtitle
spec:
  dataset: kpi_summary
  value: |
    **H1 2025 Summary**

    Total revenue reached **EUR ${data.kpi_summary[0].ac1}m**, exceeding plan by **+3.6%**.

A single dataset name is the common case; dataset also accepts an array of names or an inline DataSet definition (see Template expressions for how the bound rows are addressed). All attributes are listed in the Attribute Reference below.

Fields:

  • spec.value – required string. Supports Markdown syntax (see below) and template expressions (see below).
  • spec.dataset – optional dataset reference; a single name, an array of names, or an inline DataSet definition.
  • spec.scale – optional scaling mode (see Scaling).
  • spec.selectedStyle – optional name of a ComponentStyle to apply; merged over the _system and _default styles.
  • spec.i18nNamespace – optional i18n namespace for this component's labels; when unset it is inherited from the nearest ancestor that carries one.

The value field accepts Markdown. The Markdown is converted to HTML at build time and the resulting HTML is placed in the bn-text element's value attribute.

Plain strings still work — they are wrapped in a <p> tag automatically.

Bold and italic text:

spec:
  value: "**Revenue** grew by *12%* this quarter"

Links:

spec:
  value: "Source: [World Bank](https://data.worldbank.org)"

Lists:

spec:
  value: |
    Key findings:

    - Revenue up 12%
    - Costs down 3%
    - Net margin improved

Asset images:

You can embed images from Asset manifests using the asset: URL scheme:

spec:
  value: "![Company Logo](asset:brandLogo)"

The asset: prefix is resolved at build time to the actual URL. See the Asset reference for details.

Mixed formatting:

spec:
  value: |
    ### Regional Summary

    | Region | Growth |
    |--------|--------|
    | EMEA   | +8%    |
    | APAC   | +15%   |

    > Data as of Q4 2025
Text component rendering markdown with bold text, bullet lists, and regional performance summary

The value field supports JavaScript template literal syntax for dynamic content. Expressions are evaluated at runtime in the browser with access to bound datasets and translations.

Available variables inside ${...}:

  • data.<datasetName> – the bound dataset rows (array of objects).
  • t('<key>') – looks the key up in the component's i18n namespace (set via i18nNamespace, otherwise inherited from the nearest ancestor carrying one; keys missing there fall back to _system) for the artefact's language; an unknown key renders as the key itself. See the Internationalization reference.
spec:
  dataset: kpi_summary
  value: "Revenue: ${data.kpi_summary[0].ac1}"
spec:
  value: "${t('report.title')}"

Template evaluation is sandboxed — only data and t are accessible. Global objects (window, document, fetch, etc.) are blocked. The HTML output is sanitized against XSS: only safe tags (br, b, i, strong, em, span, p, div, table, a, etc.) and attributes (class, style, href, title, colspan, rowspan) are kept. Event handlers (onclick, onerror, …) and javascript: URIs are stripped.

The scale field controls how the text component scales its font size to fit within the available parent space. Scaling considers both width and height — the tighter constraint wins.

scale valueBehavior
(not set)Auto-scale to fit; emits an AUTO_scale warning with the applied factor
"none"No scaling; emits WARN_overflow warning if content overflows
"auto"Auto-scale to fit, silently (no warning)
"0.5", "0.8", "1.2", …Apply baseFontSize × factor; emits WARN_overflow if content still overflows

Other values (negative or zero factors, non-numeric strings, unrecognized keywords) are rejected by schema validation, so they never reach the renderer.

spec:
  value: "This text will shrink to fit its container"
  scale: auto
spec:
  value: "Fixed 80% size"
  scale: "0.8"
---
apiVersion: bino.bi/v1alpha1
kind: Text
metadata:
  name: mainTitle
spec:
  value: "Sales Overview Report"
---
apiVersion: bino.bi/v1alpha1
kind: LayoutPage
metadata:
  name: sales_layout
spec:
  pageLayout: full
  children:
    - kind: Text
      spec:
        value: "Sales Overview Report"
        scale: auto
AttributeTypeRequiredDefaultDescription
apiVersionstringyesMust be bino.bi/v1alpha1.
kindstringyesMust be Text.
metadata.namestringyesUnique identifier.
metadata.labelsobjectnoKey-value pairs for categorization and constraint matching.
metadata.annotationsobjectnoArbitrary key-value metadata, not used by the system.
metadata.descriptionstringnoFree-form description.
metadata.constraintsarraynoConditional inclusion rules. See Constraints.
AttributeTypeRequiredDefaultDescriptionSample
spec.valuestringyesText content. Supports Markdown syntax and template expressions ${data.<dataset>[0].field} and ${t('key')}.value: "**Revenue** grew by *12%*"
spec.datasetstring, object, or arraynoDataset reference for template interpolation: a DataSet name, an inline DataSet definition, or an array of either. Provided by the withDataset mixin.dataset: kpi_summary
spec.scalestring or numbernoauto-scale with warningFont-size scaling mode. "none": no scaling. "auto": auto-scale silently. A positive number or numeric string (e.g. 0.5, "0.8", 1.2): explicit baseFontSize × factor. When omitted, auto-scales and emits an AUTO_scale warning. See Scaling.scale: auto
spec.selectedStylestringnoName of a ComponentStyle manifest to apply. The effective style merges _system, then _default, then the named style. Maps to the selected-style HTML attribute.selectedStyle: corporate-style
spec.i18nNamespacestringnoI18n namespace for this component's labels; missing keys fall back to _system. Resolved at runtime from the nearest ancestor carrying one (card, page, tree, grid, or the artefact) when not set. Maps to the i18n-namespace HTML attribute.i18nNamespace: audited