Skip to content

expandable class

Displays its child elements in a collapsible area.

Methods

__init__()

__init__(
    title=None,
    expanded=True,
    page=None,
    partial=None,
    id=None,
    properties=None,
    class_name=None,
    hover_text=None,
    on_change=None,
) -> None

Create a new expandable element.

Parameters:

Name Type Description Default

title

str
dynamic

Title of this block element.

None

expanded

bool
dynamic

If True, the block is expanded, and the content is displayed.
If False, the block is collapsed and its content is hidden.

True

page

str

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

None

partial

Partial

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

None

id

str

The identifier that is assigned to the rendered HTML component.

None

properties

dict[str, Any]

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

None

class_name

str
dynamic

The list of CSS class names that are associated with the generated HTML Element.
These class names are added to the default taipy-expandable class name.

None

hover_text

str
dynamic

The information that is displayed when the user hovers over this element.

None

on_change

Union[str, Callable]

A function or the name of a function that is triggered when the value is updated.
This function is invoked with the following parameters:

  • state (State): the state instance.
  • var_name (str): the variable name.
  • value (Any): the new value.
None