Bottom Sheet
Style-agnostic bottom sheet / drawer component.
Preview
Share
Copy link · Email · Embed
python
bottom_sheet(open=True, title='Share', content='Copy link · Email · Embed')The sheet requires a host trigger and viewport-level overlay context, so it has no standalone preview.
Usage
views.py
python
from djust import LiveView
from djust.decorators import event_handler
from djust.components import BottomSheet
class MyView(LiveView):
template_name = "my_template.html"
def mount(self, request, **kwargs):
self.component = BottomSheet(open=True, title='Share', content='Copy link · Email · Embed')
@event_handler()
def close_sheet(self, **kwargs):
self.component.open = Falsemy_template.html
django
{{ component }}Events this component sends to the view: close_sheet.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| title | str | '' | Sheet title text |
| open | bool | False | Whether the sheet is visible |
| close_event | str — renames the event; identity is `name` | 'close_sheet' | djust event for closing |
| custom_class | str | '' | Additional CSS classes |
| content | 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.bottom_sheet | Subclass it, or pass custom_class, to change how it renders. |
| css | djust_components/components.css | Defines 9 of this component's classes at line 1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832, 2744. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |
| css | djust_theming/catalogue.css | Defines 2 of this component's classes at line 158, 162. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |
| css | djust_theming/components.css | Defines 1 of this component's classes at line 1612. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |