ErrorPage

import { ErrorPage } from "@surfaces-ui/components";

Shown in place of a page that could not be: not found, no longer shared, the server not answering, a failure to draw. Says what happened and the way on. Its words are an alert; it is no landmark, so it goes in the page's main. For not found, say the same whether or not the thing exists for someone else.

Props

PropTypeRequiredWhat it is
titlestringyesWhat happened, short.
messagestringyesWhy, as far as it may be said, and what can be done. Never a server's own text.
codestringA short code above the title, such as "404".
actionsobject[]The ways on, the one to take first.
level1 \2 \3

Parts the host supplies

Props that take code. Each is optional unless marked; the component leaves out what it needs it for.

  • picture: Picture. Above the words: the host's own mark or drawing.

Callbacks

  • onAction: Called with the id of the way on that was pressed.

Example

tsx
<ErrorPage
  code="404"
  title="This page isn't here"
  message="The address may have a typo in it, or what it led to was moved or deleted."
  actions={[{"id":"home","label":"Go to Home"}]}
  level={2}
  picture={picture}
  onAction={…}
/>