Apply Templates

This page explains how to use templates in KX Dashboards to define reusable component structures with dynamic content.

Templates provide a way to reduce repetition and maintain consistent structures by combining a static definition with input-driven customization. Instead of defining a component directly, you can reference a template by name and pass in values through the inputs property.

Key Concepts

  • Template: A property used to reference a named template. The referenced content is inserted into the component at load time, allowing a consistent structure to be reused with different data or configuration. For example the Template property under Data Grid/Tooltip can be used to format the tooltip by referencing a template.

  • Template editor: The template editor supports a comprehensive suite of handlebars expressions.

  • Screenshot

  • Handlebar expressions: These include: arrays, comparisons, dates, math, miscellaneous, numbers, strings, and utilities and provide for rich, in-template data manipulation and rendering. See supported handlebar expressions for the full set.

  • Standard Template: KX Dashboards includes a built-in standard template. This allows developers to provide inputs and reuse the same component structure without needing to define a custom template name.

     

Further Reading