Skip to content
GitHub

LayoutCard

LayoutCard manifests describe card-shaped containers that can host charts, tables, and text. They are useful for dashboards and reusable widgets.

LayoutCards in a 2x2 grid showing revenue overview, trend, financial summary, and executive highlights

This is the smallest well-formed LayoutCard: the document envelope plus the fields a usable card sets in practice — a header label and at least one child component.

apiVersion: bino.bi/v1alpha1
kind: LayoutCard
metadata:
  name: revenue_card
spec:
  titleBusinessUnit: "Sales"
  children:
    - kind: ChartTime
      spec:
        dataset: revenue_monthly
        chartTitle: "Monthly revenue"
        chartMode: line
        dateInterval: month

A child is either defined inline with spec, as above, or points at a standalone document with ref — see Referencing standalone cards and Optional references. All attributes are listed in the Attribute Reference below.

Important fields mirror LayoutPage but are scoped to a card:

  • Header: titleImage, titleBusinessUnit, titleScenarios, titleVariances, titleOrder, titleOrderDirection, titleMeasures, titleDateStart, titleDateEnd, titleDateFormat, titleDateLink, titleNamespace, i18nNamespace (which takes precedence over the deprecated titleNamespace). The date fields accept both date (2024-01-01) and datetime (2024-01-01T14:30:00Z) values. titleBusinessUnit supports inline Markdown and inline HTML, including <br /> for an explicit line break — see LayoutPage.
  • Footer: footerText (plain text).
  • Layout: cardLayout, cardCustomTemplate, cardGridGap, cardFitToContent, cardShowBorder.
  • Styling: selectedStyle – optional name of a ComponentStyle to apply to the card frame; merged over the _system and _default styles. Requires a template engine release that forwards selected-style to the inner card element.
  • IBCS rules: ruleset – optional name of a RuleSet applied to the card title; also accepts inherited-page to reuse the surrounding page's rule set. Child components inherit it via ruleset: inherited-closest.
  • Content: children – array of layoutChild objects. A standalone LayoutCard document may leave it empty or omitted while scaffolding (the card-layout-slots-used lint rule warns when a used card does not fill its layout slots); a card defined inline as a child still requires at least one entry.
---
apiVersion: bino.bi/v1alpha1
kind: LayoutCard
metadata:
  name: revenue_card
spec:
  titleBusinessUnit: "Sales"
  titleMeasures:
    - name: "Revenue"
      unit: "mEUR"
  cardLayout: full
  children:
    - kind: ChartTime
      spec:
        dataset: revenue_monthly
        chartTitle: "Monthly revenue"
        type: line
        dateInterval: month
        axisLabelsMode: smart
---
apiVersion: bino.bi/v1alpha1
kind: LayoutPage
metadata:
  name: dashboard_page
spec:
  pageLayout: 2x2
  children:
    - kind: LayoutCard
      spec:
        # embed card spec directly or reference by convention
        titleBusinessUnit: "Sales"
        cardLayout: full
        children:
          - kind: ChartTime
            spec:
              dataset: revenue_monthly
              chartTitle: "Monthly revenue"
              type: line

Use cards to keep layout definitions modular and to reuse card patterns across multiple reports.

You can define LayoutCard as a standalone document and reference it from a LayoutPage using ref. This enables card reuse across multiple pages.

---
apiVersion: bino.bi/v1alpha1
kind: LayoutCard
metadata:
  name: revenue_card
spec:
  titleBusinessUnit: "Sales"
  cardLayout: full
  children:
    - kind: ChartTime
      spec:
        dataset: revenue_monthly
        chartTitle: "Monthly revenue"
        type: line

---
apiVersion: bino.bi/v1alpha1
kind: LayoutPage
metadata:
  name: dashboard_page
spec:
  pageLayout: 2x2
  children:
    - kind: LayoutCard
      ref: revenue_card
    - kind: LayoutCard
      ref: revenue_card
      spec:
        titleBusinessUnit: "Marketing" # Override the business unit

See the LayoutPage reference for more details on ref syntax and override behavior.

LayoutCard children support the same optional field as LayoutPage children. Use it for references that may legitimately be missing:

children:
  - kind: ChartTime
    ref: mainChart           # Required: fails if missing
  - kind: Text
    ref: debugInfo
    optional: true           # Optional: skips gracefully if missing

See the LayoutPage optional references section for details on when to use this field.

LayoutCard children support metadata.constraints just like LayoutPage. Use constraints to conditionally include components based on the artefact's context.

apiVersion: bino.bi/v1alpha1
kind: LayoutCard
metadata:
  name: summary_card
spec:
  cardLayout: split-horizontal
  children:
    # Only in production builds
    - kind: Table
      metadata:
        constraints:
          - labels.env==prod
          - mode==build
      spec:
        dataset: production_metrics

    # Only in preview mode (string format)
    - kind: Text
      metadata:
        constraints:
          - mode==preview
      spec:
        value: "Preview placeholder"

    # Using in operator for multiple environments
    - kind: ChartStructure
      metadata:
        constraints:
          - field: labels.env
            operator: in
            value: [staging, prod]
      spec:
        dataset: metrics

For the full constraint syntax and operators, see Inline child constraints and Constraints and Scoped Names.

A LayoutCard can inherit titleScenarios, titleVariances, titleOrder, and titleOrderDirection from its parent LayoutPage by setting the value to inherited-page. The resolved value is used both in the card's own title and made available to child components.

---
apiVersion: bino.bi/v1alpha1
kind: LayoutPage
metadata:
  name: quarterly_report
spec:
  titleScenarios: ["ac1", "fc1"]
  titleVariances: ["dac1_fc1_pos"]
  titleOrder: ac1
  titleOrderDirection: desc
  pageLayout: 2x2
  children:
    - kind: LayoutCard
      spec:
        titleBusinessUnit: "Sales"
        titleScenarios: inherited-page     # inherits ac1,fc1 from page
        titleVariances: inherited-page     # inherits dac1_fc1_pos from page
        cardLayout: full
        children:
          - kind: Table
            spec:
              dataset: revenue_data
              scenarios: inherited-closest  # resolves from the card
              variances: inherited-closest

Child components inside a card can use inherited-closest to resolve from the nearest card or page, or inherited-page to skip the card and resolve directly from the page. See the ChartStructure inherited props section for details.

AttributeTypeRequiredDefaultDescription
apiVersionstringyesMust be bino.bi/v1alpha1.
kindstringyesMust be LayoutCard.
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.
metadata.paramsarraynoTyped parameters for card reuse, expanded as ${NAME} in the spec when the card is referenced with params. See LayoutPage Parameters.
AttributeTypeRequiredDefaultDescriptionSample
spec.titleImagestringno""Name of an Asset document, or an absolute URL, for the card title image.titleImage: "logo"
spec.titleBusinessUnitstringno""Business unit name in the card header. Supports inline Markdown and HTML.titleBusinessUnit: "Sales"
spec.titleScenariosarray or stringnoScenarios displayed in the card header. Values: ac1-ac4, fc1-fc4, pp1-pp4, pl1-pl4, or inherited-page.titleScenarios: ["ac1", "fc1", "pp1"]
spec.titleVariancesarray or stringnoVariance definitions. Pattern: d<scenarioB>_<scenarioA>_[pos|neg|neu], or inherited-page.titleVariances: ["dpp1_ac1_pos"]
spec.titleOrderstringnocategorySort order for title elements. Values: category, categoryindex, rowgroup, rowgroupindex, ac1-ac4, fc1-fc4, pp1-pp4, pl1-pl4, inherited-page.titleOrder: ac1
spec.titleOrderDirectionstringnoascSort direction. Values: asc, desc, inherited-page.titleOrderDirection: desc
spec.titleMeasuresarray or stringnoMeasures displayed in the card header. Array of {name, unit} objects or JSON string.see below
spec.titleMeasures[].namestringyesMeasure name.name: "Revenue"
spec.titleMeasures[].unitstringyesMeasure unit.unit: "mEUR"
spec.titleDateStartstringnoStart date (ISO 8601 date or datetime).titleDateStart: 2024-01-01
spec.titleDateEndstringnoEnd date (ISO 8601 date or datetime).titleDateEnd: 2024-03-31
spec.titleDateFormatstringnononeDate display format. Values: year, quarter, month, week, day, time, auto, none.titleDateFormat: quarter
spec.titleDateLinkstringnononeDate linking style. Values: avg, interval, cum, start, end, ytd, ytg, mat, none.titleDateLink: interval
spec.titleNamespacestringnoDeprecated: use i18nNamespace. Namespace for title translations only; never applies to children.titleNamespace: _system
spec.i18nNamespacestringnoI18n namespace for the card title and, via inheritance, all children (their own i18nNamespace wins). Takes precedence over titleNamespace.i18nNamespace: audited
AttributeTypeRequiredDefaultDescriptionSample
spec.footerTextstringno""Card footer text.footerText: "Quarterly overview"
AttributeTypeRequiredDefaultDescriptionSample
spec.cardLayoutstringnofullGrid layout preset. Values: full, split-horizontal, split-vertical, 2x2, 3x3, 4x4, 1-over-2, 1-over-3, 2-over-1, 3-over-1, custom-template.cardLayout: split-horizontal
spec.cardCustomTemplatestringno"a b" "c d"CSS grid-template-areas string. Used with cardLayout: custom-template.cardCustomTemplate: '"a b" "c d"'
spec.cardGridGapstringno"0"Gap between grid cells.cardGridGap: "0.5rem"
spec.cardFitToContentbooleannofalseWhen true, the card shrinks to fit its content. When false (default), it stretches to fill its parent. Use false when the card contains auto-scaling components (e.g. unitScaling: auto).cardFitToContent: false
spec.cardShowBorderbooleannotrueDisplay a border around the card.cardShowBorder: true
spec.selectedStylestringnoName of a ComponentStyle manifest to apply. Merged over the _system and _default styles. Maps to the selected-style HTML attribute.selectedStyle: corporate-style
spec.rulesetstringnoName of a RuleSet manifest applied to the card title, or inherited-page to reuse the surrounding page's rule set. Children inherit it via inherited-closest. Maps to the ruleset HTML attribute.ruleset: corporate-rules
AttributeTypeRequiredDefaultDescriptionSample
spec.childrenarraynoChild components rendered in the card slots. A standalone LayoutCard document may omit them while scaffolding (the card-layout-slots-used lint rule warns when a used card does not fill its slots); a card defined inline as a child needs at least one entry.see Card inside a page
spec.children[].kindstringyesComponent type. Values: Text, Table, ChartStructure, ChartTime, ChartScatter, ChartBubble, ChartBullet, Tree, Grid, LayoutCard, Image. Must match the kind of the referenced document when using ref.kind: ChartTime
spec.children[].refstringnoName (metadata.name) of a standalone document used as the base spec. Required when spec is omitted. LayoutPage cannot be referenced.ref: revenue_card
spec.children[].specobjectnoComponent specification. Required for inline children (without ref); with ref, the fields given here override the referenced spec.see Card inside a page
spec.children[].paramsobjectnoParameter values (string map) passed to the referenced document and expanded as ${NAME} in its spec. Only valid together with ref. See Reference with params.params: { REGION: "US" }
spec.children[].optionalbooleannofalseWhen true and the ref is missing, the child is skipped instead of failing. See Optional references.optional: true
spec.children[].metadataobjectnoMetadata for an inline child: name, description, constraints.see Inline child constraints
spec.children[].metadata.namestringnoName for the inline child, used in error messages and for identification.name: revenue_chart
spec.children[].metadata.descriptionstringnoDescription of the child. Documentation only; not rendered.description: "Revenue trend"
spec.children[].metadata.constraintsarraynoConditional inclusion rules for the child. See Inline child constraints.constraints: ["mode==preview"]
spec:
  titleMeasures:
    - name: "Revenue"
      unit: "mEUR"