HtmlContent component
Overview
The HtmlContent UI component provides the ability to process and render a layout structure or a Magento block directly inside a UI component configuration. Processing and rendering is executed on the server side.
The layout structure inside HtmlContent must contain only one top-level block. The top-level block may contain as many child blocks or containers as required. All blocks inside HtmlContent are integrated into the layout, so external blocks can refer to them and vice verse.
Structure
The HtmlContent UI component comprises the following files:
- JS component: app/code/Magento/Ui/view/base/web/js/form/components/html.js
- template: app/code/Magento/Ui/view/base/web/templates/content/content.html
Configuration options
Extends all uiComponent
configuration.
HtmlContent-specific options:
Option | Description | Type | Default |
---|---|---|---|
additionalClasses |
Sets custom classes to the component's DOM block. | Object | {} |
component |
The path to the component’s JS constructor in terms of RequireJS. | String | Magento_Ui/js/form/components/html |
content |
HTML content to be displayed. | String | '' |
template |
The path to the component’s .html template. |
String | ui/content/content |
visible |
Initial component's visibility. When set to "false", the display: none CSS style is added to the component's DOM block. |
Boolean | true |