Error Boundary

Style-agnostic error boundary component.

python 6 params

Preview

The chart rendered normally.
Arguments
error_boundary(content='The chart rendered normally.')
Arguments
error_boundary(content='The chart rendered normally.', error='TimeoutError', fallback='The chart could not load.', retry_event='retry_load')

Usage

views.py
python
from djust import LiveView
from djust.components import ErrorBoundary


class MyView(LiveView):
    template_name = "my_template.html"

    def mount(self, request, **kwargs):
        self.component = ErrorBoundary(content='The chart rendered normally.')
my_template.html
django
{{ component }}

Parameters

NameTypeDefault
fallbackstr'Something went wrong'
errorstr''
retry_eventstr — renames the event; identity is `name`''
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.error_boundarySubclass it, or pass custom_class, to change how it renders.
cssdjust_components/components.cssDefines 5 of this component's classes at line 1929, 1930, 1931, 1932, 1933. Override those rules, or the custom properties they read, in a stylesheet loaded after it.