Heading widget

The heading widget displays a styled text string.

Example

Properties

Property

Description

Data type

context

JSONClosed containing the properties that define the visual appearance of the item, as described in Context properties.

string (JSON)

id

Unique identifier of this widget.

string

level

Heading level, ranging from 1 to 6.

integer

text

Text value displayed as a heading.

string

Context properties

These are the context properties.

Context property

Description

Data type

text

Text color in hex color code.

string (hex color code)

textAlign

Text alignment, which is one of: left | center | right.

enum

textSize

Heading size, in pixels.

Note: Not recommended, because a heading has an intrinsic size.

integer

textStyle

Heading style, which is one of: normal | italic | bold.

Note: Not recommended, because a heading has an intrinsic style.

enum

type Rich-media type, which is always Heading. string

Code sample

var obj = {
    "widgetType": "form",
    "nodes":
    [{
            "id": "widget1",
            "controls": {
                "0": {
                    "type": "Heading",
                    "text": "This is a heading",
                    "level": 2
                },
                "1": {
                    "type": "Heading",
                    "text": "This is a heading",
                    "containerSpace": 5,
                    "level": 4
                },
                "2": {
                    "type": "Heading",
                    "text": "This is a heading",
                    "containerSpace": 20,
                    "context": {
                        "itemBackground": "#D3D3D3",
                        "textAlign": "left",
                        "text": "#0000ff",
                        "itemBorder": "#808080"
                    },
                    "level": 2
                }
            }
        }
    ]
}