Skip to content

Error Page

Full-page error display with musical illustrations. Auto-resolves title and description from HTTP status code.

Demo

Vælg fejlkode

?
404

Denne side spiller ikke

Vi kunne ikke finde den node, du ledte efter. Den er måske blevet flyttet eller slettet.


Props

PropTypeDefaultDescription
codenumber404HTTP status code
titlestringautoError title (auto-generated from code)
descriptionstringautoError description (auto-generated)
showHomeLinkbooleantrueShow home button
homeHrefstring'/'Home link URL
homeLabelstring'Gå til forsiden'Home button text
debugobjectDebug info ({ url, statusCode, message, stack })

Slots

SlotDescription
illustrationCustom illustration (replaces default SVG)
actionsCustom action buttons (replaces home link)
defaultExtra content below actions

Usage

Basic (Nuxt error.vue)

vue
<script setup>
import { GTErrorPage } from '@grundtone/vue';

const props = defineProps({ error: Object });
const isDev = import.meta.dev;
</script>

<template>
  <GTErrorPage
    :code="error?.statusCode ?? 500"
    :debug="isDev ? error : undefined"
  />
</template>

Custom title and actions

vue
<GTErrorPage
  :code="403"
  title="Ingen adgang"
  description="Du skal logge ind for at se denne side."
>
  <template #actions>
    <a href="/login" class="gt-btn gt-btn--primary gt-btn--md">Log ind</a>
    <a href="/" class="gt-btn gt-btn--outlined gt-btn--md">Forsiden</a>
  </template>
</GTErrorPage>

Custom illustration

vue
<GTErrorPage :code="404">
  <template #illustration>
    <img src="/custom-404.svg" alt="Not found" />
  </template>
</GTErrorPage>

Supported codes

CodeTitleIllustration
400Forkert taktMissing note
403Øverummet er lukketLock on staff
404Denne side spiller ikkeMissing note with ?
500Noget gik galt i orkestretBroken staff lines
502Dirigenten svarer ikkeBroken staff lines
503Vi stemmer instrumenternePause symbol

Unknown codes fall back to "En uventet fejl" with the missing-note illustration.


CSS classes

See Design System Error Page reference for all available CSS classes.