Skip to content

taipy.gui.extension.Element

The definition of a custom visual element.

An element is defined by its properties (name, type and default value) and what the default property name is.

__init__(default_property, properties, react_component=None, render_xhtml=None, inner_properties=None)

Initializes a new custom element declaration.

If render_xhtml is specified, then this is a static element, and react_component is ignored.

Parameters:

Name Type Description Default
default_property str

the name of the default property for this element.

required
properties List[ElementProperty]

The list of properties for this element.

required
inner_properties Optional[List[ElementProperty]]

The optional list of inner properties for this element.
Default values are set/binded automatically.

None
react_component Optional[str]

The name of the component to be created on the front-end.
If not specified, it is set to a camel case version of the element's name ("one_name" is transformed to "OneName").

None
render_xhtml Optional[callable[[dict[str, Any]], str]]

A function that receives a dictionary containing the element's properties and their values and that must return a valid XHTML string.

None