Result

A full-size outcome screen, with ready-made 404, 403 and 500 pages.

Installation

Import the class, and @use the entry point in your global styles: without it the component renders unstyled.

import { Component } from '@angular/core';
import { WrResult, WrResult403, WrResult404, WrResult500 } from 'ngwr/result';

@Component({ imports: [WrResult, WrResult403, WrResult404, WrResult500] })
export class MyComponent {}

Statuses

status is success, warning, error, info (default) or empty.

<wr-result status="success" title="Submitted" />
<wr-result status="warning" title="Heads up" />
<wr-result status="error" title="Failed" />
<wr-result status="info" title="In review" />
<wr-result status="empty" title="No projects" />

Submitted

Heads up

Failed

In review

No projects

With an action

Mark a projected button with wrResultExtra to offer the next step.

<wr-result status="success" title="Submitted!" description="We'll be in touch.">
  <button wr-btn type="button" color="primary" wrResultExtra>Continue</button>
</wr-result>

Submitted!

We'll be in touch.

Presets

<wr-result-404>, <wr-result-403> and <wr-result-500> take title and description to replace their text.

<wr-result-404 />
<wr-result-403 />
<wr-result-500 />

<!-- Custom copy: -->
<wr-result-404 title="Lost?" description="That URL didn't lead anywhere." />

404

Sorry, the page you visited does not exist.

403

Sorry, you are not authorized to access this page.

500

Sorry, something went wrong.

API

NameDescriptionTypeDefault
titleThe headline — the outcome in a few words. Pair it with description for the detail; a result with neither renders the illustration alone.string''
descriptionSecondary line under the title. Say what happens next, not what went wrong again — the title has already said it.string''
statusWhich illustration and tint to draw. empty is the quiet one, for a list with nothing in it rather than for something that failed.WrResultStatus'info'

CSS variables

Set these on the component's selector or a wrapper, not on :root: the defaults are declared on ngwr/result's own element.

VariableDefaultDeclared on
--wr-result-description-font-sizevar(--wr-text-sm).wr-result
--wr-result-description-line-heightvar(--wr-leading-relaxed).wr-result
--wr-result-extra-gapvar(--wr-space-sm).wr-result
--wr-result-extra-margin-topvar(--wr-space-sm).wr-result
--wr-result-font-familyvar(--wr-font-family-base).wr-result
--wr-result-gapvar(--wr-space-md).wr-result
--wr-result-padding-xvar(--wr-space-xl).wr-result
--wr-result-padding-yvar(--wr-space-xl).wr-result
--wr-result-title-font-sizevar(--wr-text-2xl).wr-result
--wr-result-title-font-weightvar(--wr-font-weight-semibold).wr-result
--wr-result-title-letter-spacingvar(--wr-tracking-tight).wr-result
--wr-result-title-line-heightvar(--wr-leading-tight).wr-result

See also