Documentation
¶
Overview ¶
Package errorpage provides components for presenting structured errors on the web.
Designed as a companion to the go-error-family library, this package renders error families (Rejection, Conflict, Transient, Corruption, Infrastructure) with family-appropriate visual styling — distinct colors, icons, and tone.
The package integrates with go-error-family for type-safe error extraction. FromError() detects errorfamily.Classified errors and extracts family, code, context, cause chain, and default Why/Fix messages automatically. It also prefers a user-safe message (Public(), the oops convention promoted through go-error-family/bridge) over Message()/Error(), and derives a short family-appropriate title (FamilyDefaultTitle) when the error carries no ErrorTitle — so FromError-driven pages always render a heading.
For errors from other sources, use the string-based bridge:
family := errorpage.ParseFamily(myError.ErrorFamily())
Components:
- ErrorPage: Full-page error view for HTTP error responses (4xx/5xx)
- NotFound404: Dedicated 404 page with gradient numeral, search, quick-links
- ErrorDetail: Inline card with context table, cause chain, and fix
- ErrorAlert: Alert banner with family-aware styling
HTTP Handlers:
- ErrorHandler(err, cfg): returns http.Handler with correct status code
- WriteError(w, r, err, nonce): convenience wrapper
- WriteErrorPage(w, r, status, props, nonce): pre-configured page
- WriteNotFound404(w, r, props, nonce): dedicated 404 page fragment
- WriteNotFound404Document(w, r, props, nonce, lang): 404 page wrapped in a standalone HTML document (the NotFound404 equivalent of HTMLShell)
- HTMLShell option: wraps in valid HTML document for standalone responses
- JSON option: renders JSON for API/HTMX endpoints
Every HTML response this package writes carries X-Robots-Tag: noindex, and document shells embed a noindex robots meta — error pages must never be indexed, even when a misconfiguration serves them under a 2xx status (soft 404).
Pre-built constructors: NotFound(), Forbidden(), BadRequest(msg), Conflict(msg), ServiceUnavailable(), InternalError()
Each family maps to a distinct visual treatment:
Family | Color | Icon | Tone Rejection | Amber | ExclamationTriangle | Instructional Conflict | Orange | ExclamationCircle | Explanatory Transient | Blue | Refresh | Reassuring Corruption | Red | ExclamationTriangle | Urgent Infrastructure | Gray | Globe | Apologetic Orchestration | Purple | ExclamationTriangle | Factual
Props reference (shared vocabulary across all three props types):
Field | ErrorPage | ErrorDetail | ErrorAlert | Meaning
Family | ✓ | ✓ | ✓ | Visual treatment + derived defaults; must be a valid Family constant
StatusCode | ✓ | | | HTTP status rendered in the chip row ("HTTP 503"); must be in [400, 599]
Code | ✓ | ✓ | | Machine-readable error code (open enum, e.g. "service.unavailable")
Title | ✓ | ✓ | ✓ | Page/card heading; FromError fills a family default when absent
Message | ✓ | ✓ | ✓ | What happened, user-safe (never log details here)
Why | ✓ | | | Reassurance/context ("this is temporary, no data lost")
Fix | ✓ | ✓ | ✓ | The suggested fix (renders in its own panel)
WayOut | ✓ | | | Primary action label ("Retry"); requires WayOutHref set
WayOutHref | ✓ | | | Primary action destination
SecondaryWayOut | ✓ | | | Ghost/secondary action label ("Contact support"); without a href it goes back in history
SecondaryWayOutHref | ✓ | | | Secondary action destination
WayOutAction | ✓ | | | Typed bundle (text+href); wins over WayOut/WayOutHref when Text is set
MaxWidth | ✓ | | | Card width enum (MaxWidthXL default; LG/2XL/4XL)
Context | ✓ | ✓ | | Key/value diagnostics (region, request_id, ...)
CauseChain | ✓ | ✓ | | Ordered causes, deepest first (message + optional code)
Timestamp | ✓ | ✓ | | RFC3339; FromError uses the error's own when available
Trace | ✓ | ✓ | | Correlation ID (oops.Trace(), promoted via the bridge); footer/JSON field
ShowTimestamp| ✓ | | | Render the timestamp footer at all
Variant | | ✓ | | ErrorDetail shell: Tinted (default) or Neutral (accent bar, ErrorPage parity)
All three embed utils.BaseProps (Class, Attrs, ID, AriaLabel, Nonce) — set them via the embedded struct, not by promoted field name.
Code is an OPEN enum: unlike closed-set enums in this library it ships no IsValid, by design. Codes are consumer-namespaced identifiers ("service.unavailable", "db.pool") — the set is unbounded, every value is renderable, and there is no lookup table to miss. Validation would only reject legitimate consumer codes.
Index ¶
- func ErrorAlert(props ErrorAlertProps) templ.Component
- func ErrorDetail(props ErrorDetailProps) templ.Component
- func ErrorDetailVariantIsValid(v ErrorDetailVariant) bool
- func ErrorHandler(err error, cfg ErrorHandlerConfig) http.Handler
- func ErrorMaxWidthIsValid(w ErrorMaxWidth) bool
- func ErrorPage(props ErrorPageProps) templ.Component
- func FamilyDefaultTitle(f Family) string
- func FamilyIcon(f Family) icons.Name
- func FamilyIsValid(f Family) bool
- func FamilyStatusCode(f Family) int
- func NotFound404(props NotFound404Props) templ.Component
- func WriteError(w http.ResponseWriter, r *http.Request, err error, nonce string)
- func WriteErrorPage(w http.ResponseWriter, r *http.Request, statusCode int, props ErrorPageProps, ...)
- func WriteNotFound404(w http.ResponseWriter, r *http.Request, props NotFound404Props, nonce string)
- func WriteNotFound404Document(w http.ResponseWriter, r *http.Request, props NotFound404Props, ...)
- type CauseItem
- type Code
- type ContextPair
- type ErrorAlertProps
- type ErrorDetailProps
- type ErrorDetailVariant
- type ErrorHandlerConfig
- type ErrorMaxWidth
- type ErrorPageProps
- func BadRequest(message string) ErrorPageProps
- func Conflict(message string) ErrorPageProps
- func DefaultErrorPageProps() ErrorPageProps
- func Forbidden() ErrorPageProps
- func FromError(err error) ErrorPageProps
- func InternalError() ErrorPageProps
- func NotFound() ErrorPageProps
- func ServiceUnavailable() ErrorPageProps
- type Family
- type NotFound404Props
- type NotFoundLink
- type WayOutAction
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorAlert ¶
func ErrorAlert(props ErrorAlertProps) templ.Component
Example ¶
package main
import (
"bytes"
"context"
"fmt"
"github.com/larsartmann/templ-components/errorpage"
)
func main() {
var buf bytes.Buffer
_ = errorpage.ErrorAlert(errorpage.ErrorAlertProps{
Family: errorpage.FamilyTransient,
Title: "Temporary Error",
Message: "Please try again shortly.",
Fix: "Wait a moment and retry.",
}).Render(context.Background(), &buf)
fmt.Println("renders family-aware alert banner")
}
Output: renders family-aware alert banner
func ErrorDetail ¶
func ErrorDetail(props ErrorDetailProps) templ.Component
Example ¶
package main
import (
"bytes"
"context"
"fmt"
"github.com/larsartmann/templ-components/errorpage"
)
func main() {
var buf bytes.Buffer
_ = errorpage.ErrorDetail(errorpage.ErrorDetailProps{
Family: errorpage.FamilyCorruption,
Code: "data.parse_failed",
Title: "Parse Failed",
Message: "config.yaml has invalid syntax.",
Fix: "Check YAML indentation.",
Context: []errorpage.ContextPair{
{Key: "file", Value: "config.yaml"},
{Key: "line", Value: "42"},
},
}).Render(context.Background(), &buf)
fmt.Println("renders inline error detail card")
}
Output: renders inline error detail card
func ErrorDetailVariantIsValid ¶ added in v1.18.1
func ErrorDetailVariantIsValid(v ErrorDetailVariant) bool
ErrorDetailVariantIsValid reports whether v is a known ErrorDetailVariant.
func ErrorHandler ¶
func ErrorHandler(err error, cfg ErrorHandlerConfig) http.Handler
func ErrorMaxWidthIsValid ¶ added in v1.18.1
func ErrorMaxWidthIsValid(w ErrorMaxWidth) bool
ErrorMaxWidthIsValid reports whether w is a known ErrorMaxWidth.
func ErrorPage ¶
func ErrorPage(props ErrorPageProps) templ.Component
Example ¶
package main
import (
"bytes"
"context"
"fmt"
"github.com/larsartmann/templ-components/errorpage"
)
func main() {
var buf bytes.Buffer
_ = errorpage.ErrorPage(errorpage.ErrorPageProps{
Family: errorpage.FamilyTransient,
StatusCode: 503,
Code: errorpage.CodeUnavailable,
Title: "Service temporarily unavailable",
Message: "We're performing maintenance or experiencing high traffic.",
Why: "This is a temporary issue. No data was lost.",
Fix: "Wait a moment and refresh the page.",
WayOut: "Retry",
WayOutHref: "/",
Context: []errorpage.ContextPair{
{Key: "region", Value: "eu-central-1"},
{Key: "request_id", Value: "req_8fk2m1"},
},
CauseChain: []errorpage.CauseItem{{Message: "connection pool exhausted", Code: "db.pool"}},
Timestamp: "2026-09-17T12:00:00Z",
Trace: "trc_9f3a1c2d",
ShowTimestamp: true,
}).Render(context.Background(), &buf)
fmt.Println("renders full-page error view")
}
Output: renders full-page error view
func FamilyDefaultTitle ¶ added in v1.18.1
FamilyDefaultTitle returns the family-derived fallback title for a full error page. Unknown families return the infrastructure (most apologetic) title so a page never renders headingless.
func FamilyIcon ¶
FamilyIcon returns the icon name for a given family.
func FamilyIsValid ¶
FamilyIsValid reports whether the Family value is one of the six defined constants.
func FamilyStatusCode ¶
FamilyStatusCode returns the HTTP status code for a family. Useful for HTTP handlers that need to set the correct response status.
Example ¶
package main
import (
"fmt"
"github.com/larsartmann/templ-components/errorpage"
)
func main() {
fmt.Println(errorpage.FamilyStatusCode(errorpage.FamilyRejection))
fmt.Println(errorpage.FamilyStatusCode(errorpage.FamilyConflict))
fmt.Println(errorpage.FamilyStatusCode(errorpage.FamilyTransient))
fmt.Println(errorpage.FamilyStatusCode(errorpage.FamilyCorruption))
fmt.Println(errorpage.FamilyStatusCode(errorpage.FamilyInfrastructure))
}
Output: 400 409 503 500 503
func NotFound404 ¶
func NotFound404(props NotFound404Props) templ.Component
Example ¶
package main
import (
"bytes"
"context"
"fmt"
"github.com/larsartmann/templ-components/errorpage"
)
func main() {
var buf bytes.Buffer
_ = errorpage.NotFound404(errorpage.DefaultNotFound404Props()).Render(context.Background(), &buf)
fmt.Println("renders dedicated 404 page")
}
Output: renders dedicated 404 page
Example (Custom) ¶
package main
import (
"bytes"
"context"
"fmt"
"github.com/larsartmann/templ-components/errorpage"
)
func main() {
var buf bytes.Buffer
_ = errorpage.NotFound404(errorpage.NotFound404Props{
Numeral: "418", Title: "Teapot Error",
Message: "The server refuses to brew coffee because it is a teapot.",
SearchAction: "/search", GoHomeHref: "/", ShowGoBack: true,
Links: errorpage.DefaultNotFoundLinks(),
}).Render(context.Background(), &buf)
fmt.Println("renders custom error numeral page")
}
Output: renders custom error numeral page
func WriteError ¶
WriteError writes an error page to an http.ResponseWriter. Convenience wrapper around ErrorHandler for simpler usage.
func WriteErrorPage ¶
func WriteErrorPage(w http.ResponseWriter, r *http.Request, statusCode int, props ErrorPageProps, nonce string)
WriteErrorPage writes a pre-configured error page with the given HTTP status code. If statusCode is 0, the status code is derived from props.Family via FamilyStatusCode. Use with the pre-built constructors:
errorpage.WriteErrorPage(w, r, 0, errorpage.NotFound(), "")
func WriteNotFound404 ¶
func WriteNotFound404(w http.ResponseWriter, r *http.Request, props NotFound404Props, nonce string)
WriteNotFound404 writes a NotFound404 page to an http.ResponseWriter with a 404 status code. Convenience wrapper for common 404 handler usage.
func main() {
mux := http.NewServeMux()
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
errorpage.WriteNotFound404(w, r, errorpage.DefaultNotFound404Props(), "")
})
}
The response carries X-Robots-Tag: noindex. Use WriteNotFound404Document when the page is served standalone (no layout component embedding it).
func WriteNotFound404Document ¶ added in v1.24.0
func WriteNotFound404Document(w http.ResponseWriter, r *http.Request, props NotFound404Props, nonce, lang string)
WriteNotFound404Document writes the NotFound404 page wrapped in a minimal standalone HTML document (DOCTYPE, html lang, head with title and a noindex robots meta) with a 404 status code. Use it when nothing else renders the surrounding document — the ErrorHandler HTMLShell equivalent for the dedicated 404 page. Consumers with a layout component keep using WriteNotFound404 and render the fragment inside their own shell.
lang sets the <html lang="..."> attribute and defaults to "en" when empty. The response carries X-Robots-Tag: noindex.
Types ¶
type CauseItem ¶
CauseItem represents one error in a cause chain.
func ExtractCauseChain ¶
ExtractCauseChain walks an error's Unwrap() chain and returns CauseItems. Useful for bridging go-error-family errors to errorpage props. Handles both single-error Unwrap() chains and errors.Join siblings (Unwrap() []error, Go 1.20+). Stops after maxDepth levels to prevent infinite chains.
Example ¶
package main
import (
"fmt"
"github.com/larsartmann/templ-components/errorpage"
)
func main() {
chain := errorpage.ExtractCauseChain(&outerError{}, 10)
fmt.Println(len(chain))
}
type innerError struct{}
func (e *innerError) Error() string { return "connection refused" }
type outerError struct{}
func (e *outerError) Error() string { return "database unavailable" }
func (e *outerError) Unwrap() error { return &middleError{} }
type middleError struct{}
func (e *middleError) Error() string { return "connection pool exhausted" }
func (e *middleError) Unwrap() error { return &innerError{} }
Output: 2
type ContextPair ¶
ContextPair is a key-value pair from an error's context map.
func ContextMap ¶
func ContextMap(m map[string]string) []ContextPair
ContextMap converts a map[string]string to a []ContextPair slice. Useful for bridging go-error-family's ErrorContext() to errorpage props.
Example ¶
package main
import (
"fmt"
"github.com/larsartmann/templ-components/errorpage"
)
func main() {
ctx := errorpage.ContextMap(map[string]string{
"host": "db.internal",
"port": "5432",
})
fmt.Println(len(ctx))
}
Output: 2
type ErrorAlertProps ¶
type ErrorAlertProps struct {
utils.BaseProps
Family Family
Title string
Message string
Fix string
Dismissible bool
}
ErrorAlertProps configures an alert banner derived from an error family.
func DefaultErrorAlertProps ¶
func DefaultErrorAlertProps() ErrorAlertProps
DefaultErrorAlertProps returns sensible defaults.
type ErrorDetailProps ¶
type ErrorDetailProps struct {
utils.BaseProps
Family Family
Code Code
Title string
Message string
Fix string
Context []ContextPair
CauseChain []CauseItem
Timestamp string
Trace string
// Variant selects the card shell (Tinted default; Neutral adds a family
// accent bar over a neutral shell). Empty/unknown renders Tinted.
Variant ErrorDetailVariant
}
ErrorDetailProps configures an inline error detail card.
func DefaultErrorDetailProps ¶
func DefaultErrorDetailProps() ErrorDetailProps
DefaultErrorDetailProps returns sensible defaults.
type ErrorDetailVariant ¶ added in v1.18.1
type ErrorDetailVariant string
ErrorDetailVariant selects the card shell treatment for ErrorDetail. Unknown or empty values render Tinted (the pre-variant look), matching the library's map+fallback convention — zero-value props keep rendering exactly as before the variant existed.
const ( // ErrorDetailTinted (default) keeps the family-tinted background and // border — the compact alert-like card. ErrorDetailTinted ErrorDetailVariant = "tinted" // ErrorDetailNeutral renders a neutral card shell with a family-colored // accent bar on top — visual parity with the redesigned ErrorPage, for // inline placement in content that already carries color (dashboards, // side panels, tinted sections). ErrorDetailNeutral ErrorDetailVariant = "neutral" )
type ErrorHandlerConfig ¶
type ErrorHandlerConfig struct {
// Nonce is used for CSP-compliant inline scripts.
Nonce string
// Override allows per-error customization of the ErrorPageProps
// before rendering. When the returned pointer is non-nil, its values
// replace the derived props. When nil, the original derived props are used.
Override func(err error, props ErrorPageProps) *ErrorPageProps
// HTMLShell wraps the error page in a minimal HTML document with
// DOCTYPE, html, head, title, and body tags. Use when the error page
// is served as a standalone HTTP response (not embedded in an existing layout).
HTMLShell bool
// JSON renders a JSON error response instead of HTML.
// The response includes family, code, message, title, why, and fix fields.
// Use for API endpoints or HTMX error handling.
JSON bool
// Lang sets the <html lang="..."> attribute when HTMLShell is true.
// Defaults to "en" when empty.
Lang string
}
ErrorHandlerConfig controls how ErrorHandler renders errors.
type ErrorMaxWidth ¶ added in v1.18.1
type ErrorMaxWidth string
ErrorMaxWidth selects the ErrorPage card's max width. It is a closed-set enum; unknown values fall back to MaxWidthXL (map+fallback convention).
const ( ErrorMaxWidthLG ErrorMaxWidth = "lg" ErrorMaxWidthXL ErrorMaxWidth = "xl" ErrorMaxWidth2XL ErrorMaxWidth = "2xl" ErrorMaxWidth4XL ErrorMaxWidth = "4xl" )
type ErrorPageProps ¶
type ErrorPageProps struct {
utils.BaseProps
Family Family
StatusCode int
Code Code
Title string
Message string
Why string
Fix string
WayOut string
WayOutHref string
// WayOutAction is the typed bundle for the primary action. When Text is
// set it wins entirely over the loose WayOut/WayOutHref strings (no
// mixing) — callers may adopt it without touching existing fields.
WayOutAction WayOutAction
// SecondaryWayOut renders a secondary (ghost) action next to the primary
// way out ("View status page", "Contact support"). With a
// SecondaryWayOutHref it renders as a link; without one it behaves like
// the primary's no-href variant (go back in history).
SecondaryWayOut string
SecondaryWayOutHref string
// CopyCode renders a copy-to-clipboard icon button next to the error
// code chip (opt-in; requires Nonce for the CSP-safe script).
CopyCode bool
// MaxWidth caps the card width. Empty/unknown renders MaxWidthXL (the
// pre-field look).
MaxWidth ErrorMaxWidth
Context []ContextPair
CauseChain []CauseItem
Timestamp string
Trace string
ShowTimestamp bool
}
ErrorPageProps configures a full-page error view.
func BadRequest ¶
func BadRequest(message string) ErrorPageProps
BadRequest returns a 400-style error page.
func Conflict ¶
func Conflict(message string) ErrorPageProps
Conflict returns a 409-style error page.
func DefaultErrorPageProps ¶
func DefaultErrorPageProps() ErrorPageProps
DefaultErrorPageProps returns sensible defaults.
func FromError ¶
func FromError(err error) ErrorPageProps
FromError converts any error into ErrorPageProps. Extracts code, family, context, and cause chain from structured errors. For go-error-family errors, also extracts Why/Fix defaults. StatusCode is derived from the family (FamilyStatusCode) so standalone FromError renders match what the HTTP handler writes — the HTTP chip shows a real status. When the error (or its type) carries no ErrorTitle, a short family-derived title fills in via FamilyDefaultTitle so the page never renders headingless. Falls back to Corruption family for unrecognized errors (HTTP 500), since an unknown error is most likely a bug rather than a temporary outage.
func InternalError ¶
func InternalError() ErrorPageProps
InternalError returns a 500-style error page.
func ServiceUnavailable ¶
func ServiceUnavailable() ErrorPageProps
ServiceUnavailable returns a 503-style error page.
func (ErrorPageProps) Validate ¶
func (p ErrorPageProps) Validate() error
Validate verifies that the props form a coherent error page. Returns an error when:
- Family is not one of the six defined constants (FamilyIsValid).
- StatusCode is set but outside the HTTP error range [400, 599].
- The page has no Title AND no Message AND no CauseChain (would render as an empty error card — likely a caller bug).
Validate is intentionally permissive about optional fields (Why, Fix, WayOut, Context) — those are presentation, not correctness.
type Family ¶
type Family string
Family classifies an error's behavioral profile for web presentation. Mirrors the go-error-family library's 6 families — consumers bridge with trivial string constants.
Each family maps to a distinct visual treatment (color, icon, tone) that communicates the error's nature to the user without technical jargon.
const ( // FamilyRejection indicates bad input, unauthorized access, or resource not found. // Tone: helpful, instructional. Visual: amber. FamilyRejection Family = "rejection" // FamilyConflict indicates version mismatch, duplicate creation, or state machine violation. // Tone: explanatory. Visual: orange. FamilyConflict Family = "conflict" // FamilyTransient indicates a temporary infrastructure failure. // Tone: reassuring. Visual: blue. FamilyTransient Family = "transient" // FamilyCorruption indicates the source of truth is damaged. // Tone: urgent. Visual: red. FamilyCorruption Family = "corruption" // FamilyInfrastructure indicates the system cannot serve. // Tone: apologetic. Visual: gray. FamilyInfrastructure Family = "infrastructure" // FamilyOrchestration indicates an internal coordination failure (bug, misconfiguration). // Tone: factual. Visual: purple. FamilyOrchestration Family = "orchestration" )
func FamilyFromStatus ¶ added in v1.24.0
FamilyFromStatus maps an HTTP status code to the closest error Family — the inverse of FamilyStatusCode for consumers that only have a status (reverse proxies, upstream fetches, logging pipelines) and until now had to hand-roll the same switch.
Mapping (canonical):
409 → Conflict (the status IS the conflict definition)
429, 503 → Transient (retry-later semantics)
502, 504 → Infrastructure (gateway cannot reach upstream)
500, 501, 505+ → Corruption (the server itself is broken; matches the
library-wide precedent that unknown errors are
Corruption, NOT Infrastructure)
other 4xx → Rejection (client-side problem)
anything else → Rejection (non-error codes never reach an error page;
Rejection is the least-wrong documented default)
The forward map is many-to-one in two places (Corruption and Orchestration both map to 500; Transient and Infrastructure both map to 503), so the inverse cannot be exact: an Infrastructure status collapses to Transient and an Orchestration status collapses to Corruption. The STATUS-level round-trip still holds for every family: FamilyStatusCode(FamilyFromStatus(FamilyStatusCode(f))) == FamilyStatusCode(f).
Example ¶
package main
import (
"fmt"
"github.com/larsartmann/templ-components/errorpage"
)
func main() {
fmt.Println(errorpage.FamilyFromStatus(404))
fmt.Println(errorpage.FamilyFromStatus(409))
fmt.Println(errorpage.FamilyFromStatus(429))
fmt.Println(errorpage.FamilyFromStatus(502))
fmt.Println(errorpage.FamilyFromStatus(503))
fmt.Println(errorpage.FamilyFromStatus(500))
}
Output: rejection conflict transient infrastructure transient corruption
func FromErrorFamily ¶
func FromErrorFamily(f errorfamily.Family) Family
FromErrorFamily converts a go-error-family Family to an errorpage Family. Uses a typed switch (not string round-trip) so that any rename or removal of a Family constant in go-error-family becomes a compile error here, not a silent runtime collapse to FamilyTransient.
func ParseFamily ¶
ParseFamily parses a family string (case-insensitive) into a Family. Returns FamilyTransient for unrecognized values.
type NotFound404Props ¶
type NotFound404Props struct {
utils.BaseProps
Numeral string
Title string
Message string
SearchAction string
SearchPlaceholder string
SearchInputName string
SearchSubmitLabel string
Links []NotFoundLink
LinksTitle string
GoHomeHref string
GoHomeText string
GoBackText string
ShowGoBack bool
}
func DefaultNotFound404Props ¶
func DefaultNotFound404Props() NotFound404Props
Example ¶
package main
import (
"fmt"
"github.com/larsartmann/templ-components/errorpage"
)
func main() {
props := errorpage.DefaultNotFound404Props()
fmt.Println(props.Numeral)
fmt.Println(props.Title)
}
Output: 404 Page not found
type NotFoundLink ¶
func DefaultNotFoundLinks ¶
func DefaultNotFoundLinks() []NotFoundLink
Example ¶
package main
import (
"fmt"
"github.com/larsartmann/templ-components/errorpage"
)
func main() {
links := errorpage.DefaultNotFoundLinks()
fmt.Println("links:", len(links))
}
Output: links: 2
type WayOutAction ¶ added in v1.18.1
WayOutAction bundles a recovery action's label with its destination. Href empty means a history-back button (the browser-native way out).