Popover
Popover overlay component.
Preview
Project status
Deployment completed successfully.
Arguments
popover(trigger='View details', title='Project status', content='<p>Deployment completed successfully.</p>')
Usage
views.py
python
from djust import LiveView
from djust.components import Popover
from django.utils.safestring import mark_safe
class MyView(LiveView):
template_name = "my_template.html"
def mount(self, request, **kwargs):
self.component = Popover(trigger='View details', title='Project status', content=mark_safe('<p>Deployment completed successfully.</p>'))my_template.html
django
{{ component }}Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| trigger | str | 'Click me' | trigger button text |
| content | str | '' | popover body (pre-rendered HTML) |
| title | str | '' | optional popover title |
| placement | str | 'bottom' | bottom, top, left, right |
| 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.popover | Subclass it, or pass custom_class, to change how it renders. |
| css | djust_components/components.css | Defines 6 of this component's classes at line 706, 707, 710, 711, 712, 2502. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |