Flexible docking layout system for Dash applications
Project description
Dash Flex Layout
A flexible docking layout system for Dash applications built on FlexLayout.
Docs
https://pip-install-python.com/pip/dash_flex_layout
Features
- Create dock-able, resizable, and floatable windows in your Dash apps
- Drag and drop tabs between dock containers
- Maximize, close, and pop-out tabs
- Compatible with both Dash 2 and Dash 3
- Free version with up to 3 tabs
- Premium version with unlimited tabs (requires API key)
Installation
pip install flexlayout-dash
Simple Example
import dash
from dash import html
import dash_flex_layout
app = dash.Dash(__name__)
# Define the layout configuration
dock_config = {
"global": {
"tabEnableClose": False,
"tabEnableFloat": True
},
"layout": {
"type": "row",
"children": [
{
"type": "tabset",
"children": [
{
"type": "tab",
"name": "Tab 1",
"component": "text",
"id": "tab-1",
}
]
},
{
"type": "tabset",
"children": [
{
"type": "tab",
"name": "Tab 2",
"component": "text",
"id": "tab-2",
}
]
}
]
}
}
# Create tab content components
tab_components = [
dash_flex_layout.Tab(
id="tab-1",
children=[
html.H3("Tab 1 Content"),
html.P("This is the content for tab 1")
]
),
dash_flex_layout.Tab(
id="tab-2",
children=[
html.H3("Tab 2 Content"),
html.P("This is the content for tab 2")
]
)
]
# Main app layout
app.layout = html.Div([
html.H1("Dash Flex Layout Example"),
dash_flex_layout.DashFlexLayout(
id='dock-layout',
model=dock_config,
children=tab_components,
useStateForModel=True
)
])
if __name__ == '__main__':
app.run_server(debug=True)
Premium Version
Dash Flex Layout is available in two versions:
- Free Version: Limited to 3 tabs
- Premium Version: Unlimited tabs (requires API key)
To use the premium version, obtain an API key and include it in your DashFlexLayout component:
dash_flex_layout.DashFlexLayout(
id='dock-layout',
model=dock_config,
children=tab_components,
apiKey="your-api-key-here"
)
Getting an API Key
Visit My Shop to obtain an API key for the premium version.
Component Properties
DashFlexLayout
| Property | Type | Description |
|---|---|---|
id |
string | The ID used to identify this component |
model |
object | FlexLayout model configuration |
children |
list | React components to render in the tabs |
headers |
object | Custom headers for tabs |
useStateForModel |
boolean | Use internal state for the model (default: false) |
font |
object | Override font styles for tabs |
supportsPopout |
boolean | Whether pop-out windows are supported |
popoutURL |
string | URL for pop-out windows |
realtimeResize |
boolean | Resize tabs during dragging (default: false) |
apiKey |
string | API key for premium features |
freeTabLimit |
number | Maximum number of tabs in free version (default: 3) |
debugMode |
boolean | Enable debug mode (default: false) |
Tab
| Property | Type | Description |
|---|---|---|
id |
string | The ID used to identify this tab |
children |
list | React components to render in the tab |
Development
Prerequisites
- Node.js >= 14
- npm >= 6
- Python >= 3.7
Setup
-
Clone the repository:
git clone https://github.com/pip-install-python/dash-flex-layout.git cd dash-flex-layout
-
Create a Python virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt npm install
-
Build the component:
npm run build
-
Run the example:
python usage.py
License
This was created under the Pip Install Python LLC and licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flexlayout_dash-1.0.0.tar.gz.
File metadata
- Download URL: flexlayout_dash-1.0.0.tar.gz
- Upload date:
- Size: 245.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e452413201fe32719e41556fca831cb8a2fe69b6bfc6a0500deea62bb367dfc6
|
|
| MD5 |
a8aa830d035a0c14c016dffe38783297
|
|
| BLAKE2b-256 |
09969986ebffab5c96aeca04f78adc4dfaae480c705f41354db06515a3932056
|
File details
Details for the file flexlayout_dash-1.0.0-py3-none-any.whl.
File metadata
- Download URL: flexlayout_dash-1.0.0-py3-none-any.whl
- Upload date:
- Size: 250.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bce38a6909f85b45d3714b9820c164ebf7419ac77bf7a0b2b2f7132cdabd1881
|
|
| MD5 |
5f6a2985cf0ec224c522343b6ac44053
|
|
| BLAKE2b-256 |
1761a3917930ef8dc024d732e2be976722098b6c648b9a6f4db5288c2bf72717
|