Layout Blocks
Layout blocks take other blocks as parameters and lay them out. Interactive layout blocks (such as tabs and selects) don't require a backend server and can be used in standalone HTML reports.
This includes columns:
Interactive tabs:
And many other supported layout blocks.
Nesting¶
Layout blocks can be arbitrarily nested, allowing you to create complex user interfaces.
dp.Group(
dp.Text("This is the left side of a two-column layout"),
dp.Group(
dp.Text("This is the right side of a two-column layout"),
dp.Text("Below we have three tabs with different content"),
dp.Select(
blocks=[
dp.Text("Hello World 1", label="Page 1"),
dp.Text("Hello World 2", label="Page 2"),
dp.Text("Hello World 3", label="Page 3"),
]
),
),
columns=2,
)