Empty State
Empty state placeholder component.
Preview
No results found
Try adjusting your search or filters.
Arguments
empty_state(title='No results found', description='Try adjusting your search or filters.', icon='🔍')
Usage
views.py
python
from djust import LiveView
from djust.components import EmptyState
class MyView(LiveView):
template_name = "my_template.html"
def mount(self, request, **kwargs):
self.component = EmptyState(title='No results found', description='Try adjusting your search or filters.', icon='🔍')my_template.html
django
{{ component }}Parameters
| Name | Type | Default |
|---|---|---|
| title | str | '' |
| description | str | '' |
| icon | str | '' |
| action_label | str | '' |
| action_event | str — renames the event; identity is `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.empty_state | Subclass it, or pass custom_class, to change how it renders. |
| css | djust_components/components.css | Defines 4 of this component's classes at line 532, 533, 534, 535. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |
| css | djust_theming/scaffold.css | Defines 3 of this component's classes at line 795, 801, 815. 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 93. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |