Skip to content
GitHub

ComponentStyle

ComponentStyle manifests capture styling information for components. They allow you to centralize typography, colors, spacing, and other visual rules.

This is the smallest well-formed ComponentStyle: the required spec.content with the base typography that almost every style block overrides.

apiVersion: bino.bi/v1alpha1
kind: ComponentStyle
metadata:
  name: corporateTheme
spec:
  content:
    global:
      fontSizePx: 14
      fontFamily: "'Inter', sans-serif"

spec.content can also be written as a JSON string instead of a YAML object, which is useful when copying from front-end configuration — see JSON string style. All attributes are listed in the Attribute Reference below.

The metadata.name of a ComponentStyle decides how it is applied:

  • _default – applied to all components automatically.
  • Any other name (e.g. corporateTheme) – a named style that individual components opt into via spec.selectedStyle.

At render time each component merges style layers in this order (later wins): built-in _system defaults → _default → the style named by selectedStyle.

---
apiVersion: bino.bi/v1alpha1
kind: ComponentStyle
metadata:
  name: corporateTheme
spec:
  content:
    global:
      fontFamily: "'Inter', sans-serif"
      fontSizePx: 11
---
apiVersion: bino.bi/v1alpha1
kind: Table
metadata:
  name: revenue_table
spec:
  dataset: revenue_by_customer
  selectedStyle: corporateTheme

selectedStyle is available on ReportArtefact, Table, Text, ChartStructure, ChartTime, ChartScatter, ChartBubble, ChartBullet, Tree, Grid, Image (as inline child), LayoutPage, and LayoutCard. It is emitted as the selected-style HTML attribute on the corresponding bn-* element. For LayoutPage and LayoutCard it takes effect with a template engine release that forwards selected-style to the inner page/card element.

A selectedStyle set on a container becomes the default for everything inside it. The nearest ancestor wins:

component's own selectedStyle
  > enclosing Grid / Tree / LayoutCard
  > LayoutPage
  > ReportArtefact

Set it once on the ReportArtefact and every page and component in that artefact uses it — unless a page, card, grid, tree, or leaf component sets its own selectedStyle, which then applies to that element and its descendants. Tree Label nodes inherit the style too (they cannot set their own).

To exclude a single component from inheritance, set selectedStyle: "" explicitly — it falls back to _system + _default styling.

Inheritance is resolved at build time per artefact. bino preview shows the artefact-level style only when previewing through an artefact; the plain all-pages preview has no artefact context (page-level inheritance still applies).

The style object has the following top-level sections:

SectionDescription
globalGlobal typography and color settings applied to all components
bn-textStyle settings for text components (extensible)
bn-chart-timeStyle settings for time/column charts
bn-chart-structureStyle settings for structure/bar charts
bn-treeStyle settings for hierarchical tree diagrams
bn-gridStyle settings for grid layouts with row/column headers (not part of the schema, see below)

The style object accepts additional keys beyond these sections, so unknown or misspelled style keys pass validation without a diagnostic.


Global settings are inherited by all components.

PropertyTypeDefaultDescription
fontSizePxnumber13.3333Base font size in pixels. Scale factors multiply this value.
fontFamilystring'Noto Sans', sans-serifCSS font-family value
fontColorstring#000000Primary text color (CSS color)
fontBackgroundColorstring#ffffffBackground color for text elements (CSS color)
global:
  fontSizePx: 14
  fontFamily: "'Inter', sans-serif"
  fontColor: "#1a1a1a"
  fontBackgroundColor: "#ffffff"

Reserved for future text component styling. Currently accepts any properties.


Style settings for vertical column charts (time series visualizations).

PropertyTypeDescription
scaleFactorsobjectScale factors for element sizing
axisStylesobjectSVG styles for axis elements by scenario
barStylesobjectSVG styles for bar/column elements by scenario
varianceStylesobjectSVG styles for variance indicators
stackColorsstring[]Ordered CSS colors for stacked segments (default: ["#000000", "#c0c0c0", "#808080"])
paddingobjectPadding around the chart area

All scale factors are multiplied by global.fontSizePx to calculate pixel values.

PropertyDefaultDescription
scenarioOffset0.3Horizontal offset between scenario bars
scenarioLabelToColumn0.3Gap between scenario label and column
labelToColumn0.3Gap between category label and column
labelToAxis0.3Gap between label and axis
needleWidth0.3Width of needle indicators
needleHeadWidth0.6Width of needle head (arrow)
columnWidth2.0Width of data columns
varianceAxisLineWidth0.3Width of variance axis lines
axisLineWidth0.1Width of main axis lines
auxiliaryLineWidth0.1Width of auxiliary/grid lines
scenarioLineWidth0.2Width of scenario indicator lines
markerWidth0.7Width of data point markers
markerOffset0.0Offset of markers from data points
categoryWidth3.0Width allocated per category
axisTickLength0.3Length of axis tick marks

Structure chart style (bn-chart-structure)

Section titled “Structure chart style (bn-chart-structure)”

Style settings for horizontal bar charts (structure visualizations).

PropertyTypeDescription
scaleFactorsobjectScale factors for element sizing
axisStylesobjectSVG styles for axis elements by scenario
barStylesobjectSVG styles for bar elements by scenario
varianceStylesobjectSVG styles for variance indicators
stackColorsstring[]Ordered CSS colors for stacked segments (default: ["#000000", "#c0c0c0", "#808080"])
paddingobjectPadding around the chart area

All scale factors are multiplied by global.fontSizePx to calculate pixel values.

PropertyDefaultDescription
scenarioOffset0.3Vertical offset between scenario bars
scenarioLabelToBar0.1Gap between scenario label and bar
labelToBar0.3Gap between category label and bar
labelToAxis0.3Gap between label and axis
needleWidth0.3Width of needle indicators
needleHeadWidth0.6Width of needle head (arrow)
barWidth1.2Height of horizontal bars
varianceAxisLineWidth0.3Width of variance axis lines
axisLineWidth0.1Width of main axis lines
auxiliaryLineWidth0.1Width of auxiliary/grid lines
scenarioLineWidth0.2Width of scenario indicator lines
markerWidth0.7Width of data point markers
markerOffset0.0Offset of markers from data points
categoryWidth1.9Height allocated per category row
axisTickLength0.3Length of axis tick marks

Style settings for hierarchical tree diagrams.

PropertyTypeDefaultDescription
edgeColorstring#404040Color for tree edges/connections (CSS color)
edgeWidthnumber1Width of tree edges in pixels
operatorCircleRadiusnumber10Radius of operator node circles in pixels
operatorFontSizeScalenumber0.9Scale factor for operator font size relative to global.fontSizePx
operatorColorstring#404040Color for operator nodes (CSS color)
bn-tree:
  edgeColor: "#606060"
  edgeWidth: 2
  operatorCircleRadius: 12
  operatorFontSizeScale: 0.85
  operatorColor: "#333333"

Style settings for grid layouts with row and column headers.

This section is not described by the manifest schema. It is accepted because the style object allows extra keys, so its properties and defaults are not validated and a typo in a key stays silent.

PropertyTypeDefaultDescription
headerBackgroundstring"transparent"Background color for row and column headers (CSS color)
borderColorstring"#A6A6A6"Color of cell border/divider lines (CSS color)
borderWidthnumber1Width of cell borders in pixels
cellPaddingnumber4Padding inside cells in pixels
bn-grid:
  headerBackground: "#f0f0f0"
  borderColor: "#cccccc"
  borderWidth: 1
  cellPadding: 8

Both axisStyles and barStyles use scenario-based grouping following IBCS notation:

KeyDescription
acStyle for Actual values
fcStyle for Forecast values
ppStyle for Prior Period values
plStyle for Plan values

Each scenario key contains an SVG style object. Further scenario keys are allowed and take the same SVG style object.


The varianceStyles property groups styles by variance direction:

KeyDescription
posStyle for positive variances (favorable)
negStyle for negative variances (unfavorable)
neuStyle for neutral/zero variances

Further variance keys are allowed and take the same SVG style object.


Individual SVG style properties:

PropertyTypeDescription
strokestringSVG stroke color (CSS color)
fillstringSVG fill color (CSS color)
widthnumberStroke width in pixels
dasharraystringSVG stroke-dasharray pattern (e.g., "10 5 5 5" for dashed lines)
fillpatternstringReference to a fill pattern (e.g., "fc" for forecast hatching)
axisStyles:
  ac: { stroke: "#121212", fill: "#121212", width: 0.1 }
  fc: { stroke: "#121212", fill: "#ffffff", width: 0.1, dasharray: "10 5 5 5" }
  pp: { stroke: "#606060", fill: "#606060", width: 0.1 }
  pl: { stroke: "#121212", fill: "#ffffff", width: 0.1 }

Padding configuration for chart areas:

PropertyTypeDefaultDescription
topnumber10Top padding in pixels
leftnumber10Left padding in pixels
rightnumber10Right padding in pixels
bottomnumber10Bottom padding in pixels

---
apiVersion: bino.bi/v1alpha1
kind: ComponentStyle
metadata:
  name: corporateTheme
spec:
  content:
    global:
      fontSizePx: 14
      fontFamily: "'Inter', sans-serif"
      fontColor: "#1a1a1a"
      fontBackgroundColor: "#ffffff"

    bn-chart-time:
      scaleFactors:
        columnWidth: 2.5
        categoryWidth: 3.5
      axisStyles:
        ac: { stroke: "#000000", fill: "#000000", width: 0.1 }
        fc: { stroke: "#000000", fill: "#ffffff", width: 0.1, dasharray: "10 5 5 5" }
        pp: { stroke: "#666666", fill: "#666666", width: 0.1 }
        pl: { stroke: "#000000", fill: "#ffffff", width: 0.1 }
      barStyles:
        ac: { stroke: "#333333", fill: "#333333", width: 0.1 }
        fc: { stroke: "#333333", fill: "#ffffff", width: 0.5, fillpattern: "fc" }
        pp: { stroke: "#999999", fill: "#999999", width: 0.1 }
        pl: { stroke: "#333333", fill: "#ffffff", width: 0.1 }
      varianceStyles:
        pos: { stroke: "#008f96", fill: "#008f96", width: 0.1 }
        neg: { stroke: "#ff0000", fill: "#ff0000", width: 0.1 }
        neu: { stroke: "#808080", fill: "#808080", width: 0.1 }
      stackColors: ["#000000", "#c0c0c0", "#808080"]
      padding:
        top: 15
        left: 15
        right: 15
        bottom: 15

    bn-chart-structure:
      scaleFactors:
        barWidth: 1.5
        categoryWidth: 2.0
      axisStyles:
        ac: { stroke: "#000000", fill: "#000000", width: 0.1 }
        fc: { stroke: "#000000", fill: "#ffffff", width: 0.1, dasharray: "10 5 5 5" }
        pp: { stroke: "#666666", fill: "#666666", width: 0.1 }
        pl: { stroke: "#000000", fill: "#ffffff", width: 0.1 }
      barStyles:
        ac: { stroke: "#333333", fill: "#333333", width: 0.1 }
        fc: { stroke: "#333333", fill: "#ffffff", width: 0.5, fillpattern: "fc" }
        pp: { stroke: "#999999", fill: "#999999", width: 0.1 }
        pl: { stroke: "#333333", fill: "#ffffff", width: 0.1 }
      varianceStyles:
        pos: { stroke: "#008f96", fill: "#008f96", width: 0.1 }
        neg: { stroke: "#ff0000", fill: "#ff0000", width: 0.1 }
        neu: { stroke: "#808080", fill: "#808080", width: 0.1 }
      stackColors: ["#000000", "#c0c0c0", "#808080"]

    bn-tree:
      edgeColor: "#505050"
      edgeWidth: 1.5
      operatorCircleRadius: 12
      operatorFontSizeScale: 0.85
      operatorColor: "#404040"

    bn-grid:
      headerBackground: "#f5f5f5"
      borderColor: "#cccccc"
      borderWidth: 1
      cellPadding: 8

You can also provide the content as a JSON string:

---
apiVersion: bino.bi/v1alpha1
kind: ComponentStyle
metadata:
  name: compactStyle
spec:
  content: >-
    {"global":{"fontSizePx":12,"fontFamily":"'Roboto', sans-serif"}}
AttributeTypeRequiredDefaultDescription
apiVersionstringyesMust be bino.bi/v1alpha1.
kindstringyesMust be ComponentStyle.
metadata.namestringyesUnique style identifier. Use _default for global defaults.
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.contentobject or stringyesStyle definitions as a YAML object or a JSON string (at least 2 characters). Contains the component-specific style sections below; unknown keys are accepted.content: '{"global":{"fontSizePx":12}}'
spec.content.globalobjectnoGlobal typography and color settings, inherited by all components. See Global style.global: { fontSizePx: 14 }
spec.content.bn-textobjectnoStyle settings for text components. Reserved for future use, accepts any properties. See Text style.bn-text: {}
spec.content.bn-chart-timeobjectnoStyle settings for time/column charts: scaleFactors, axisStyles, barStyles, varianceStyles, stackColors, padding. See Time chart style.bn-chart-time: { scaleFactors: { columnWidth: 2.5 } }
spec.content.bn-chart-structureobjectnoStyle settings for structure/bar charts: scaleFactors, axisStyles, barStyles, varianceStyles, stackColors, padding. See Structure chart style.bn-chart-structure: { scaleFactors: { barWidth: 1.5 } }
spec.content.bn-treeobjectnoStyle settings for hierarchical tree diagrams. See Tree chart style.bn-tree: { edgeColor: "#606060" }
spec.content.bn-gridobjectnoStyle settings for grid layouts. Not described by the schema, so it is neither validated nor completed. See Grid style.bn-grid: { cellPadding: 8 }

Components reference a named style through their own spec.selectedStyle attribute; see Using named styles.

Both bn-chart-time and bn-chart-structure take the same properties.

AttributeTypeRequiredDefaultDescriptionSample
scaleFactorsobjectnoper propertyScale factors for element sizing, multiplied by global.fontSizePx. Defaults differ per chart: see time chart and structure chart.scaleFactors: { columnWidth: 2.5 }
axisStylesobjectnoSVG styles for axis elements, keyed by scenario. See SVG style group.axisStyles: { ac: { stroke: "#000000" } }
barStylesobjectnoSVG styles for bar/column elements, keyed by scenario. See SVG style group.barStyles: { ac: { fill: "#333333" } }
varianceStylesobjectnoSVG styles for variance indicators, keyed by direction. See SVG variance style group.varianceStyles: { neg: { fill: "#ff0000" } }
stackColorsarray of stringsno["#000000", "#c0c0c0", "#808080"]Ordered CSS colors for stacked segments. Segments cycle through these colors.stackColors: ["#000000", "#c0c0c0"]
paddingobjectno10 per sidePadding around the chart area. See Padding.padding: { top: 15 }
PropertyTypeDefaultDescription
global.fontSizePxnumber13.3333Base font size in pixels. Scale factors multiply this value.
global.fontFamilystring'Noto Sans', sans-serifCSS font-family value.
global.fontColorstring#000000Primary text color (CSS color).
global.fontBackgroundColorstring#ffffffBackground color for text elements (CSS color).