Skip to main content

Markdown Text

type: "markdown"

A text formatted as Markdown, shown between the fields. Use it to explain how fields work together, to point to further information, or to warn about a combination of settings. A markdown text isn't a field and has no value.

Properties​

PropertyTypeRestrictionsDescription
typestringRequiredAlways markdown.
textstringRequiredThe text to show, formatted as Markdown.
variantstringinfo or warningHighlights the text as an info (with an info icon) or a warning. Without it, the text is shown on a plain surface.
namestringPattern: ^[\w-]+$Only within the config array: needed to place the text in a layout by its name.
visibleIfCondition-Only shows the text while the condition passes.
hideIfCondition-Hides the text while the condition passes.

Placement​

A markdown text can be used in two places:

  • In the config array, between the fields. Without a layout, it's shown where it's defined. With a layout, give it a name and put the name into the layout like the name of a field. A markdown text without a name in the config array isn't shown when the widget has a layout.
  • In the layout, as a layout element, like a separator. It doesn't need a name there.

The config of a repeater field can contain markdown texts as well.

Example​

A warning that only shows while the user picked a fast update interval, placed by name in a fieldset, and a hint placed directly in the layout:

mobro-widget-config.json
{
"config": [
{
"name": "interval",
"label": "Update interval (ms)",
"type": "number",
"defaultValue": 1000
},
{
"name": "interval_warning",
"type": "markdown",
"variant": "warning",
"text": "Intervals below **250 ms** can slow down the dashboard on older devices.",
"visibleIf": {"field": "interval", "lt": 250}
}
],
"layout": [
{
"type": "markdown",
"variant": "info",
"text": "Pick a metric first, the other settings adapt to its type. See the [documentation](https://example.com/my-widget) for details."
},
{
"type": "fieldset",
"label": "Updates",
"children": ["interval", "interval_warning"]
}
]
}
tip

Keep the texts short. The settings sidebar is narrow, and a few lines of text push the fields below out of view.