Skip to content
Klarhimmel UI

Error, server error

Error, server error previewError, server error preview

Install

npx shadcn add @klarhimmel/error-status
DetailsAbout, usage, props and more

A 500-style page for when it is our fault: plain apology, retry and status actions, and a side panel with a copyable reference id for support plus up to three things to…

Import

Import

import Block from '@/components/klarhimmel/blocks/error-status';
Also called
  • error/status
About
A 500-style page for when it is our fault: plain apology, retry and status actions, and a side panel with a copyable reference id for support plus up to three things to try.
Category
Not found, server error and maintenance pages. New project? Set it up once: /get-started/installation.

Notes

When to use it

A 500-style page for when the fault is ours, with retry and status actions and a side panel holding a copyable reference id. For a simple dead link use error-page.

Writing for it

- The reference holds 40 characters, with a copy button beside it. Write a real example id format so support staff can recognise it. - Tips hold 120 characters each, up to 3. Give actions the reader can take, such as retrying in a minute. - Primary and secondary are two links, usually Try again and Status page. The title is the h1 and holds 100 characters.

Watch out for

The reference id uses break-all, so a long id wraps mid-string. With no tips the tips heading is hidden too, and the reference label stays.

Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import ErrorStatus from '@/components/klarhimmel/blocks/error-status';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <ErrorStatus props={{
          "code": "500",
          "title": "Say what went wrong in plain words",
          "description": "Say in two sentences that you know and are fixing it, that their data is safe, and what to try.",
          "primary": {
            "label": "Main action",
            "href": "#"
          },
          "secondary": {
            "label": "Second action",
            "href": "/status"
          },
          "referenceLabel": "Name the reference code",
          "reference": "AAA-0000-0000",
          "tipsTitle": "Say what to try",
          "tips": [
            "Say a first thing to try",
            "Say a second thing to try",
            "Say what to quote if they write to you"
          ]
        }} />
      </BlockSurface>
    </Theme>
  );
}

Props

The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.

PropTypeDefaultDescription
codestring'500'Text, up to 20 characters.
titlestring'Say what went wrong in plain words'Text, up to 100 characters.
descriptionstring'Say in two sentences that you know …'Text, up to 300 characters.
primaryLink{…}See the type.
secondaryLink{…}See the type.
referenceLabelstring'Name the reference code'Text, up to 40 characters.
referencestring'AAA-0000-0000'Text, up to 40 characters.
tipsTitlestring'Say what to try'Text, up to 60 characters.
tipsstring[]3 itemsList of up to 3.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.