Skip to content
ui8kit

block / support

Error Page

A page for something that went wrong, such as a missing page: a code, a heading, a sentence and the way back.

Install

npx ui8kit add error-page

Pulls in: action-group, compose, kit-text, media-frame, section-frame, text, utils

Preview

This page could not be found

The link may be old, or the page may have moved.

404

Code

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework svelte --dir src --registry-url https://registry.buildy.tw/svelte --strict-cdn
npx ui8kit add error-page
blocks/error-page.svelte
<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->
<!--
  A page that tells the visitor something went wrong: an icon or a big code, a heading, a sentence and the way
  back. Axes: layout (centered, split: the picture beside the text), code (show, hide), actions mode (one, two),
  tone.
-->
<script lang="ts" module>
  import type { Snippet } from "svelte";
  import type { LinkActions } from "./error-page.types";

  export type ErrorPageProps = {
    id: string;
    title: string;
    text: string;
    status: string;
    actions: LinkActions;
    level?: 1 | 2;
    layout?: "centered" | "split";
    code?: "show" | "hide";
    tone?: "default" | "muted";
    image?: string;
    imageAlt?: string;
    landmarkLabel?: string;
  };
</script>

<script lang="ts">
  import Text from "../compose/Text.svelte";
  import ActionGroup from "../components/action-group.svelte";
  import MediaFrame from "../components/media-frame.svelte";
  import SectionFrame from "../components/section-frame.svelte";
  import { cn } from "../utils";

  let {
    id,
    title,
    text,
    status,
    actions,
    level = 1,
    layout = "centered",
    code = "show",
    tone = "default",
    image,
    imageAlt,
    landmarkLabel,
  }: ErrorPageProps = $props();
</script>

<SectionFrame
  id={id}
  title={title}
  lead={text}
  heading={{ level }}
  layout={(((layout as string) === "split") ? "split" : "stack")}
  media={{ show: ((layout as string) === "split") }}
  align={(((layout as string) === "split") ? "start" : "center")}
  tone={tone}
  density="roomy"
  landmarkLabel={landmarkLabel}
