Sheet
Sheet/drawer overlay component.
Preview
Filters
Status, owner and date range.
python
sheet(is_open=True, title='Filters', content='<p style="margin:0">Status, owner and date range.</p>', side='right')Usage
views.py
python
from djust import LiveView
from djust.decorators import event_handler
from djust.components.components.sheet import Sheet
from django.utils.safestring import mark_safe
class MyView(LiveView):
template_name = "my_template.html"
def mount(self, request, **kwargs):
self.component = Sheet(is_open=True, title='Filters', content=mark_safe('<p style="margin:0">Status, owner and date range.</p>'))
@event_handler()
def close_sheet(self, **kwargs):
self.component.is_open = Falsemy_template.html
django
{{ component }}Events this component sends to the view: close_sheet.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| content | str | '' | sheet body (pre-rendered HTML) |
| title | str | '' | optional header title |
| side | str | 'right' | left, right |
| is_open | bool | False | whether sheet is open |
| close_event | str — renames the event; identity is `name` | 'close_sheet' | dj-click event name |
| 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.sheet | Subclass it, or pass custom_class, to change how it renders. |
| css | djust_components/components.css | Defines 7 of this component's classes at line 727, 729, 730, 736, 738, 739, 741. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |
| css | djust_theming/catalogue.css | Defines 1 of this component's classes at line 159. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |