Block 105 of 297
Error 404
A friendly page-not-found message with a search box and popular links, so a dead end becomes a next step.
- Puck key
- Error404Block
- Export
- error404Block
- React component
- <Error404 />
- Path
- components/puck/error-404-block.tsx
- Dependencies
- None
- License
- MIT
About this block
When to use it, how to write for it, and what to change in the code.
What it's for
A not-found page section with a large error code, a plain-language heading and message, a search box, and a list of popular pages beside it. Home and report-a-problem links sit under the search. A faint grid pattern fades in from the top corner. On phones the popular links drop below the message.
- The site's 404 page
- A "this page has moved" notice after a site migration
- Expired campaign or event URLs that should redirect people to current content
Writing the content
- Keep Heading level at H1 on a dedicated not-found page; it is the page's main heading.
- Use the Message to explain likely causes, such as a recent site update or a typo, without blaming the visitor.
- Pick 4 to 6 Helpful links (8 at most) from your most-visited pages, each with a one-line Description.
- Set Contact link to a mailto: with a subject line, so broken-link reports are easy to filter. Leave Contact link text blank to hide the line.
Accessibility
- The big error code includes hidden "Error" text, so screen readers hear "Error 404" instead of a bare number.
- The search box has a real, visually hidden label and sits in a form with role="search".
- The background grid is a decorative SVG hidden from assistive tech, and the links heading renders one level below the main heading.
Customizing the code
- The error code color is text-indigo-600 at up to lg:text-9xl; change both on the code paragraph.
- Remove or restyle the grid pattern via the svg with the mask-radial classes at the top of the section.
Editor fields
What content editors see in the P1 sidebar when they select this block.
- Error codetext
- Headingtext
- Heading levelselect
- Messagetextarea
- Search page URLtext
- Search parameter nametext
- Search box labeltext
- Search button texttext
- Links headingtext
- Helpful linksarray
- Home link texttext
- Home linktext
- Contact sentencetext
- Contact link texttext
- Contact linktext