>
  {#if ((code as string) === "show")}
    <Text
      size="4xl"
      weight="bold"
      class={cn(
        "text-8xl text-muted-foreground",
        (((layout as string) === "split") ? "" : "text-center")
      )}
      data-slot="error-code"
    >
      {status}
    </Text>
  {/if}
  <ActionGroup
    primary={actions.cta}
    primaryHref={actions.href}
    secondary={((actions.mode === "two") ? actions.secondary : undefined)}
    secondaryHref={actions.secondaryHref}
    align={(((layout as string) === "split") ? "start" : "center")}
  />
  {#snippet aside()}
    <MediaFrame alt={(imageAlt ? imageAlt : title)} src={image} ratio="4/3" />
  {/snippet}
</SectionFrame>
blocks/error-page.types.ts
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.

export type LinkActions = {
  /** one or two links */
  mode?: "one" | "two";
  /** primary action label */
  cta: string;
  /** the address of the primary action; none: a button, not a link */
  href?: string;
  secondary?: string;
  secondaryHref?: string;
};

Svelte registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework react --dir src --registry-url https://registry.buildy.tw/react --strict-cdn
npx ui8kit add error-page
blocks/error-page.tsx
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
/**
 * A page that tells the visitor something went wrong: an icon or a big code, a heading, a sentence and the way
 * back. Axes: layout (centered, split: the picture beside the text), code (show, hide), actions mode (one, two),
 * tone.
 */
import { type ReactNode } from "react";
import { Text } from "../compose";
import { ActionGroup } from "../components/action-group";
import { MediaFrame } from "../components/media-frame";
import { SectionFrame } from "../components/section-frame";
import { cn } from "../utils";
import type { LinkActions } from "./error-page.types";

export type ErrorPageProps = {
  id: string;
  title: string;
  text: string;
  status: string;
  actions: LinkActions;
  level?: 1 | 2;
  layout?: "centered" | "split";
  code?: "show" | "hide";
  tone?: "default" | "muted";
  image?: string;
  imageAlt?: string;
  landmarkLabel?: string;
};

export function ErrorPage({
  id,
  title,
  text,
  status,
  actions,
  level = 1,
  layout = "centered",
  code = "show",
  tone = "default",
  image,
  imageAlt,
  landmarkLabel,
}: ErrorPageProps) {
  return (
    <SectionFrame
      id={id}
      title={title}
      lead={text}
      heading={{ level }}
      layout={(((layout as string) === "split") ? "split" : "stack")}
      media={{ show: ((layout as string) === "split") }}
      align={(((layout as string) === "split") ? "start" : "center")}
      tone={tone}
      density="roomy"
      landmarkLabel={landmarkLabel}
      aside={(
        <MediaFrame alt={(imageAlt ? imageAlt : title)} src={image} ratio="4/3" />
      )}
    >
      {((code as string) === "show") ? (
        <Text
          size="4xl"
          weight="bold"
          className={cn(
            "text-8xl text-muted-foreground",
            (((layout as string) === "split") ? "" : "text-center")
          )}
          data-slot="error-code"
        >
          {status}
        </Text>
      ) : null}
      <ActionGroup
        primary={actions.cta}
        primaryHref={actions.href}
        secondary={((actions.mode === "two") ? actions.secondary : undefined)}
        secondaryHref={actions.secondaryHref}
        align={(((layout as string) === "split") ? "start" : "center")}
      />
    </SectionFrame>
  );
}
blocks/error-page.types.ts
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.

export type LinkActions = {
  /** one or two links */
  mode?: "one" | "two";
  /** primary action label */
  cta: string;
  /** the address of the primary action; none: a button, not a link */
  href?: string;
  secondary?: string;
  secondaryHref?: string;
};

React registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework vue --dir src --registry-url https://registry.buildy.tw/vue --strict-cdn
npx ui8kit add error-page
blocks/error-page.types.ts
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.

export type LinkActions = {
  /** one or two links */
  mode?: "one" | "two";
  /** primary action label */
  cta: string;
  /** the address of the primary action; none: a button, not a link */
  href?: string;
  secondary?: string;
  secondaryHref?: string;
};
blocks/error-page.vue
<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->
<!--
  A page that tells the visitor something went wrong: an icon or a big code, a heading, a sentence and the way
  back. Axes: layout (centered, split: the picture beside the text), code (show, hide), actions mode (one, two),
  tone.
-->
<script lang="ts">
import type { LinkActions } from "./error-page.types";

export type ErrorPageProps = {
  id: string;
  title: string;
  text: string;
  status: string;
  actions: LinkActions;
  level?: 1 | 2;
  layout?: "centered" | "split";
  code?: "show" | "hide";
  tone?: "default" | "muted";
  image?: string;
  imageAlt?: string;
  landmarkLabel?: string;
};
</script>

<script setup lang="ts">
import Text from "../compose/Text.vue";
import ActionGroup from "../components/action-group.vue";
import MediaFrame from "../components/media-frame.vue";
import SectionFrame from "../components/section-frame.vue";
import { cn } from "../utils";

const {
  id,
  title,
  text,
  status,
  actions,
  level = 1,
  layout = "centered",
  code = "show",
  tone = "default",
  image,
  imageAlt,
  landmarkLabel,
} = defineProps<ErrorPageProps>();
</script>

<template>
  <SectionFrame
    :id="id"
    :title="title"
    :lead="text"
    :heading="{ level }"
    :layout="(((layout as string) === 'split') ? 'split' : 'stack')"
    :media="{ show: ((layout as string) === 'split') }"
    :align="(((layout as string) === 'split') ? 'start' : 'center')"
    :tone="tone"
    density="roomy"
    :landmarkLabel="landmarkLabel"
  >
    <Text v-if="((code as string) === 'show')"
      size="4xl"
      weight="bold"
      :class="cn(
        'text-8xl text-muted-foreground',
        (((layout as string) === 'split') ? '' : 'text-center')
      )"
      data-slot="error-code"
    >
      {{ status }}
    </Text>
    <ActionGroup
      :primary="actions.cta"
      :primaryHref="actions.href"
      :secondary="((actions.mode === 'two') ? actions.secondary : undefined)"
      :secondaryHref="actions.secondaryHref"
      :align="(((layout as string) === 'split') ? 'start' : 'center')"
    />
    <template #aside>
      <MediaFrame :alt="(imageAlt ? imageAlt : title)" :src="image" ratio="4/3" />
    </template>
  </SectionFrame>
</template>

Vue registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework solid --dir src --registry-url https://registry.buildy.tw/solid --strict-cdn
npx ui8kit add error-page
blocks/error-page.tsx
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
/**
 * A page that tells the visitor something went wrong: an icon or a big code, a heading, a sentence and the way
 * back. Axes: layout (centered, split: the picture beside the text), code (show, hide), actions mode (one, two),
 * tone.
 */
import { type JSX } from "solid-js";
import { Text } from "../compose";
import { ActionGroup } from "../components/action-group";
import { MediaFrame } from "../components/media-frame";
import { SectionFrame } from "../components/section-frame";
import { cn } from "../utils";
import type { LinkActions } from "./error-page.types";

export type ErrorPageProps = {
  id: string;
  title: string;
  text: string;
  status: string;
  actions: LinkActions;
  level?: 1 | 2;
  layout?: "centered" | "split";
  code?: "show" | "hide";
  tone?: "default" | "muted";
  image?: string;
  imageAlt?: string;
  landmarkLabel?: string;
};

export function ErrorPage({
  id,
  title,
  text,
  status,
  actions,
  level = 1,
  layout = "centered",
  code = "show",
  tone = "default",
  image,
  imageAlt,
  landmarkLabel,
}: ErrorPageProps) {
  return (
    <SectionFrame
      id={id}
      title={title}
      lead={text}
      heading={{ level }}
      layout={(((layout as string) === "split") ? "split" : "stack")}
      media={{ show: ((layout as string) === "split") }}
      align={(((layout as string) === "split") ? "start" : "center")}
      tone={tone}
      density="roomy"
      landmarkLabel={landmarkLabel}
      aside={(
        <MediaFrame alt={(imageAlt ? imageAlt : title)} src={image} ratio="4/3" />
      )}
    >
      {((code as string) === "show") ? (
        <Text
          size="4xl"
          weight="bold"
          class={cn(
            "text-8xl text-muted-foreground",
            (((layout as string) === "split") ? "" : "text-center")
          )}
          data-slot="error-code"
        >
          {status}
        </Text>
      ) : null}
      <ActionGroup
        primary={actions.cta}
        primaryHref={actions.href}
        secondary={((actions.mode === "two") ? actions.secondary : undefined)}
        secondaryHref={actions.secondaryHref}
        align={(((layout as string) === "split") ? "start" : "center")}
      />
    </SectionFrame>
  );
}
blocks/error-page.types.ts
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.

export type LinkActions = {
  /** one or two links */
  mode?: "one" | "two";
  /** primary action label */
  cta: string;
  /** the address of the primary action; none: a button, not a link */
  href?: string;
  secondary?: string;
  secondaryHref?: string;
};

Solid registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework templ --dir src --registry-url https://registry.buildy.tw/templ --strict-cdn
npx ui8kit add error-page
blocks/error-page.templ
// Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
// Source: packages/compose-gen/specs/organisms/error-page.json

package blocks

import (
	"github.com/ui8kit/codegen/generated/templ/compose"
	"github.com/ui8kit/codegen/generated/templ/ui/text"
	uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)

// ErrorPageProps are the props of ErrorPage; the values are the JSON shapes of the TypeScript props.
type ErrorPageProps struct {
	Id any `json:"id"`
	Title any `json:"title"`
	Text any `json:"text"`
	Status any `json:"status"`
	Actions any `json:"actions"`
	Level any `json:"level"`
	Layout any `json:"layout"`
	Code any `json:"code"`
	Tone any `json:"tone"`
	Image any `json:"image"`
	ImageAlt any `json:"imageAlt"`
	LandmarkLabel any `json:"landmarkLabel"`
}

// A page that tells the visitor something went wrong: an icon or a big code, a heading, a sentence and the way back. Axes: layout (centered, split: the picture beside the text), code (show, hide), actions mode (one, two), tone.
templ ErrorPage(p ErrorPageProps) {
	{{ vId := p.Id }}
	{{ vTitle := p.Title }}
	{{ vText := p.Text }}
	{{ vStatus := p.Status }}
	{{ vActions := p.Actions }}
	{{ vLevel := uiutils.Def(p.Level, float64(1)) }}
	{{ vLayout := uiutils.Def(p.Layout, "centered") }}
	{{ vCode := uiutils.Def(p.Code, "show") }}
	{{ vTone := uiutils.Def(p.Tone, "default") }}
	{{ vImage := p.Image }}
	{{ vImageAlt := p.ImageAlt }}
	{{ vLandmarkLabel := p.LandmarkLabel }}
	@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Lead: vText, Heading: map[string]any{"level": vLevel}, Layout: uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "split")), "split", "stack"), Media: map[string]any{"show": uiutils.Eq(vLayout, "split")}, Align: uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "split")), "start", "center"), Tone: vTone, Density: "roomy", LandmarkLabel: vLandmarkLabel, Aside: errorPageFill1(p, vTitle, vImage, vImageAlt)}) {
		if uiutils.Eq(vCode, "show") {
			@compose.Text(compose.TextProps{Size: "4xl", Weight: "bold", TextProps: text.TextProps{Class: uiutils.S(uiutils.Cnv("text-8xl text-muted-foreground", uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "split")), "", "text-center"))), Attrs: uiutils.Attrs("data-slot", "error-code")}}) {
				{ uiutils.Text(vStatus) }
			}
		}
		@ActionGroup(ActionGroupProps{Primary: uiutils.Get(vActions, "cta"), PrimaryHref: uiutils.Get(vActions, "href"), Secondary: uiutils.Cond(uiutils.T(uiutils.Eq(uiutils.Get(vActions, "mode"), "two")), uiutils.Get(vActions, "secondary"), nil), SecondaryHref: uiutils.Get(vActions, "secondaryHref"), Align: uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "split")), "start", "center")})
	}
}

templ errorPageFill1(p ErrorPageProps, vTitle any, vImage any, vImageAlt any) {
	@MediaFrame(MediaFrameProps{Alt: uiutils.Cond(uiutils.T(vImageAlt), vImageAlt, vTitle), Src: vImage, Ratio: "4/3"})
}

templ registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework twig --dir src --registry-url https://registry.buildy.tw/twig --strict-cdn
npx ui8kit add error-page
blocks/error-page.html.twig
{#- Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
    Source: packages/compose-gen/specs/organisms/error-page.json
    A page that tells the visitor something went wrong: an icon or a big code, a heading, a sentence and the way back. Axes: layout (centered, split: the picture beside the text), code (show, hide), actions mode (one, two), tone.
    Props (p): id, title, text, status, actions, level, layout, code, tone, image, imageAlt, landmarkLabel. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_title = (p.title ?? null) -%}
{%- set v_text = (p.text ?? null) -%}
{%- set v_status = (p.status ?? null) -%}
{%- set v_actions = (p.actions ?? null) -%}
{%- set v_level = (p.level ?? 1) -%}
{%- set v_layout = (p.layout ?? 'centered') -%}
{%- set v_code = (p.code ?? 'show') -%}
{%- set v_tone = (p.tone ?? 'default') -%}
{%- set v_image = (p.image ?? null) -%}
{%- set v_imageAlt = (p.imageAlt ?? null) -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set f_2 -%}
  {{ include('blocks/media-frame.html.twig', {'p': {'alt': (og_t(v_imageAlt) ? v_imageAlt : v_title), 'src': v_image, 'ratio': '4/3'}}, with_context = false) }}
{%- endset -%}
{%- set c_3 -%}
  {%- if og_t(og_eq(v_code, 'show')) %}
    {%- set c_1 -%}
      {{ og_text(v_status) }}
    {%- endset -%}
    {{ include('compose/Text.html.twig', {'size': '4xl', 'weight': 'bold', 'class': og_s(og_cnv(['text-8xl text-muted-foreground', (og_t(og_eq(v_layout, 'split')) ? '' : 'text-center')])), 'attrs': og_attrs(['data-slot', 'error-code']), 'children': c_1}, with_context = false) }}
  {%- endif %}
  {{ include('blocks/action-group.html.twig', {'p': {'primary': og_get(v_actions, ['cta']), 'primaryHref': og_get(v_actions, ['href']), 'secondary': (og_t(og_eq(og_get(v_actions, ['mode']), 'two')) ? og_get(v_actions, ['secondary']) : null), 'secondaryHref': og_get(v_actions, ['secondaryHref']), 'align': (og_t(og_eq(v_layout, 'split')) ? 'start' : 'center')}}, with_context = false) }}
{%- endset -%}
{{ include('blocks/section-frame.html.twig', {'p': {'id': v_id, 'title': v_title, 'lead': v_text, 'heading': {'level': v_level}, 'layout': (og_t(og_eq(v_layout, 'split')) ? 'split' : 'stack'), 'media': {'show': og_eq(v_layout, 'split')}, 'align': (og_t(og_eq(v_layout, 'split')) ? 'start' : 'center'), 'tone': v_tone, 'density': 'roomy', 'landmarkLabel': v_landmarkLabel, 'aside': og_markup(f_2)}, 'children': og_markup(c_3)}, with_context = false) }}

