The app's mark over Loading, shown in place of a page while a slow navigation loads.
<main>
<div class="cap-route-splash" id="splash" role="status">
<img class="cap-route-splash-mark" src="/icon-192.png" alt="Example Co" width="96" height="96" />
<p class="cap-route-splash-label">Loading...</p>
</div>
</main>
Installation
// package.json: "capsomer": "github:DrDustinEdwards/capsomer#v0.152.2"
import "capsomer/tokens.css";
import "capsomer/base.css";
import "capsomer/route-splash.css";
import { normalPath, shouldShowRouteSplash } from "capsomer/behavior/route-splash";
import "capsomer/tokens.css";
import "capsomer/route-splash.css";
import { RouteSplash } from "capsomer/react/route-splash";
Usage
<div class="cap-route-splash" role="status">
<img class="cap-route-splash-mark" src="/icon-512.png" alt="Example Co" width="96" height="96" />
<p class="cap-route-splash-label">Loading...</p>
</div>
API reference
RouteSplash
| Prop | Type | Required | Does |
|---|
mark | { src: string; alt: string } | Yes | The app's mark, 96px square. |
|---|
label | ReactNode | | |
|---|
Functions
| Function | Signature | Does |
|---|
normalPath | (pathname: string): string | A trailing slash is the same page. |
|---|
shouldShowRouteSplash | (navigation: SplashNavigation, isSplashPath: (pathname: string) => boolean): boolean | |
|---|
Parts and data attributes
| Class | Is |
|---|
.cap-route-splash | the root |
|---|
.cap-route-splash-label | a part |
|---|
.cap-route-splash-mark | a part |
|---|
Accessibility
None: it holds no control, and focus stays where the navigation left it.
role="status" announces "Loading..." once.- The label is
--muted on --ground and reaches 4.5:1 (checked in the spec).