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 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, value=None, **kwargs):
... # write to self.component; the re-render carries itmy_template.html
django
{{ component }}Events this component sends to the view: close_sheet.
Parameters
| Name | Type | Default |
|---|---|---|
| content | str | '' |
| title | str | '' |
| side | str | 'right' |
| is_open | bool | False |
| close_event | str — renames the event; identity is `name` | 'close_sheet' |
| 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 701, 703, 704, 710, 712, 713, 715. 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. |