Getting Started
Build your first dockable layout with flexlayout-dash.
Install
pip install flexlayout-dash
import flexlayout_dash as dfl
The import name is flexlayout_dash (as of 1.1.0); the distribution on PyPI is flexlayout-dash.
Your first layout
A DashFlexLayout takes a model (the JSON layout tree) and children (Tab components whose id matches a tab id in the model). Wrap it in a container with an explicit height and you have a draggable, splittable dock.
The three rules
- Match IDs — every
dfl.Tab(id=...)must correspond to a{"type": "tab", "id": ...}in the model. - Give it height — pass
style={"height": "400px"}to the component (itsstyleis applied to the dock container). FlexLayout positions its layout absolutely; the component setsposition: relativeon its own container, so the layout stays contained within that box. - Pick a model mode —
useStateForModel=Truekeeps the layout in the browser (simplest). UseFalsewhen you want to read or drive the model from Dash callbacks (see Callbacks).
Next, see the full Component Reference, or jump to Basic Layouts.
Source: /getting-started