CodeCoupler Costa Components Box
The Box component is the simplest of all and forms the basis for many others. It simply generates
an HTML element and registers it as a box component.
By default, this element is a div, but this can be changed using the tag option. The component
also allows you to set the HTML element's attributes as required.
The style and class attributes can be set separately and respond to changes. Classes and styles
can be modified or added, resulting in immediate updates.
An additional feature allows you to set the inner HTML using a combination of the html and text
options. These options use the function from the @codecoupler/dom-set-html package to set the
final HTML. These options also respond to changes, replacing the inner HTML as soon as they are
modified.
To extend from Box use the finalize method to extend the inner structure of the box element:
Optionen
tag: Stringattributes: Object-
Specify the tag and the attributes of the box element.
html: null | Function(context): (Element | String) | Stringtext: null | Function(context): String | Array<String> | Array<String>-
Set the inner HTML using a combination of the
htmlandtextoptions. These options use the function from the@codecoupler/dom-set-htmlpackage to set the final HTML. style: String | Object | Function | Array<String|Object|Function> | nullclass: String | Function | Array<String|Function> | null-
Set classes and styles . These options use the functions from the
@codecoupler/dom-set-classand@codecoupler/dom-set-stylepackages to set the styles and classes.