<- Back to Layout Components

Definition

Sidebar marks a side region of an application layout. It is intended for navigation, filters, tools, or auxiliary content placed beside a main ContentArea.

Scope

Use Sidebar when the page needs a structural side area with controlled width. Do not use it as a generic replacement for Column: when repeated content must flow predictably, put a layout container such as Column or ScrollArea inside the sidebar and update that inner container.

Properties

Property Type Default Notes
children list[str | Component] [] Content rendered inside the sidebar. Prefer an explicit layout container as the first child for repeated items.
width int | string client default Sidebar width.
max_width int | string client default Optional maximum width.
padding list[int] client default Inner spacing used by the web renderer and shell layouts.
align string "top" Alignment passed to the internal layout on web.
style string client/theme default Common style property.

Static Sidebar

With ContentArea

Use Sidebar beside ContentArea to build the common side-navigation shell.

Store Binding

Bind width and max_width when the sidebar size is driven by page state.

Data Model Binding

Use data-model binding when the sidebar width comes from surface data.

Property Updates

Declare capabilities before updating width or max_width directly.

The action can update store, data model, and live sidebar width:

return sdk.effects.respond(
    sdk.effects.ui_property_update("sidebar_live", "width", 300, surface_id=surface_id),
    sdk.effects.ui_property_update("sidebar_live", "max_width", 300, surface_id=surface_id),
)

Dynamic Navigation Items

For dynamic navigation, update an inner Column or ScrollArea rather than appending repeated items directly to Sidebar.children.

Visibility And Permissions

show_if, hide_if, and required_permissions are available on Sidebar.

Notes

  • Sidebar is a structural side area, not a generic Column replacement.
  • Put a Column, ScrollArea, or other layout container inside it when repeated content must flow predictably.
  • Use width and max_width together when the sidebar should keep a fixed size.
  • Use ContentArea beside Sidebar for the main workspace.