Resizable Panel
Container with a drag-to-resize handle.
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
| Name | Type | Default |
|---|---|---|
| content | str | '' |
| direction | str | 'horizontal' |
| min_size | str | '100px' |
| max_size | str | 'none' |
| initial_size | str | '50%' |
| disabled | bool | False |
| custom_class | str | '' |
| **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
| File | Path | Notes |
|---|---|---|
| module | djust.components.components.resizable_panel | Subclass it, or pass custom_class, to change how it renders. |
| css | djust_components/components.css | Defines 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. |