AnyLumino
API referenceastryxlayout

TabPanel

Astryx tab list with one child panel shown per tab.

Children can be passed as a list or as a keyed mapping. Mapping keys become stable child keys and default tab titles. Use select_key or selected_index to choose the active tab. A child panel mounts the first time its tab is selected and stays mounted, hidden, afterwards.

Attributes

attributeselected_index
= t.Int(0).tag(sync=True)

Functions

constructor__init__(children=None, *, titles=None, keys=None, selected_index=0, size=None, layout=None, divider=None, gap=2, width=None, height=None, **props) -> None
paramchildrenChildInput
= None

Child widgets or owner objects exposing a widget attribute. Mapping keys become stable child keys.

paramtitlesTitleInput
= None

Tab titles associated with children. Defaults to the child keys.

paramkeysIterable[str] | None
= None

Stable child keys for iterable children.

paramselected_indexint
= 0

Initially selected tab index.

paramsizestr | None
= None

Tab size, "sm", "md", or "lg".

paramlayoutstr | None
= None

"hug" or "fill" tab layout.

paramdividerbool | None
= None

Whether to show the tab-list divider.

paramgapint | float
= 2

Astryx spacing step between the tab list and the panel.

paramwidthint | float | str | None
= None

Panel width.

paramheightint | float | str | None
= None

Panel height.

parampropsAny
= {}

Returns

None
funcselect(index) -> None

Select the tab at index.

paramindexint

Returns

None
funcadd_tab(widget, title=None, *, key=None, select=False) -> None

Append a child as a new tab.

paramwidgetobject
paramtitlestr | None
= None
paramkeystr | None
= None
paramselectbool
= False

Returns

None

On this page