> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/workflows/blocks/blocks/visualize-predictions/text-display.md).

# Text Display

The **Text Display** block renders text on an image with full control over styling and positioning.

### Dynamic Text Content

Text content can be parameterized with workflow execution outcomes using the same templating syntax as Email and SMS notification blocks:

```
text = "Detected {{ $parameters.count }} objects of class {{ $parameters.class_name }}"
```

Parameters are provided via the `text_parameters` field:

```
text_parameters = {
    "count": "$steps.model.predictions",
    "class_name": "$inputs.target_class"
}
```

You can apply transformations to parameters using `text_parameters_operations`:

```
text_parameters_operations = {
    "count": [{"type": "SequenceLength"}]
}
```

### Styling Options

* **text\_color**: Color of the text. Supports:
  * Supervision color names (uppercase): "WHITE", "BLACK", "RED", "GREEN", "BLUE", "YELLOW", "ROBOFLOW", etc.
  * Hex format: "#RRGGBB" (e.g., "#FF0000" for red)
  * RGB format: "rgb(R, G, B)" (e.g., "rgb(255, 0, 0)" for red)
  * BGR format: "bgr(B, G, R)" (e.g., "bgr(0, 0, 255)" for red)
* **background\_color**: Background color behind the text. Supports the same color formats as `text_color`. Use "transparent" for no background.
* **background\_opacity**: Transparency of the background (0.0 = fully transparent, 1.0 = fully opaque)
* **font\_scale**: Scale factor for the font size
* **font\_thickness**: Thickness of the text strokes
* **padding**: Padding around the text in pixels
* **text\_align**: Horizontal text alignment ("left", "center", "right")
* **border\_radius**: Radius for rounded corners on the background

### Positioning Options

The block supports both absolute and relative positioning:

**Absolute Positioning** (`position_mode = "absolute"`):

* `position_x`: X coordinate in pixels from the left edge
* `position_y`: Y coordinate in pixels from the top edge

**Relative Positioning** (`position_mode = "relative"`):

* `anchor`: Where to anchor the text ("center", "top\_left", "top\_center", "top\_right", "bottom\_left", "bottom\_center", "bottom\_right", "center\_left", "center\_right")
* `offset_x`: Horizontal offset from the anchor point (positive = right)
* `offset_y`: Vertical offset from the anchor point (positive = down)

### Type identifier

Use the following identifier in step `"type"` field: `roboflow_core/text_display@v1` to add the block as a step in your workflow.

### Properties

