AnyLumino
API referencelayout

TabPanel

Lumino tab container for composing child widgets.

Children can be passed as a list or as a keyed mapping. Mapping keys become stable child identifiers and default tab titles. Use select_key or selected_index to choose the active tab.

Attributes

attributeselected_index
= t.Int(0).tag(sync=True)
attributetab_placement
= t.Enum(TAB_PLACEMENTS, default_value='top').tag(sync=True)
attributetabs_movable
= t.Bool(False).tag(sync=True)

Functions

constructor__init__(widgets=None, *, titles=None, keys=None, selected_index=0, tab_placement='top', tabs_movable=False, width='100%', height=420, resizable=True, fit_content=False) -> None
paramwidgetsChildInput
= None

Child anywidget-compatible widgets or owner objects exposing a widget attribute. When a mapping is passed, its keys become stable child keys.

paramtitlesTitleInput
= None

Tab titles. A mapping is resolved by child key. When widgets is a mapping and titles are omitted, keys are used as titles.

paramkeysIterable[str] | None
= None

Stable child keys for iterable widgets. Do not pass this when widgets is a mapping.

paramselected_indexint
= 0

Initially selected tab index.

paramtab_placementstr
= 'top'

Where Lumino should place the tab bar.

paramtabs_movablebool
= False

Whether tabs can be reordered in the frontend. A drag reorders widgets, child_keys, and titles in Python too, so selected_key keeps naming the visible child.

paramwidthint | float | str | None
= '100%'

Widget width. Numbers above 1 are pixels, numbers between 0 and 1 are percentages, and strings are passed through as CSS sizes.

paramheightint | float | str | None
= 420

Widget height. Numbers above 1 are pixels, numbers between 0 and 1 are percentages, and strings are passed through as CSS sizes.

paramresizablebool
= True

Whether the panel receives a notebook-friendly resize handle.

paramfit_contentbool
= False

Whether the panel height follows the tab bar and the selected tab's content, with a 180 pixel minimum, instead of height.

Returns

None
funcselect(index) -> None
paramindexint

Returns

None
funcadd_tab(widget, title=None, *, key=None, select=False) -> None
paramwidgetobject
paramtitlestr | None
= None
paramkeystr | None
= None
paramselectbool
= False

Returns

None

On this page