UX Configuration - Common Concepts
Intended Audience:
Technical User
Author:
Fluent Commerce
Changed on:
24 Feb 2026
Overview
Some common types and conventions are used across many component definitions. These items are not directly configurable in the manifest but will often be referenced in other component definitions that use them.Key points
- The Mystique manifest configures icons, cards, and template strings. Icons come from React Icons.
- Cards have common fields, and template strings allow dynamic values. Dynamic attributes (standard, image, component) offer flexibility based on conditions.
- A selection of helper functions are also available to control and transform these values as required, for example, number, logic, i18n, array, date, and string functions.
- Additional options like TextOptions and ImageOptions provide styling choices.
Icons
There are many places where icons can be configured in the Mystique manifest, whether to represent the app itself, different routes, or within component configurations.In most cases, the list of available icons comes from the React Icons library - specifically the Material Design and Font Awesome packages.Card
Many content-centric components are embedded in a card and will, therefore, share some common fields.| Name | Type | Required | Description |
`title` | string | no | Title text of the card |
`highlight` | MystiqueThemeColour / string (hex value) | no | Show a colored highlight above the card to denote status in cases like dashboard cards. |
`width` | "quarter" / "third" / "half" / "two-thirds" / "full" / number (1-12) | no | Define the width of this card on a 12-column grid. You can use the named widths for readability or numbers directly. On mobile devices, all widths will automatically change to 12 for the best responsive experience. The default is "full" and will take up the full width of the containing component. |
Template Strings
Accessing entity attributes by name
In GraphQL, any entity attributes are returned as an array. This can make it difficult to configure a component to show a specific attribute.To help with this, attribute arrays have a`byName` property that allows specific attributes to be directly referenced in template strings.For example, if an Order has a custom attribute `vipStatus`, you can add this attribute to a card or list with the following syntax:`"{{order.attributes.byName.vipStatus}}"`Plugin-specific Template Strings
Some additional templates are available only when certain plugins are loaded.| Name | Body | Description | Examples | Plugin |
| Array functions | ||||
`arrayFieldSum` | body: 0: array of objects 1: JSONPath from the object root to the field to be summed. | Total up values from within an array of objects. Supports summation of elements with zero value. | datasource:`[{price: 1},{price: 2},{price: 3},]``"{{arraySum items 'price'}}" // 6` | OMS |
`getMaxValue` | array of objects | Get the max value from an array of objects | datasource: ![]() `{{getMaxValue` `node.updatedOn}} // '2023-12-12T00:00:00.000Z'` | Inventory |
`getTotalActiveFeeds` | object | Get total active feeds from a query on the Feeds Dashboard | `{{getTotalActiveFeeds inventoryFeeds.edges}}` | Inventory |
| Date functions | ||||
`timeAgo` | date object | Convert a date object or date-formatted string into a relative format:
| `{{timeAgo node.updatedOn}}` | Inventory |
`convertMsToDate` | number | Convert milliseconds to date. | `{{convertMsToDate 1691054160}} // '1970-01-20T13:44:14.160Z'` | Inventory |
`convertISODateToMS` | string | Convert an ISO-formatted date string to milliseconds. | `{{convertISODateToMS '2023-12-12T00:00:00.000Z'}} // 1702339200000` | Inventory |
| Number functions | ||||
`round` | number | Round a number | `{{round 5.4}} // 5` | Inventory |
| String functions | ||||
`compactNumberFormat` | string | Convert a number to a compact format | `{{compactNumberFormat 15000}} // 15k` | Inventory |
Using Contextual Inheritance in Nested Components
Contextual inheritance makes it easy to access and reuse shared data across multiple components. It defines a common structure that holds the current user, their active retailer and location, and other relevant settings. This shared context is automatically available in both visible components (like lists or cards) and invisible parts, like query variables.Template Strings like``{{activeContext.id}}`` can be used anywhere inside component configuration or query definitions. These expressions dynamically resolve to the correct context values without requiring manual input or duplication. It ensures consistency across the page and keeps the logic simple and centralized.Instead of configuring each component separately, the same data can be passed down and used in various ways — for filtering, display, or behavior toggles.Here’s an example of the shared context structure:Dynamic Attribute
Dynamic Attribute is a common convention used when defining key/value type information in the manifest, such as card attributes or table columns.The "value" and "link" fields are both Template Strings (see above), which is how dynamic values can be defined. For example, a table column might be defined as:Standard (or Text) Attribute
| Name | Type | Required | Description |
`type` | `"standard"` (or not present) | no | Choose whether the value should be displayed as text or used to render an image. The default is "standard". |
`label` | `string` | yes | String key of the key/value pair. Used as text labels in `AttributesCard` component and column headers in the List component. Not actually used by DynamicValue. |
`value` | `string` (with templates) | yes | The templatised string is to be transformed into the output value. Has access to DynamicValue context (e.g., GraphQL response data) and any available template helpers (e.g., i18n, date formatters, etc.). |
`link` | `string` (with templates) | no | If present, render the text as a link to the location defined in the "link" value. This also has access to DynamicValue context (e.g., GraphQL response data) and any available template helpers (e.g., i18n, date formatters, etc.). |
`options` | `TextOptions` | no | Type-specific configurations for the Dynamic Attribute |
`condition` | `string` (with templates) | no | If `true`, render the text a link to the location defined in the "link" value. Otherwise, render defaultValue. |
TextOptions
In text-based attributes, a set of optional styles can be applied.Each style option has a`matches` condition, and for each instance of an attribute, the style options are evaluated in order until the first match is found, at which point that style is applied.| Name | Type | Required | Description |
`styles` | `TextStyle[]` | no | Set of styles to apply to this text attribute. |
TextStyleOption
| Name | Type | Required | Description |
`value` | `string` | no | Value to compare matches to. Default is the rendered value of the overall attribute itself. |
`matches` | `string[]` | no | If any of these match the value, apply this style. If empty, treat this as a `default` style (and apply to all). |
`icon` | `IconStyle` | no | Icon and coloring to apply to this attribute. |
`text` | `TextStyle` | no | Text coloring to apply to this attribute. |
IconStyle
| Name | Type | Required | Description |
`name` | `loading`/`string` (icon name) | yes | Name of the icon to show with this text attribute. To show a loading spinner, use `loading`; otherwise, this should be a reference to a supported icon (see Icons above). |
`colour` | `string` | no | Optionally apply a color to the icon. Named theme colors (e.g. `primary` or `secondary`) are recommended, but direct CSS hex values (e.g., `#00FF00`) are also supported.` |
TextStyle
| Name | Type | Required | Description |
`colour` | `string` | no | Optionally apply a color to the text. Named theme colors (e.g. `primary` or `secondary`) are recommended, but direct CSS hex values (e.g., `#00FF00`) are also supported.` |
Sample usage
The following attribute is used to embed a link into a component.Image Attribute
| Name | Type | Required | Description |
`type` | `"image"` | yes | Choose whether the value should be displayed as text or used to render an image. |
`label` | `string` | yes | String key of the key/value pair. Used as text labels in `AttributesCard` component and column headers in the List component. Not actually used by DynamicValue. |
`value` | `string` (with templates) | yes | The templatised string is to be used as the URL for the image. Has access to DynamicValue context (e.g., GraphQL response data) and any available template helpers (e.g., i18n, date formatters, etc). |
`link` | `string` (with templates) | no | If present, render the image as a link to the location defined in the "link" value. This also has access to DynamicValue context (e.g. GraphQL response data) and any template helpers that are available (e.g. i18n, date formatters, etc). |
`options` | `ImageOptions` | no | Type-specific configurations for the Dynamic Attribute |
`condition` | `string` (with templates) | no | If it returns `true`, render an image. Otherwise, render defaultValue.The Condition field can stop an image from displaying if it contains no `src`. |
ImageOptions
| Name | Type | Required | Description |
`height` | `number` | no | Height of the image (width will auto-scale) |
`width` | `number` | no | Width of the image (height will auto-scale) |
`alt` | `string` | no | Alt text of the image |
`noModal` | `boolean` | no | True to prevent the default modal on click of an image |
Sample Usage
Example 1.In the following example:- the first option would be applied when the wave is in
`CREATED`or`PICK`states - the second when the wave has a custom attribute of the value "customValue" but is not in
`CREATED`or`PICK`states (as that would have stopped at the first style) - the third, in any other case
`
`Component Attribute
The component-type attribute allows you to embed components inside of other components that accept DynamicAttributes.Please be aware that not all components will work particularly well in all positions!| Name | Type | Required | Description |
`type` | `"component"` | yes | Choose whether the value should be displayed as text or used to render an image. |
`label` | `string` | yes | String key of the key/value pair. Used as text labels in `AttributesCard` component and column headers in the List component. Not actually used by DynamicValue. |
`value` | `string` | no | Not used in `component` attributes. |
`link` | `string` | no | Not used in `component` attributes. |
`options` | `MystiqueComponentInstance` | no | Component props, as you would define them anywhere else in the manifest. |
`condition` | `string` (with templates) | no | If it returns `true`, render an image. Otherwise, render defaultValue.The Condition field can stop a component from displaying if it contains no data. |
