The canvas's error screens: the whole page an ErrorHTML renders (error_page/1), the error
inside the app (error_state/1) and the list of links under the actions (error_links/1).
<.error_page code={404} request_id={@request_id}>
<:brand><b>Acme</b></:brand>
<:status href="https://status.acme.com">All systems operational</:status>
<:actions><a class="lu-b c-primary v-solid s-lg" href="/">Back home</a></:actions>
<.error_links title="Maybe you were looking for">
<:link navigate="/orders" icon="receipt" description="Every order">Orders</:link>
</.error_links>
<:footer><a href="/help">Help center</a></:footer>
</.error_page>
<.error_state code={404} title="Order #2499 not found">
It may have been deleted or belong to another branch.
</.error_state>code is the HTTP status (or text, "OFF" for offline). It picks the colour of the big code
(tone: neutral 404, error 5xx, warning 403/429/offline, accent 401/419/503) and the
English defaults of label, title and description; pass them translated.
The copy button of the request id uses an inline onclick (navigator.clipboard), so it works
on a plain ErrorHTML page with no LiveView or hook. back_label adds a history.back() button.
Summary
Functions
Attributes
title(:string) - Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
link(required) - Accepts attributes:href(:string)navigate(:string)icon(:string)description(:string)
Attributes
code(:any) (required)tone(:string) - Defaults tonil.Must be one ofnil,"","neutral","error","warning", or"accent".label(:string) - Defaults tonil.title(:string) - Defaults tonil.description(:string) - Defaults tonil.request_id(:string) - Defaults tonil.request_id_label(:string) - Defaults to"Request ID".copy_label(:string) - Defaults to"Copy request ID".copy(:boolean) - Defaults totrue.back_label(:string) - Defaults tonil.timestamp(:string) - Defaults tonil.id(:string) - Defaults to"error-page".class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
actionsbrandcardfooterinner_blockstatus- Accepts attributes:href(:string)status(:string)
Attributes
code(:any) (required)tone(:string) - Defaults tonil.Must be one ofnil,"","neutral","error","warning", or"accent".icon(:string) - Defaults tonil.title(:string) - Defaults tonil.description(:string) - Defaults tonil.id(:string) - Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
actionsinner_block- The description, instead ofdescription.more- Under the actions, full width.