AnyLumino
API referencelayout

BoxPanel

Lumino box layout with configurable direction, spacing, and stretch.

HBox and VBox are direction-specific convenience subclasses. Set scroll=True to enable scrolling along the natural box direction, or use scroll_x and scroll_y for explicit overflow behavior.

Notes

A scrolling panel establishes an overflow boundary. Hosts that cap output height, such as VS Code notebooks, then show a scrollbar inside a scrollbar, and children that position popups within their own subtree are clipped at that boundary. Set fit_content=True instead when the panel should grow to its content rather than scroll.

Attributes

attributelayout_kind
= t.Unicode('box').tag(sync=True)
attributedirection
= t.Enum(BOX_DIRECTIONS, default_value='left-to-right').tag(sync=True)
attributespacing
= t.Int(8).tag(sync=True)
attributestretches
= t.List(t.Int(), default_value=[]).tag(sync=True)

Functions

constructor__init__(widgets=None, *, titles=None, keys=None, direction='left-to-right', spacing=8, stretches=None, width='100%', height=420, resizable=True, scroll=False, scroll_x=None, scroll_y=None, child_min_width=None, child_min_height=None, fit_content=False) -> None
paramwidgetsChildInput
= None

Child anywidget-compatible widgets or owner objects exposing a widget attribute. Mapping keys become stable child keys and default titles.

paramtitlesTitleInput
= None

Optional labels associated with children. Mapping values are looked up by child key.

paramkeysIterable[str] | None
= None

Stable child keys for iterable widgets.

paramdirectionstr
= 'left-to-right'

Lumino box direction.

paramspacingint
= 8

Pixel spacing between children.

paramstretchesIterable[int] | None
= None

Lumino stretch factors, one per child when provided.

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

Widget width. Numeric values use the shared anylumino size rules.

paramheightint | float | str | None
= 420

Widget height. Numeric values use the shared anylumino size rules.

paramresizablebool
= True

Whether the panel receives a notebook-friendly resize handle.

paramscrollbool
= False

Enables scrolling along the natural layout direction.

paramscroll_xbool | None
= None

Explicit horizontal or vertical overflow controls.

paramscroll_ybool | None
= None

Explicit horizontal or vertical overflow controls.

paramchild_min_widthint | float | str | None
= None

Minimum child sizes used when scrolling is enabled.

paramchild_min_heightint | float | str | None
= None

Minimum child sizes used when scrolling is enabled.

paramfit_contentbool
= False

Returns

None

On this page