Skip to content

part

Displays its children in a block.

The part control is used to group controls in a single element. This allows to show or hide them in one action and be placed as a unique element in a Layout cell.

There is a simplified Markdown syntax to create a part, where the element name is optional:

<| just before the end of the line indicates the beginning of a part element; |> at the beginning of a line indicated the end of the part definition.

Properties

Name Type Default Description
render(★) bool True

If True, this part is visible on the page.
If False, the part is hidden and all its content is not displayed.

partial Partial

A Partial object that holds the content of the dialog. This should not be defined if page is set.

page str

The page name to show as the content of the dialog. This should not be defined if partial is set.

id str

The identifier that will be assigned to the rendered HTML component.

properties dict[str, any]

Bound to a dictionary that contains additional properties for this element.

class_name str

List of CSS class names that will be associated with the generated HTML Element. This class names will be added to the default taipy-<element_type>.

hover_text dynamic(str)

Information that is displayed when the user hovers over this element.

(★)render is the default property for this visual element.

Usage

Grouping controls

Page content

<|
    ...
    <|{Some Content}|>
    ...
|>
<taipy:part>
    ...
    <taipy:text>{Some Content}</taipy:text>
    ...
</taipy:part>

Showing and hiding controls

Page content

<|part|don't render|
    ...
    <|{Some Content}|>
    ...
|>
<taipy:part render="False">
    ...
    <taipy:text>{Some Content}</taipy:text>
    ...
</taipy:part>

If the render property is bound to a Boolean value, the part will show or hide its elements according to the value of the bound variable.

Part with page

The content of the part can be specified as an existing page name using the page property.

Page content

<|part|page=page_name|>
<taipy:part page="page_name"/>

Part with partial

The content of the part can be specified as a Partial instance using the partial property.

Page content

<|part|partial={partial}|>
<taipy:part partial="{partial}" />