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

bool
dynamic

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, in CSS units, of this pane.
This is used only if anchor is "left" or "right".

30vw

height

str

Height, in CSS units, of this pane.
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 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

active

bool
dynamic

Indicates if this component is active.
An inactive component allows no user interaction.

True

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

None

hover_text

str
dynamic

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

None