Twig registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework latte --dir src --registry-url https://registry.buildy.tw/latte --strict-cdn
npx ui8kit add error-page
blocks/error-page.latte
{* Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
    Source: packages/compose-gen/specs/organisms/error-page.json
    A page that tells the visitor something went wrong: an icon or a big code, a heading, a sentence and the way back. Axes: layout (centered, split: the picture beside the text), code (show, hide), actions mode (one, two), tone.
    Props (p): id, title, text, status, actions, level, layout, code, tone, image, imageAlt, landmarkLabel. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_title = ($p['title'] ?? null)}
{var $v_text = ($p['text'] ?? null)}
{var $v_status = ($p['status'] ?? null)}
{var $v_actions = ($p['actions'] ?? null)}
{var $v_level = ($p['level'] ?? 1)}
{var $v_layout = ($p['layout'] ?? 'centered')}
{var $v_code = ($p['code'] ?? 'show')}
{var $v_tone = ($p['tone'] ?? 'default')}
{var $v_image = ($p['image'] ?? null)}
{var $v_imageAlt = ($p['imageAlt'] ?? null)}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{capture $f_2}
  {=og_include('blocks/media-frame.latte', ['p' => ['alt' => (og_t($v_imageAlt) ? $v_imageAlt : $v_title), 'src' => $v_image, 'ratio' => '4/3']])|noescape}
{/capture}
{capture $c_3}
  {if og_t(og_eq($v_code, 'show'))}
    {capture $c_1}
      {=og_text($v_status)}
    {/capture}
    {=og_include('compose/Text.latte', ['size' => '4xl', 'weight' => 'bold', 'class' => og_s(og_cnv(['text-8xl text-muted-foreground', (og_t(og_eq($v_layout, 'split')) ? '' : 'text-center')])), 'attrs' => og_attrs(['data-slot', 'error-code']), 'children' => (string) $c_1])|noescape}
  {/if}
  {=og_include('blocks/action-group.latte', ['p' => ['primary' => og_get($v_actions, ['cta']), 'primaryHref' => og_get($v_actions, ['href']), 'secondary' => (og_t(og_eq(og_get($v_actions, ['mode']), 'two')) ? og_get($v_actions, ['secondary']) : null), 'secondaryHref' => og_get($v_actions, ['secondaryHref']), 'align' => (og_t(og_eq($v_layout, 'split')) ? 'start' : 'center')]])|noescape}
{/capture}
{=og_include('blocks/section-frame.latte', ['p' => ['id' => $v_id, 'title' => $v_title, 'lead' => $v_text, 'heading' => ['level' => $v_level], 'layout' => (og_t(og_eq($v_layout, 'split')) ? 'split' : 'stack'), 'media' => ['show' => og_eq($v_layout, 'split')], 'align' => (og_t(og_eq($v_layout, 'split')) ? 'start' : 'center'), 'tone' => $v_tone, 'density' => 'roomy', 'landmarkLabel' => $v_landmarkLabel, 'aside' => og_markup($f_2)], 'children' => og_markup($c_3)])|noescape}

Latte registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework jinja2 --dir src --registry-url https://registry.buildy.tw/jinja2 --strict-cdn
npx ui8kit add error-page
blocks/error-page.html.j2
{#- Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
    Source: packages/compose-gen/specs/organisms/error-page.json
    A page that tells the visitor something went wrong: an icon or a big code, a heading, a sentence and the way back. Axes: layout (centered, split: the picture beside the text), code (show, hide), actions mode (one, two), tone.
    Props (p): id, title, text, status, actions, level, layout, code, tone, image, imageAlt, landmarkLabel. -#}
{%- set v_id = og_def(p['id'], none) -%}
{%- set v_title = og_def(p['title'], none) -%}
{%- set v_text = og_def(p['text'], none) -%}
{%- set v_status = og_def(p['status'], none) -%}
{%- set v_actions = og_def(p['actions'], none) -%}
{%- set v_level = og_def(p['level'], 1) -%}
{%- set v_layout = og_def(p['layout'], 'centered') -%}
{%- set v_code = og_def(p['code'], 'show') -%}
{%- set v_tone = og_def(p['tone'], 'default') -%}
{%- set v_image = og_def(p['image'], none) -%}
{%- set v_imageAlt = og_def(p['imageAlt'], none) -%}
{%- set v_landmarkLabel = og_def(p['landmarkLabel'], none) -%}
{%- set f_2 -%}
  {{ og_include('blocks/media-frame.html.j2', {'p': {'alt': (v_imageAlt if og_t(v_imageAlt) else v_title), 'src': v_image, 'ratio': '4/3'}}) }}
{%- endset -%}
{%- set c_3 -%}
  {%- if og_t(og_eq(v_code, 'show')) %}
    {%- set c_1 -%}
      {{ og_text(v_status) }}
    {%- endset -%}
    {{ og_include('compose/text.html.j2', {'p': {'Size': '4xl', 'Weight': 'bold', 'Class': og_s(og_cnv(['text-8xl text-muted-foreground', ('' if og_t(og_eq(v_layout, 'split')) else 'text-center')])), 'Attrs': og_attrs(['data-slot', 'error-code'])}, 'children': c_1}) }}
  {%- endif %}
  {{ og_include('blocks/action-group.html.j2', {'p': {'primary': og_get(v_actions, ['cta']), 'primaryHref': og_get(v_actions, ['href']), 'secondary': (og_get(v_actions, ['secondary']) if og_t(og_eq(og_get(v_actions, ['mode']), 'two')) else none), 'secondaryHref': og_get(v_actions, ['secondaryHref']), 'align': ('start' if og_t(og_eq(v_layout, 'split')) else 'center')}}) }}
{%- endset -%}
{{ og_include('blocks/section-frame.html.j2', {'p': {'id': v_id, 'title': v_title, 'lead': v_text, 'heading': {'level': v_level}, 'layout': ('split' if og_t(og_eq(v_layout, 'split')) else 'stack'), 'media': {'show': og_eq(v_layout, 'split')}, 'align': ('start' if og_t(og_eq(v_layout, 'split')) else 'center'), 'tone': v_tone, 'density': 'roomy', 'landmarkLabel': v_landmarkLabel, 'aside': og_markup(f_2)}, 'children': og_markup(c_3)}) }}

Jinja2 registry item (JSON)

Props

Names and types come from the xgen specs of the source. Standard HTML attributes (id, role, tabIndex, aria-*) pass through to the root element; the class prop is className in React.

A page that tells the visitor something went wrong: an icon or a big code, a heading, a sentence and the way back. Axes: layout (centered, split: the picture beside the text), code (show, hide), actions mode (one, two), tone.

Props of ErrorPage
PropTypeDefault Description
id (required)string-
title (required)string-
text (required)string-
status (required)string-the status code, e.g. 404
actions (required)LinkActions-the way back: one link, or two (mode two)
level 1 | 21
layout "centered" | "split""centered"
code "show" | "hide""show"
tone "default" | "muted""default"
image string-address of the picture (an https URL or a path); none: the placeholder
imageAlt string-alt text of the picture; none: the title
landmarkLabel string-accessible name of the landmark of this component when the page shows it more than once (a variant); replaces the heading name of the root landmark, follows the name of a nested one

Used in