Skip to content

Status mark and result page

The round mark by tone, and the one-purpose page it sits on, centered in the window.

<div class="cap-specimen-row" id="sm-marks">
  <span class="cap-status-mark" data-tone="ok" aria-hidden="true"><svg viewBox="0 0 24 24" focusable="false"><path d="M5 12.5l4.5 4.5L19 7.5" /></svg></span>
  <span class="cap-status-mark" data-tone="crit" aria-hidden="true"><svg viewBox="0 0 24 24" focusable="false"><path d="M6 6l12 12M18 6 6 18" /></svg></span>
  <span class="cap-status-mark" data-tone="warn" aria-hidden="true"><svg viewBox="0 0 24 24" focusable="false"><path d="M12 6v7M12 17.5v.5" /></svg></span>
  <span class="cap-status-mark" data-tone="info" aria-hidden="true"><svg viewBox="0 0 24 24" focusable="false"><path d="M12 11v7M12 6.5v.5" /></svg></span>
</div>

Installation

// package.json: "capsomer": "github:DrDustinEdwards/capsomer#v0.152.2"
import "capsomer/tokens.css";
import "capsomer/base.css";
import "capsomer/status-mark.css";

Usage

import { ResultPage } from "capsomer/react/status-mark";
import "capsomer/panel.css";
import "capsomer/status-mark.css";
<ResultPage title="Unsubscribed" tone="ok" actions={<a href="/">Return to Example Co</a>}>
  You have been unsubscribed.
</ResultPage>

Examples

Done

<div data-mount="done"></div>

A link that is not valid

<div data-mount="invalid"></div>

Asking first, with no mark

<div data-mount="confirm"></div>

API reference

StatusMark

PropTypeRequiredDoes
toneMarkToneYes

ResultPage

PropTypeRequiredDoes
titlestringYesThe page's h1: "Unsubscribed", "Link not valid".
titleHiddenbooleanHide the h1 visually (a page whose sentence is its visible heading). Default false.
toneMarkToneThe mark over the sentence; none while the page still asks (a confirm step).
childrenReactNodeYesThe sentence: what happened. A polite status, so the result is announced after a post.
actionsReactNodeThe one action (a confirm button, its form) and the way back.
brandReactNodeThe site's mark or wordmark above the card.

CSS variables

VariableDefault
--tonevar(--ok)
--tone-softvar(--ok-soft)

Parts and data attributes

ClassIs
.cap-resultits own class
.cap-result-actionsits own class
.cap-result-bodyits own class
.cap-result-textits own class
.cap-result-titleits own class
.cap-status-markthe root
AttributeValues
data-tonecrit info ok warn
StateRead from
:focusthe platform

Accessibility

KeyDoes
TabThe site header, then the card's action and the way back
  • One main, one h1. The mark is aria-hidden; tone is never conveyed by the mark alone.
  • The sentence reaches 4.5:1 on the card.