Text

Add text with rich formatting to a Dashboard Studio dashboard.

Text provides a rich text editor on the dashboard canvas that shows formatting changes as you make them. Use Text to add explanatory text, instructions, headings, lists, or links to a dashboard without writing Markdown syntax.

Adding and using a text component

  1. Open a Dashboard Studio dashboard in edit mode.

  2. In the editing toolbar, select Add text and then select the text button.

  3. Select the text box and enter your text.

  4. Select text and use the formatting controls in the Configuration panel to apply formatting.

  5. Use the corner handles to resize the text box, then drag it to position it on the canvas.

Configuration panel options for text

Use the following options to configure a text component.

Visibility

Configure custom visibility conditions if desired. See Specify visibility conditions for panels and other dashboard elements.

Data display

You can include tokens in text content by referencing them between dollar signs (for example, $tokenName$).

In View mode, tokens resolve to their current values.

In Edit mode, enable Preview token values to see the resolved current value while editing. Toggle off to see the token reference instead.

Color and style

Configure these text and layout options:

  • Background color

  • Border color

  • Border width (px)

  • Font family

  • Font size

  • Font color

  • Highlight color

  • Bold, italic, underline, and strikethrough

  • Links

  • Bulleted and numbered lists

  • Clear formatting

  • Horizontal alignment: left, center, right, and justify

  • Vertical alignment: top, middle, and bottom

  • Line spacing

  • Padding (px)

  • Corner radius (px)

Interactions

Select + Add interaction to configure interactions such as linking to a custom URL, setting tokens, or linking to a report. For more details, see Add dashboard interactions.

Source options for text

The source editor supports the following options:

Property Type Default Description
backgroundColor string transparent Specify the visualization background color using a hexadecimal or RGBA value, or transparent.
fontColor string Theme default Specify the text color using a hexadecimal or RGBA value. The default depends on the dashboard theme.
highlightColor string transparent Specify the background color used for selected text.
fontFamily string Splunk Data Sans Specify the font family. Supported values include Splunk Data Sans, Splunk Platform Sans Mono, Arial, Helvetica, Times New Roman, Comic Sans MS, Georgia, Verdana, and Courier New. Choose a font that end users can access.
fontSize string default Specify a font size preset: extraSmall, small, default, large, extraLarge, or custom. Presets range from 10 pixels to 20 pixels.
customFontSize number 14 Specify a custom font size in pixels for the fontSize value custom. The valid range extends from 1 through 200.
bold boolean false Apply bold styling to all text by default.
italic boolean false Apply italic styling to all text by default.
underline boolean false Apply underline styling to all text by default.
strikethrough boolean false Apply strikethrough styling to all text by default.
listType string Not specified Specify the default list type: empty, unordered, or ordered.
horizontalAlignment string left Specify horizontal alignment: left, center, right, or justify.
verticalAlign string top Specify vertical alignment: top, middle, or bottom.
lineHeight number or string 1.5 Specify line height. Interpret a numeric value as a multiplier of the font size.
link string Not specified Specify a URL to make the entire Text content clickable.
border.color string Not specified Specify a border color using a hexadecimal or RGBA value.
border.width number 0 Specify the border width in pixels.
border.style string solid Specify the border style: solid, dashed, dotted, or none.
border.radius number 0 Specify the corner radius in pixels.
padding number or array 8 Specify padding in pixels. Use one number for all sides, an array of two values for vertical and horizontal padding, or an array of four values in top, right, bottom, left order.
richTextContent string <p></p> Specify the HTML content for the Text editor. Inline styles should include only differences from the default text styles.
previewTokenValues boolean false In Edit mode, show resolved token values when true. When false, show token patterns as entered. Tokens resolve in view mode regardless of this setting.

Text example

The following example shows a text component with several formatting options applied.

An image of formatted words that are examples of the available text styles, colors, highlights, font options, and alignment options.

Expand the box to view the complete dashboard definition. The example includes a dropdown that sets the $color$ token used in the text component. You can copy and paste the code into your own instance to see the example at work:

PYTHON
{ 
"visualizations": { 
"viz_QQIw1PLu": { 
"type": "splunk.richtext", 
"options": { 
"richTextContent": "<p><span style=\"color: #00490a; font-size: 24px\"><strong>New Text </strong></span><span style=\"color: #00490a; font-size: 24px\">— everything it can do</span></p><p><span style=\"color: #4ecdc4; font-size: 20px\"><strong>Supports tokens: </strong></span><span style=\"font-size: 18px\">You selected </span><span style=\"color: $color$; font-size: 26px\"><strong>$color$</strong></span><span style=\"font-size: 26px\"> </span><span style=\"font-size: 18px\">from the dropdown above. </span></p><p><span style=\"font-size: 18px\">The token reference updates here as the filter changes.</span></p><p><span style=\"font-size: 18px\"></span></p><ul><li><span style=\"font-size: 18px\"><strong>Text Styles:</strong></span><span style=\"font-size: 18px\"> </span><span style=\"font-size: 18px\"><strong>bold</strong></span><span style=\"font-size: 18px\">, </span><span style=\"font-size: 18px\"><em>italic</em></span><span style=\"font-size: 18px\">, </span><span style=\"font-size: 18px\"><u>underline</u></span><span style=\"font-size: 18px\">, </span><span style=\"font-size: 18px\"><s>strikethrough</s></span><span style=\"font-size: 18px\">, and </span><span style=\"font-size: 18px\"><u><em><strong>all combined</strong></em></u></span><span style=\"font-size: 18px\">.</span></li><li><span style=\"font-size: 18px\"><strong>Text Colors:</strong></span><span style=\"font-size: 18px\"> </span><span style=\"color: #ff6b6b; font-size: 18px\">red</span><span style=\"font-size: 18px\">, </span><span style=\"color: #4ecdc4; font-size: 18px\">teal</span><span style=\"font-size: 18px\">, </span><span style=\"color: #a855f7; font-size: 18px\">purple</span><span style=\"font-size: 18px\">, </span><span style=\"color: #f472b6; font-size: 18px\">pink</span><span style=\"font-size: 18px\">, and </span><span style=\"color: #fbbf24; font-size: 18px\">amber</span><span style=\"font-size: 18px\">.</span></li><li><span style=\"font-size: 18px\"><strong>Highlights:</strong></span><span style=\"font-size: 18px\"> </span><span style=\"color: #000; background-color: #ffd93d; font-size: 18px\"> yellow </span><span style=\"font-size: 18px\">, </span><span style=\"color: #000; background-color: #6bcb77; font-size: 18px\"> green </span><span style=\"font-size: 18px\">, </span><span style=\"color: #fff; background-color: #3b82f6; font-size: 18px\"> blue </span><span style=\"font-size: 18px\">, and </span><span style=\"color: #fff; background-color: #ef4444; font-size: 18px\"> red </span><span style=\"font-size: 18px\">.</span></li><li><span style=\"font-size: 18px\"><strong>Font Families:</strong></span><span style=\"font-size: 18px\"> </span><span style=\"font-size: 18px; font-family: Splunk Data Sans\">Splunk Data Sans</span><span style=\"font-size: 18px\">, </span><span style=\"font-size: 18px; font-family: Arial\">Arial</span><span style=\"font-size: 18px\">, </span><span style=\"font-size: 18px; font-family: Times New Roman\">Times New Roman</span><span style=\"font-size: 18px\">, </span><span style=\"font-size: 18px; font-family: Georgia\">Georgia</span><span style=\"font-size: 18px\">, </span><span style=\"font-size: 18px; font-family: Courier New\">Courier New</span><span style=\"font-size: 18px\">, and </span><span style=\"font-size: 18px; font-family: Comic Sans MS\">Comic Sans MS</span><span style=\"font-size: 18px\">.</span></li><li><span style=\"font-size: 18px\"><strong>Font Sizes:</strong></span><span style=\"font-size: 18px\"> </span><span style=\"font-size: 14px\">10px</span><span style=\"font-size: 18px\">   </span><span style=\"font-size: 16px\">12px</span><span style=\"font-size: 18px\">   14px   </span><span style=\"font-size: 22px\">18px</span><span style=\"font-size: 18px\">   </span><span style=\"font-size: 28px\">24px</span><span style=\"font-size: 18px\">   </span><span style=\"font-size: 36px\">32px</span><span style=\"font-size: 18px\">.</span></li><li><span style=\"font-size: 18px\"><strong>Combinations:</strong></span><span style=\"font-size: 18px\"> </span><span style=\"color: #ff6b6b; font-size: 22px; font-family: Arial\"><strong>Bold Arial 18px red</strong></span><span style=\"font-size: 18px\">, </span><span style=\"color: #1a202c; background-color: #ffd93d; font-size: 20px; font-family: Times New Roman\"><em>Italic Times 16px on yellow</em></span><span style=\"font-size: 18px\">, and </span><span style=\"color: #4ecdc4; font-size: 18px; font-family: Courier New\"><u>Underlined Courier teal</u></span><span style=\"font-size: 18px\">.</span></li><li><span style=\"color: #a855f7; font-size: 18px\"><strong>Alignment!!</strong></span></li></ul><p style=\"text-align: left\"><span style=\"font-size: 18px\">⬅ Left aligned (</span><span style=\"color: #99b100; font-size: 18px\">you can see custom paddings inside</span><span style=\"font-size: 18px\">)</span></p><p style=\"text-align: center\"><span style=\"font-size: 18px\">➡ Center aligned ⬅</span></p><p style=\"text-align: right\"><span style=\"font-size: 18px\">Right aligned ➡</span></p><p style=\"text-align: justify\"><span style=\"font-size: 18px\">Justified text stretches evenly across the full width of the panel so both the left and right edges line up cleanly along the margins for a polished block of copy.</span></p>", 
"border": { 
"radius": 10, 
"color": "#ffffff" 
}, 
"padding": 20, 
"backgroundColor": "#ffffff" 
} 
} 
}, 
"dataSources": {}, 
"defaults": { 
"dataSources": { 
"global": { 
"options": { 
"queryParameters": { 
"latest": "$global_time.latest$", 
"earliest": "$global_time.earliest$" 
} 
} 
} 
} 
}, 
"inputs": { 
"input_UMhSdMxn": { 
"type": "input.dropdown", 
"title": "Color", 
"options": { 
"token": "color", 
"defaultValue": "Teal", 
"items": [ 
{ 
"label": "Teal", 
"value": "Teal" 
}, 
{ 
"label": "Red", 
"value": "Red" 
}, 
{ 
"label": "Purple", 
"value": "Purple" 
}, 
{ 
"label": "Pink", 
"value": "Pink" 
}, 
{ 
"label": "Orange", 
"value": "Orange" 
}, 
{ 
"label": "Blue", 
"value": "Blue" 
} 
] 
}, 
"cornerRadius": [ 
10, 
10, 
10, 
10 
] 
} 
}, 
"layout": { 
"options": { 
"showTitleAndDescription": false 
}, 
"globalInputs": [ 
"input_UMhSdMxn" 
], 
"tabs": { 
"items": [ 
{ 
"layoutId": "layout_DGS2rxNE", 
"label": "New tab" 
} 
] 
}, 
"layoutDefinitions": { 
"layout_DGS2rxNE": { 
"type": "absolute", 
"structure": [ 
{ 
"item": "viz_QQIw1PLu", 
"type": "block", 
"position": { 
"x": 20, 
"y": 20, 
"w": 940, 
"h": 620 
} 
} 
], 
"options": { 
"width": 1440, 
"backgroundColor": "#f2f4f5" 
} 
} 
} 
} 
}

Limitations

  • Formatting applies to the entire token and remains when its value changes. You can format different tokens differently, but you can’t format only part of a token’s resolved value.
  • The text editor does not provide a custom font selector.
  • Content can’t be converted between Markdown and the text component.