Bottom Sheet

Style-agnostic bottom sheet / drawer component.

python 6 params

Preview

open

Share

Copy link · Email · Embed
python
bottom_sheet(open=True, title='Share', content='Copy link · Email · Embed')

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, value=None, **kwargs):
        ...  # write to self.component; the re-render carries it
my_template.html
django
{{ component }}

Events this component sends to the view: close_sheet.

Parameters

NameTypeDefault
titlestr''
openboolFalse
close_eventstr — renames the event; identity is `name`'close_sheet'
custom_classstr''
contentstr''
**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.bottom_sheetSubclass it, or pass custom_class, to change how it renders.
cssdjust_components/components.cssDefines 9 of this component's classes at line 1798, 1799, 1800, 1801, 1802, 1803, 1804, 1805, 2641. Override those rules, or the custom properties they read, in a stylesheet loaded after it.
cssdjust_theming/catalogue.cssDefines 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.
cssdjust_theming/components.cssDefines 1 of this component's classes at line 1537. Override those rules, or the custom properties they read, in a stylesheet loaded after it.