AnyLumino
API referenceastryxbase

Theme

Apply a reusable Astryx theme to child widgets.

Astryx Props

JSON-safe Stack props forwarded to Astryx.

Supported Astryx props include:

  • direction ('horizontal' or 'vertical'; default 'vertical'): Direction of the stack layout.
  • hAlign (StackAlignment): Horizontal alignment. With horizontal direction it controls the main axis; with vertical direction it controls the cross axis.
  • vAlign (StackAlignment): Vertical alignment. With horizontal direction it controls the cross axis; with vertical direction it controls the main axis.
  • justify (StackMainAlignment): Main-axis alignment alias resolved from direction, mirroring CSS justify-content.
  • align (StackCrossAlignment): Cross-axis alignment alias resolved from direction, mirroring CSS align-items.
  • width (number or string): Container width. Numbers are pixels; strings are used as CSS values.
  • height (number or string): Container height. Numbers are pixels; strings are used as CSS values.
  • gap (spacing step): Spacing between items. Accepts Astryx spacing steps such as 0, 0.5, 1, 2, 3, 4, 6, 8, and 10.
  • padding (spacing step): Inner padding on all sides using the spacing scale.
  • paddingInline (spacing step): Horizontal padding override; takes precedence over padding on the inline axis.
  • paddingBlock (spacing step): Vertical padding override; takes precedence over padding on the block axis.
  • isScrollable (boolean; default false): Enables scrollable overflow on the stack container.
  • wrap ('nowrap' or 'wrap' or 'wrap-reverse'; default 'nowrap'): Controls whether items wrap onto additional lines.
  • as (ElementType; default div): Element type to render for the root element.
  • xstyle (StyleXStyles): StyleX styles created with stylex.create().
  • className (string): CSS class names appended to the root element.
  • style (CSSProperties): Inline styles applied after StyleX styles.
  • children (ReactNode): Content rendered inside the stack.

Props typed as React nodes, render functions, event handlers, refs, or StyleX styles are documented for Astryx parity but cannot be serialized directly from Python unless the wrapper adapts them.

See Astryx component docs: https://astryx.atmeta.com/components/Stack.

Notes

This wrapper propagates theme descriptors to nested Astryx child widgets because each anywidget renders in its own frontend root.

Functions

constructor__init__(children=None, *, brand=None, color_mode='light', mode=None, direction='vertical', gap=2, align=None, justify=None, width=None, height=None, padding=None, wrap=None, scrollable=None, **props) -> None
paramchildrenChildInput
= None

Child widget, sequence of widgets, or mapping of slot names to widgets.

parambrandMapping[str, Any] | None
= None

Reusable Astryx theme descriptor created by :func:Brand or :func:BuiltTheme.

paramcolor_modestr
= 'light'

Astryx Theme mode for this component or subtree. Use "light", "dark", "system" to follow the OS prefers-color-scheme, or "jupyterlab" to follow the JupyterLab theme.

parammodestr | None
= None

Alias for color_mode matching the Astryx Theme prop name. When provided, it takes precedence over color_mode.

paramdirectionstr
= 'vertical'

Layout direction.

paramgapint | float
= 2

Astryx spacing step between children.

paramalignstr | None
= None

Cross-axis alignment.

paramjustifystr | None
= None

Main-axis alignment.

paramwidthint | float | str | None
= None

Theme container width.

paramheightint | float | str | None
= None

Theme container height.

parampaddingint | float | None
= None

Inner padding using the Astryx spacing scale.

paramwrapstr | None
= None

Stack wrapping behavior.

paramscrollablebool | None
= None

Whether overflow should scroll.

parampropsAny
= {}

Returns

None

On this page