Skip to main content
spaday-regular-layout logo, a picnic blanket and basket inside a browser window

Serializable, resizable panel layouts for spaday, powered by regular-layout.

Build Status codecov License PyPI

Documentation

Quick example

from spaday import serve
from spaday_regular_layout import RegularLayout, RegularLayoutFrame

layout = {
    "type": "split-layout",
    "orientation": "horizontal",
    "sizes": [0.3, 0.7],
    "children": [
        {"type": "tab-layout", "tabs": ["nav"]},
        {"type": "tab-layout", "tabs": ["main"]},
    ],
}

page = RegularLayout(
    RegularLayoutFrame("Navigation", name="nav"),
    RegularLayoutFrame("Main", name="main"),
    layout=layout,
    style="height: 32rem",
).prop("class", "lorax")
serve(page, packages=["regular-layout"])

layout is the serializable split/tab tree returned by upstream save(). Bind it to application state to restore layouts reactively. Browser changes emit regular-layout-update; use a spaday event action to persist event.detail.

Each frame's content area (regular-layout-frame::part(container)) is display: block with a definite height, not a flex container, so flex: 1 on slotted content silently does nothing. Give slotted content height: 100% to fill a panel.

Run the local example

Run the complete example in your browser — Python runs locally through Pyodide; no install or server required.

python -m pip install -e ".[examples]"
python -m spaday_regular_layout.example

Open http://127.0.0.1:8013 to resize and rearrange the complete three-panel example. It receives a new server layout every five seconds and persists browser rearrangements back to Python. It passes the local package descriptor directly, so it does not install or resolve the integration from GitHub.

Metadata

Release files for spaday-regular-layout 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spaday-regular-layout 0.3.0
File Size Uploaded
spaday_regular_layout-0.3.0.tar.gz 106.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spaday-regular-layout 0.3.0
File Interpreter ABI Platform
spaday_regular_layout-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 170.7 kB

Release files / spaday_regular_layout-0.3.0.tar.gz

Download URL spaday_regular_layout-0.3.0.tar.gz
Size 106.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f7c83aaeffa7764d75e2667fc34c23ddcfe1f68b5598cdae6bd38f45b84d025a
BLAKE2b-256 checksum
How to use checksums
19a2b1952723e546e9b7941363a97447c8db36dc0b93bce15af26751e9ba9c4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / spaday_regular_layout-0.3.0-py3-none-any.whl

Download URL spaday_regular_layout-0.3.0-py3-none-any.whl
Size 64.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db69d7cdc9a6d9ace5bb3fb4cf54a9c4941cff4a13b95bfb37f0f259a48c2513
BLAKE2b-256 checksum
How to use checksums
b21d01e0120e6a9e2be7a1c130c92a519f29ac552d324883f0737461504bec2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page