| **Name**                     | **Type**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | **Description**                                                                                                                                                               | Refs |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- |
| `name`                       | `str`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Enter a unique identifier for this step..                                                                                                                                     | ❌    |
| `text`                       | `str`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | The text content to display. Supports parameter interpolation using `{{ $parameters.name }}` syntax..                                                                         | ❌    |
| `text_parameters`            | `Dict[str, Union[bool, float, int, str]]`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | Parameters to interpolate into the text..                                                                                                                                     | ✅    |
| `text_parameters_operations` | `Dict[str, List[Union[ClassificationPropertyExtract, ConvertDictionaryToJSON, ConvertImageToBase64, ConvertImageToJPEG, DetectionsFilter, DetectionsOffset, DetectionsPropertyExtract, DetectionsRename, DetectionsSelection, DetectionsShift, DetectionsToDictionary, Divide, ExtractDetectionProperty, ExtractFrameMetadata, ExtractImageProperty, LookupTable, Multiply, NumberRound, NumericSequenceAggregate, PickDetectionsByParentClass, RandomNumber, SequenceAggregate, SequenceApply, SequenceElementsCount, SequenceLength, SequenceMap, SortDetections, StringMatches, StringSubSequence, StringToLowerCase, StringToUpperCase, TimestampToISOFormat, ToBoolean, ToNumber, ToString]]]` | Operations to apply to text parameters before interpolation..                                                                                                                 | ❌    |
| `text_color`                 | `str`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Color of the text. Supports supervision color names (WHITE, BLACK, RED, GREEN, BLUE, YELLOW, ROBOFLOW, etc.), hex format (#RRGGBB), rgb(R,G,B) format, or bgr(B,G,R) format.. | ✅    |
| `background_color`           | `str`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Background color behind the text. Supports the same color formats as text\_color. Use 'transparent' for no background..                                                       | ✅    |
| `background_opacity`         | `float`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Opacity of the background (0.0 = fully transparent, 1.0 = fully opaque)..                                                                                                     | ✅    |
| `font_scale`                 | `float`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Scale factor for the font size..                                                                                                                                              | ✅    |
| `font_thickness`             | `int`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Thickness of the text strokes..                                                                                                                                               | ✅    |
| `padding`                    | `int`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Padding around the text in pixels..                                                                                                                                           | ✅    |
| `text_align`                 | `str`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Horizontal alignment of the text within its bounding box..                                                                                                                    | ✅    |
| `border_radius`              | `int`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Radius for rounded corners on the background rectangle..                                                                                                                      | ✅    |
| `position_mode`              | `str`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Positioning mode: 'absolute' uses exact pixel coordinates, 'relative' uses anchor points with offsets..                                                                       | ✅    |
| `position_x`                 | `int`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | X coordinate (pixels from left edge) when using absolute positioning..                                                                                                        | ✅    |
| `position_y`                 | `int`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Y coordinate (pixels from top edge) when using absolute positioning..                                                                                                         | ✅    |
| `anchor`                     | `str`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Anchor point for relative positioning..                                                                                                                                       | ✅    |
| `offset_x`                   | `int`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Horizontal offset from anchor point (positive = right)..                                                                                                                      | ✅    |
| `offset_y`                   | `int`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Vertical offset from anchor point (positive = down)..                                                                                                                         | ✅    |
| `copy_image`                 | `bool`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Whether to copy the input image before drawing (preserves original)..                                                                                                         | ✅    |

The **Refs** column marks possibility to parametrise the property with dynamic values available in `workflow` runtime. See *Bindings* for more info.

### Input and Output Bindings

The available connections depend on its binding kinds. Check what binding kinds `Text Display` in version `v1` has.

<details>

<summary>Input and output bindings</summary>

* input
  * `image` ([*`image`*](/workflows/developer-guide/developer-guide/kinds/image.md)): The image to display text on..
  * `text_parameters` ([*`*`*](/workflows/developer-guide/developer-guide/kinds/wildcard.md)): Parameters to interpolate into the text..
  * `text_color` ([*`string`*](/workflows/developer-guide/developer-guide/kinds/string.md)): Color of the text. Supports supervision color names (WHITE, BLACK, RED, GREEN, BLUE, YELLOW, ROBOFLOW, etc.), hex format (#RRGGBB), rgb(R,G,B) format, or bgr(B,G,R) format..
  * `background_color` ([*`string`*](/workflows/developer-guide/developer-guide/kinds/string.md)): Background color behind the text. Supports the same color formats as text\_color. Use 'transparent' for no background..
  * `background_opacity` ([*`float_zero_to_one`*](/workflows/developer-guide/developer-guide/kinds/float-zero-to-one.md)): Opacity of the background (0.0 = fully transparent, 1.0 = fully opaque)..
  * `font_scale` ([*`float`*](/workflows/developer-guide/developer-guide/kinds/float.md)): Scale factor for the font size..
  * `font_thickness` ([*`integer`*](/workflows/developer-guide/developer-guide/kinds/integer.md)): Thickness of the text strokes..
  * `padding` ([*`integer`*](/workflows/developer-guide/developer-guide/kinds/integer.md)): Padding around the text in pixels..
  * `text_align` ([*`string`*](/workflows/developer-guide/developer-guide/kinds/string.md)): Horizontal alignment of the text within its bounding box..
  * `border_radius` ([*`integer`*](/workflows/developer-guide/developer-guide/kinds/integer.md)): Radius for rounded corners on the background rectangle..
  * `position_mode` ([*`string`*](/workflows/developer-guide/developer-guide/kinds/string.md)): Positioning mode: 'absolute' uses exact pixel coordinates, 'relative' uses anchor points with offsets..
  * `position_x` ([*`integer`*](/workflows/developer-guide/developer-guide/kinds/integer.md)): X coordinate (pixels from left edge) when using absolute positioning..
  * `position_y` ([*`integer`*](/workflows/developer-guide/developer-guide/kinds/integer.md)): Y coordinate (pixels from top edge) when using absolute positioning..
  * `anchor` ([*`string`*](/workflows/developer-guide/developer-guide/kinds/string.md)): Anchor point for relative positioning..
  * `offset_x` ([*`integer`*](/workflows/developer-guide/developer-guide/kinds/integer.md)): Horizontal offset from anchor point (positive = right)..
  * `offset_y` ([*`integer`*](/workflows/developer-guide/developer-guide/kinds/integer.md)): Vertical offset from anchor point (positive = down)..
  * `copy_image` ([*`boolean`*](/workflows/developer-guide/developer-guide/kinds/boolean.md)): Whether to copy the input image before drawing (preserves original)..
* output
  * `image` ([`image`](/workflows/developer-guide/developer-guide/kinds/image.md)): Image in workflows.

</details>

<details>

<summary>Example JSON definition</summary>

```json
{
	    "name": "<your_step_name_here>",
	    "type": "roboflow_core/text_display@v1",
	    "image": "$inputs.image",
	    "text": "Detection count: {{ $parameters.count }}",
	    "text_parameters": {
	        "class_name": "$inputs.target_class",
	        "count": "$steps.model.predictions"
	    },
	    "text_parameters_operations": {
	        "count": [
	            {
	                "type": "SequenceLength"
	            }
	        ]
	    },
	    "text_color": "WHITE",
	    "background_color": "BLACK",
	    "background_opacity": 1.0,
	    "font_scale": 1.0,
	    "font_thickness": 1,
	    "padding": 5,
	    "text_align": "left",
	    "border_radius": 0,
	    "position_mode": "absolute",
	    "position_x": 10,
	    "position_y": 10,
	    "anchor": "center",
	    "offset_x": 0,
	    "offset_y": 0,
	    "copy_image": true
	}
```

</details>
