Skip to content

pane class

A side pane.

Methods

__init__()

__init__(
    open=False,
    on_close=None,
    anchor="left",
    persistent=False,
    width="30vw",
    height="30vh",
    show_button=False,
    page=None,
    partial=None,
    on_change=None,
    active=True,
    id=None,
    properties=None,
    class_name=None,
    hover_text=None,
) -> None

Create a new pane element.

Parameters:

Name Type Description Default
open dynamic(bool)

If True, this pane is visible on the page.
If False, the pane is hidden.

False
on_close Union[str, Callable]

A function or the name of a function that is triggered when this pane is closed (if the user clicks outside of it or presses the Esc key).
This function is invoked with the following parameters:

  • state (State): the state instance.
  • id (Optional[str]): the identifier of the close button if it has one.

If this property is not set, no function is called when this pane is closed.

None
anchor str

Anchor side of the pane.
Valid values are "left", "right", "top", or "bottom".

left
persistent bool

If False, the pane covers the page where it appeared and disappears if the user clicks in the page.
If True, the pane appears next to the page. Note that the parent section of the pane must have the flex display mode set. See below for an example using the persistent property.

False
width str

Width of the pane, in CSS units.
This is used only if anchor is "left" or "right".

30vw
height str

Height of this pane, in CSS units.
This is used only if anchor is "top" or "bottom".

30vh
show_button bool

If True and when the pane is closed, a button allowing the pane to be opened is shown.

False
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
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
active dynamic(bool)

Indicates if this element is active.
If False, the element is disabled, and user interaction is not allowed.

True
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-pane class.

None
hover_text dynamic(str)

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

None