Skip to content

ErrorPage

When something failed on our side: what happened, that nothing was lost, what to do now, and the reference support will ask for. Outside the console it is a page; inside, only the part that failed says so.

import { EmptyState, Hash } from '@sypnia/ui/react'

On this page
  1. On a desktop
  2. On a phone
  3. Inside the console
  4. When to use it
  5. For everyone
  6. Props

On a desktop

A page of its own, outside the console. Press «Try again», or open the technical details.

Code
import { useState } from 'react';
import { AuthLayout, Button, CodeBlock, Disclosure, EmptyState, Hash, Page, PageHeader, Panel, Stack, Text, useSypnia } from '@sypnia/ui/react';

// When something failed on our side. Outside the console it is a page of its own; inside, only the part that failed
// says so and the rest of the screen keeps working. Both say what happened, that nothing was lost, and what to do now,
// and both carry the reference that support needs.
const en = {
  title: 'Something failed on our side', body: 'Nothing you did caused it, and nothing was lost. Try again in a moment; if it keeps happening, send us the reference below.',
  retry: 'Try again', retrying: 'Trying again…', status: 'See the status of Sypnia', ref: 'Reference', refLabel: 'error reference',
  home: 'Go to my projects', details: 'Technical details',
  page: 'Tables', pageLead: 'Everything this project keeps, as tables.', panel: 'Rows written today',
  partTitle: 'These numbers could not be loaded', partBody: 'The rest of the page works. Try again, or come back in a minute.',
  terms: 'Terms', help: 'Help',
};
const es: typeof en = {
  title: 'Algo falló de nuestro lado', body: 'No fue nada que hicieras, y no se perdió nada. Intenta de nuevo en un momento; si sigue pasando, envíanos la referencia de abajo.',
  retry: 'Intentar de nuevo', retrying: 'Intentando de nuevo…', status: 'Ver el estado de Sypnia', ref: 'Referencia', refLabel: 'referencia del error',
  home: 'Ir a mis proyectos', details: 'Detalles técnicos',
  page: 'Tablas', pageLead: 'Todo lo que guarda este proyecto, en tablas.', panel: 'Filas escritas hoy',
  partTitle: 'No se pudieron cargar estas cifras', partBody: 'El resto de la página funciona. Intenta de nuevo, o vuelve en un minuto.',
  terms: 'Términos', help: 'Ayuda',
};
const reference = 'err_7Hq2kVd9xR4mWp1c';
const trace = `GET /v1/projects/northwind/tables  503\nupstream: data-api (eu-west)\nat 2026-11-17 14:02:11 UTC`;

export default function ErrorPage({ variant = 'page' }: { variant?: 'page' | 'part' }) {
  const { locale } = useSypnia();
  const c = locale.startsWith('es') ? es : en;
  const [busy, setBusy] = useState(false);
  const retry = () => { setBusy(true); setTimeout(() => setBusy(false), 1400); };
  if (variant === 'part') {
    return (
      <Page>
        <PageHeader title={c.page} lead={c.pageLead} />
        <Panel title={c.panel}>
          <EmptyState tone="fail" compact title={c.partTitle}
            actions={<Button icon="refresh" busy={busy} onClick={retry}>{busy ? c.retrying : c.retry}</Button>}>
            <Stack gap={2}><span>{c.partBody}</span><Text size="xs" tone="muted">{c.ref}: <Hash value={reference} length={18} label={c.refLabel} /></Text></Stack>
          </EmptyState>
        </Panel>
      </Page>
    );
  }
  return (
    <AuthLayout plain brandHref="#" footer={<><a href="#status">{c.status}</a><a href="#help">{c.help}</a></>}>
      <EmptyState tone="fail" title={c.title}
        actions={<><Button variant="primary" icon="refresh" busy={busy} onClick={retry}>{busy ? c.retrying : c.retry}</Button><Button href="#projects">{c.home}</Button></>}>
        <Stack gap={4}>
          <span>{c.body}</span>
          <Text size="sm">{c.ref}: <Hash value={reference} length={18} label={c.refLabel} /></Text>
          <Disclosure title={c.details}><CodeBlock code={trace} title={c.details} /></Disclosure>
        </Stack>
      </EmptyState>
    </AuthLayout>
  );
}

On a phone

The same page at 390 px: the buttons stack and the reference wraps.

Inside the console

Only the panel that failed says so; the page header and the rest of the screen stay.

Tables

Everything this project keeps, as tables.

Rows written today

When to use it

Use it when

  • A server error, a timeout, a service that is down: anything the person did not cause.
  • Inside the console, put the error where the data would be, so the rest of the screen keeps working.

Do not use it when

  • Blaming the person, or apologising instead of saying what to do.
  • Codes alone: «Error 503» means nothing to most people. The code goes in the technical details.
  • Replacing a whole console screen because one panel failed.

For everyone

  • The message is an alert: a screen reader reads it as soon as it appears.
  • «Try again» shows that it is working and does not lose the focus.
  • The reference has its own Copy button with a name: «Copy error reference».

Props

EmptyStateTypeDefault
titlerequired

What this place is for, in one sentence of plain language.

ReactNode
actions

The one button that fills it, and at most one alternative.

ReactNode
compact boolean
icon "function" | "error" | "replay" | "performance" | "uptime" | "traces" | "rage-click" | "dead-click" | "alert" | "summary" | "watch" | "sleep" | "light" | "suggestion" | "prompt" | "mcp" | "pull-request" | "git-branch" | "fix" | "check" | "open-source" | "self-host" | "sdk" | "engine" | "signals-in" | "web" | "mobile" | "backend" | "cloud" | "data" | "user" | "clock" | "shield" | "lock" | "mail" | "star" | "copy" | "arrow-right" | "arrow-up-right" | "chevron-down" | "plus" | "close" | "play" | "pause" | "search" | "info" | "warning" | "trash" | "menu" | "download" | "upload" | "filter" | "home" | "table" | "key" | "users" | "sun" | "moon" | "globe" | "sign-out" | "link" | "edit" | "calendar" | "chevron-left" | "chevron-right" | "chevron-up" | "minus" | "more" | "sort" | "arrow-left" | "arrow-up" | "arrow-down" | "arrow-down-right" | "arrow-down-left" | "arrow-up-left" | "swap" | "swap-vertical" | "chevrons-up-down" | "chevrons-left" | "chevrons-right" | "chevrons-down" | "chevrons-up" | "enter" | "undo" | "redo" | "refresh" | "expand" | "collapse" | "fullscreen" | "fullscreen-exit" | "move" | "grip" | "more-vertical" | "trend-up" | "trend-down" | "log-in" | "external" | "slash" | "equal" | "check-small" | "close-small" | "success" | "failure" | "help" | "plus-circle" | "minus-circle" | "ban" | "pending" | "dot" | "dot-off" | "bolt" | "flag" | "pin" | "bookmark" | "heart" | "thumbs-up" | "thumbs-down" | "sparkle" | "target" | "idea" | "award" | "crown" | "bell" | "bell-off" | "bug" | "fire" | "leaf" | "file" | "file-text" | "file-code" | "file-plus" | "file-check" | "file-table" | "file-lock" | "files" | "folder" | "folder-open" | "folder-plus" | "archive" | "clipboard" | "clipboard-check" | "paperclip" | "image" | "save" | "cloud-upload" | "cloud-download" | "cloud-off" | "import" | "export" | "share" | "inbox" | "send" | "box" | "layers" | "tag" | "hash" | "at" | "qr-code" | "book" | "book-open" | "notebook" | "rows" | "columns" | "grid" | "list" | "list-ordered" | "list-checks" | "kanban" | "chart-line" | "chart-bar" | "chart-area" | "chart-parts" | "chart-scatter" | "gauge" | "funnel" | "heatmap" | "sparkline" | "percent" | "sum" | "variable" | "braces" | "brackets" | "null" | "primary-key" | "relation" | "index" | "query" | "backup" | "migrate" | "seed" | "csv" | "json" | "bold" | "italic" | "underline" | "strikethrough" | "heading" | "text" | "paragraph" | "quote" | "code" | "align-left" | "align-center" | "align-right" | "indent" | "outdent" | "unlink" | "scissors" | "eraser" | "highlight" | "duplicate" | "paste" | "wand" | "palette" | "brush" | "ruler" | "crop" | "user-plus" | "user-minus" | "user-check" | "user-x" | "user-circle" | "team" | "organization" | "id-card" | "contact" | "role" | "chat" | "chats" | "comment" | "phone" | "video" | "mic" | "mic-off" | "megaphone" | "rss" | "mail-open" | "handshake" | "wave" | "desktop" | "laptop" | "tablet" | "terminal" | "window" | "browser" | "server" | "cpu" | "memory" | "disk" | "network" | "wifi" | "wifi-off" | "plug" | "power" | "container" | "queue" | "cron" | "webhook" | "api" | "route" | "load-balancer" | "dns" | "domain" | "certificate" | "firewall" | "rocket" | "deploy" | "rollback" | "logs" | "test" | "pipeline" | "commit" | "merge" | "fork" | "release" | "environment" | "region" | "robot" | "agent" | "puzzle" | "credit-card" | "wallet" | "receipt" | "invoice" | "cart" | "bag" | "coins" | "dollar" | "gift" | "plan" | "upgrade" | "usage" | "bank" | "history" | "timer" | "hourglass" | "calendar-check" | "calendar-plus" | "map" | "compass" | "translate" | "accessibility" | "keyboard" | "pointer" | "hand" | "print" | "support" | "stop" | "record" | "skip-forward" | "skip-back" | "fast-forward" | "rewind" | "volume" | "mute" | "camera" | "zoom-in" | "zoom-out" | "eye-off" | "sliders" | "settings" | "toggle" | "sidebar-left" | "sidebar-right" | "panel-bottom" | "split" | "layout" | "dashboard" | "cards" | "density" | "dark-mode" | "theme" | "mouse" | "cursor" | "select" | "picture-in-picture" | "scan" | "unlock" | "shield-off" | "shield-alert" | "shield-user" | "password" | "fingerprint" | "two-factor" | "policy" | "incognito" | "verified" | "audit" | "secret" | "p-telemetry" | "p-cases" | "p-agent" | "p-git" | "p-data" | "p-files" | "p-run" | "p-ai" | "p-mail" | "p-domains" | "p-design" | "p-learn" | "p-skills" | "p-app" | "p-ui" light
tone "fail" | "neutral" neutral
HashTypeDefault
valuerequired string
copy boolean true
label string
length number 7
  1. On a desktop
  2. On a phone
  3. Inside the console
  4. When to use it
  5. For everyone
  6. Props

    Search pages, sections and terms