AspectRatio
Constrain child content to a fixed aspect ratio.
Astryx Props
JSON-safe AspectRatio props forwarded to Astryx.
Supported Astryx props include:
ratio(number; required): Aspect ratio as width/height (e.g. 16/9, 1).children(ReactNode; required): Content positioned absolutely to fill the container.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/AspectRatio.
Functions
constructor__init__(children=None, *, ratio=16 / 9, **props) -> NoneparamchildrenChildInput= NoneChild widget, sequence of widgets, or mapping of slot names to widgets.
paramratioint | float= 16 / 9Aspect ratio as a numeric width divided by height value.
parampropsAny= {}Returns
None