The HtmlElement component
This component can display a single HTML element in the form, for example a header or an image.
The HtmlElement
does not have a value and therefore it is not part of the submission data.
In addition to the properties and methods listed below, this component inherits properties and methods from the superclass Component
. For example, any HtmlElement component has a label
and hidden
property even though these are not explicitly listed here.
Properties
Name | Description | Datatype | Default |
---|---|---|---|
tag | The HTML tag to use for this element. | String | 'p' |
className | The class name to provide to the HTML element. | String | |
content | The HTML content to place within the element. | String | |
refreshOnChange | Whether or not to refresh the form when a change is detected. | Boolean | False |
attrs | Array of key-value pairs of attributes and their values to assign to the component. See the setAttrs method. | Struct/dict |
Methods
Name | Syntax | Description |
---|---|---|
setAttrs | obj.setAttrs(attrs, values) | Given an array of attribute names and their values, assign a valid struct/dict in the attrs property of the component. |
setLocalImage | obj.setLocalImage(imageFile, alt, options) | Add content to an HtmlElement component for displaying a local image. Input imageFile is an absolute path. alt is an optional value that -when provided- sets the alt attribute of the img element. Use the ScaleToParentWidth name-value pair to have the component scale the image to match the width of the parent container. |
See also
- The 'Html' component allows for setting the HTML content through submission data.
- The
Content
component allows for more elaborate HTML content to be added to the form. - The
StatusIndicator
uses an HtmlElement to display and update a status. - The How to for a piece of example code.