Grid
Arrange child widgets in an Astryx grid.
Astryx Props
JSON-safe Grid props forwarded to Astryx.
Supported Astryx props include:
columns(number or {minWidth: number, max?: number, repeat?: 'fill' or 'fit'}): Column configuration. Use a number for fixed columns (e.g. 'columns={3}'). Use an object for responsive columns: 'minWidth' sets the minimum column width in px, 'repeat' controls track behavior ('"fill"' preserves empty tracks for consistent widths, '"fit"' collapses empty tracks so items stretch; defaults to '"fill"'), and 'max' caps the maximum number of columns.minChildWidth(number): Deprecated: use 'columns={{minWidth: 280}}' instead. Minimum item width in px; enables responsive auto-fit.width(number or string): Container width.height(number or string): Container height.gap(SpacingStep): Spacing between all items.rowGap(SpacingStep): Row spacing; overrides 'gap' for the row axis.columnGap(SpacingStep): Column spacing; overrides 'gap' for the column axis.align(GridAlignment): Vertical alignment of items.justify(GridAlignment): Horizontal alignment of items.children(ReactNode): Grid content.xstyle(StyleXStyles): StyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value: not an inline style object like style={{}}.
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/Grid.
Functions
constructor__init__(children=None, *, columns=2, gap=3, row_gap=None, column_gap=None, align=None, justify=None, width=None, height=None, **props) -> NoneparamchildrenChildInput= NoneChild widget, sequence of widgets, or mapping of slot names to widgets.
paramcolumnsint | str | Mapping[str, Any]= 2Grid column definition. Pass an int for fixed columns, a
{"minWidth": int, "repeat": "fit" | "fill", "max": int} mapping for
responsive columns, or the equivalent CSS string
"repeat(auto-fit, minmax(280px, 1fr))". Other CSS strings raise a
TypeError because Astryx cannot render them.
paramgapint | float= 3Astryx spacing step between children.
paramrow_gapint | float | None= NoneRow spacing override.
paramcolumn_gapint | float | None= NoneColumn spacing override.
paramalignstr | None= NoneVertical item alignment.
paramjustifystr | None= NoneHorizontal item alignment.
paramwidthint | float | str | None= NoneGrid width.
paramheightint | float | str | None= NoneGrid height.
parampropsAny= {}Returns
None