Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

docs: hstack width examples (#4314)

Myles Scolnickc86a6325c1bc
diff --git a/marimo/_plugins/stateless/flex.py b/marimo/_plugins/stateless/flex.py
index 7c994c279e..76a67cd6d1 100644
--- a/marimo/_plugins/stateless/flex.py
+++ b/marimo/_plugins/stateless/flex.py
@@ -152,6 +152,20 @@ def hstack(
mo.hstack([mo.md("..."), mo.ui.text_area()])
```
+ Build a row of items with equal width:
+ ```python
+ mo.hstack([mo.md("..."), mo.ui.text_area()], widths="equal")
+ ```
+
+ Have one item stretch to fill the available space,
+ while another fits its content:
+ ```python
+ mo.hstack(
+ [mo.plain_text("..."), mo.ui.text_area(full_width=True)],
+ widths=[0, 1],
+ )
+ ```
+
Build a grid:
```python
# Build a grid.