Skip to main content

A component for resizable panels

Project description

resizable-panels

A Reflex custom component resizable-panels.

Installation

pip install reflex-resizable-panels

Usage

from reflex import rx
from reflex_resizable_panels import resizable_panels as rzp

def index():
    return rx.box(
        rzp.group(
            rzp.panel("Header", default_size=20, min_size=20),
            rzp.handle(),
            rzp.panel(
                "Content",
                background_color=rx.color("gray", 10),
                default_size=80,
                min_size=20,
            ),
        ),
        width="100vw",
        height="100vh",
    )

API

PanelGroup

  • children: List of Panel and Handle components.
  • auto_save_id: str - ID to save the layout in LocalStorage.
  • direction: Literal["horizontal", "vertical"] - Direction of the panels. Default is horizontal.
  • onLayout: Called when group layout changes.

Panel

  • children: Component - Content of the panel.
  • default_size: int - Default size of the panels.
  • min_size: int - Minimum size of the panels. Default is 10.
  • max_size: int - Maximum size of the panels. Default is 100.
  • collapsible: bool - If True, panel can be collapsed by resizing below min_size.
  • collapsed_size: The size of the panel when it is collapsed. Default is 0.
  • order: int - Order of the panel in the group. Required when using panels in rx.cond

Disclaimer:

Resizable panels don't work when used inside rx.container. However, rx.container inside resizable panels do work.

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

reflex_resizable_panels-0.0.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

reflex_resizable_panels-0.0.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file reflex_resizable_panels-0.0.1.tar.gz.

File metadata

  • Download URL: reflex_resizable_panels-0.0.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for reflex_resizable_panels-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0c1401ce949b0c4a49b781bb138ecbd34d329dc399ecddd523238ba977dbfe1f
MD5 dfb59f712ed477d0ed1c6418facb1ddc
BLAKE2b-256 f877baf997a0f5a24e59f4b75f88accdbcfaf72f5ee7247cfa9f3e90e546833d

See more details on using hashes here.

File details

Details for the file reflex_resizable_panels-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for reflex_resizable_panels-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d6f8c3f66fa39efb29cf2b85445694c9b1f09461ce153ef97cd9a41e34a686d7
MD5 2c868398b14f4a0f3b1f893ef93c4b19
BLAKE2b-256 c6eb9b9d5b97f985526f1a3a5869a47bce524def87e9d75834fefa4ecd6da3ec

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