Skip to main content

Resizable panels inspired by react-resizable-panels.

Project description

Dash Panels

Dash Panels is a Dash component library that offers a handful of resizable components.

Installation

pip install dash-panels

Components

Panels

The resizable panels are inspired by and built utilizing the react-resizable-panels React component. These components allow Dash developers to configure groups of resizable components.

Demo

https://github.com/user-attachments/assets/31aee190-c5e0-43ad-9e37-93a4d4cdbbfd

Usage

from dash_panels import PanelGroup, Panel, PanelResizeHandle
from dash import Dash, html

app = Dash(__name__)

handle_styles = {
    "background-color": "blue",
    "width": "3px",
    "height": "100%",
}
vertical_handle_styles = {
    "background-color": "blue",
    "height": "3px",
    "width": "100%",
}

panel_layout = html.Div(
    style={"height": "100vh"},
    children=[
        PanelGroup(
            id="panel-group",
            children=[
                Panel(
                    id="panel-1",
                    children=[html.Div("Panel 1")],
                    defaultSize=45,
                    minSize=15,
                    collapsible=True,
                ),
                PanelResizeHandle(html.Div(style=handle_styles)),
                Panel(
                    id="panel-2",
                    children=[
                        PanelGroup(
                            id="panel-group-2",
                            children=[
                                Panel(id="panel-2-1", children=["Panel 2-1"]),
                                PanelResizeHandle(
                                    html.Div(style=vertical_handle_styles)
                                ),
                                Panel(id="panel-2-2", children=[html.Div("Panel 2-2")]),
                            ],
                            direction="vertical",
                        )
                    ],
                    minSize=50,
                ),
                PanelResizeHandle(html.Div(style=handle_styles)),
                Panel(
                    id="panel-3",
                    children=[html.Div("Panel 3")],
                    defaultSize=20,
                    minSize=10,
                ),
            ],
            direction="horizontal",
        )
    ],
)

if __name__ == "__main__":
    app.layout = panel_layout
    app.run(debug=False)

ResizableModal

The ResizableModal component is a highly customizable component that can be resized as well as dragged around.

Demo

https://github.com/user-attachments/assets/79a1d46d-0a02-4840-ba29-aa66aa3d7090

Usage

from dash_panels import ResizableModal
from dash import Dash, html, Input, Output

app = Dash(__name__)

resizable_modal_layout = html.Div(
    children=[
        html.H1("ResizableModal Example"),
        html.P("Click below to see ResizableModal."),
        html.Button(id="open-modal", children="Open Modal"),
        ResizableModal(
            id="test-modal",
            title="Resizable Modal",
            isOpen=False,
            backdrop=True,
            showCloseButton=True,
            resizeCorner="bottom-right",
            children=[
                "Lorem."
            ]
        )
    ]
)
@app.callback(
    Output("test-modal", "isOpen"),
    Input("open-modal", "n_clicks"),
    prevent_initial_call=True,
)
def open_modal(n_clicks):
    return True

if __name__ == "__main__":
    app.layout = resizable_modal_layout
    app.run(debug=False)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dash_panels-0.0.4.tar.gz (73.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dash_panels-0.0.4-py3-none-any.whl (76.7 kB view details)

Uploaded Python 3

File details

Details for the file dash_panels-0.0.4.tar.gz.

File metadata

  • Download URL: dash_panels-0.0.4.tar.gz
  • Upload date:
  • Size: 73.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for dash_panels-0.0.4.tar.gz
Algorithm Hash digest
SHA256 8bdf0ee4f5c153b741bcf3852b1b6a611903152842bc73d30df0ee7e830cce31
MD5 fbe7a00c4ff5c9dba3318fb1f695fe0d
BLAKE2b-256 87102a7d9600b2045a17e41f68c5b9552d5499caf9882ccd97a3b43013fc3c16

See more details on using hashes here.

File details

Details for the file dash_panels-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: dash_panels-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 76.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for dash_panels-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bb88c53b26f25441d3e8850d0e1ac45705ca0ba3c9ff7778566843c42dd4e66d
MD5 16eac637ba8bb02354046fb8bdcecbc1
BLAKE2b-256 8147f5bf7566dc0727aaac3dd9166feb649fd42595153217461e51c88fb61ce1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page