Resizable Panel

Container with a drag-to-resize handle.

python 8 params

Preview

Drag the edge to resize.

Arguments
resizable_panel(content='<p>Drag the edge to resize.</p>')

Usage

views.py
python
from djust import LiveView
from djust.components import ResizablePanel
from django.utils.safestring import mark_safe


class MyView(LiveView):
    template_name = "my_template.html"

    def mount(self, request, **kwargs):
        self.component = ResizablePanel(content=mark_safe('<p>Drag the edge to resize.</p>'))
my_template.html
django
{{ component }}

Needs a client hook djust does not ship: dj-hook="ResizablePanel". The markup renders, but the interaction described above is yours to add — register window.djust.hooks.ResizablePanel = { mounted() { … } } before client.js loads (see the hooks guide).

Parameters

NameTypeDefault
contentstr''
directionstr'horizontal'
min_sizestr'100px'
max_sizestr'none'
initial_sizestr'50%'
disabledboolFalse
custom_classstr''
**kwargs— passed to `Component.__init__`: `name=` identifies the instance in the events it sends, `id=` sets `component.id`, and any other keyword is kept as state
Source & styles
FilePathNotes
moduledjust.components.components.resizable_panelSubclass it, or pass custom_class, to change how it renders.
cssdjust_components/components.cssDefines 5 of this component's classes at line 1977, 1978, 1980, 1981, 1985. Override those rules, or the custom properties they read, in a stylesheet loaded after it.