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 dynamic(str)

Title of the expandable block.

None
expanded dynamic(bool)

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 assigned to the rendered HTML component.
This can be used in callbacks or to target the element for styling.

None
properties dict[str, Any]

A dictionary of additional properties that can be set to the element.

None
class_name dynamic(str)

A space-separated list of CSS class names to be applied to the generated HTML element.
These classes are added to the default taipy-expandable class.

None
hover_text dynamic(str)

The text that is displayed when the user hovers over the element.

None
on_change Union[str, Callable]

A function or the name of a function that is triggered when the value changes.
The callback function receives the following parameters:

  • state (State): the state instance.
  • var_name (str): the bound variable name.
  • value (Any): the updated value.

None