Playground

Empty page block

A full-page message for not found, nothing yet or no access.

  • Built on native elements
  • A section named by its title, with the title as the page heading.
  • The large code is decorative and hidden from assistive technology.
  • Styles in one file: heading.css

Import

import '@monoline/css';
import {BlockEmptyPage} from '@monoline/react';

Not installed yet? Pick a route.

Copies the source and its styles into your project.

npx monoline add block-empty-page

Usage

import {BlockEmptyPage, Button} from '@monoline/react';

<BlockEmptyPage
  code="404"
  title="Page not found"
  description="The address may be wrong, or the page moved."
  actions={<><Button variant="solid">Go home</Button><Button variant="line">Contact support</Button></>}
/>

Examples

Not found

Nothing yet

Props

BlockEmptyPageProps

PropTypeDefaultDescription
codeReactNode–A short code such as "404" or "Empty". Decorative.
title requiredReactNode–The message headline, for example "Page not found".
descriptionReactNode–Optional muted sentence explaining what happened or what to do next.
actionsReactNode–The way out: a solid Button or link, and maybe a second.
headingLevel1 | 2 | 31Outline level of the title. A full-page empty state is usually the page's h1.

Data Attributes

State is exposed through attributes. Style it with these selectors, not with class toggles.

This component sets no state attributes.

CSS classes

ClassStylesheet
.headingheading.css
.heading-displayheading.css
.heading-lgheading.css
.heading-mdheading.css
.heading-smheading.css
.heading-xlheading.css
.texttext.css
.text-accenttext.css
.text-dangertext.css
.text-fulltext.css
.text-lgtext.css
.text-mdtext.css
.text-mutedtext.css
.text-oktext.css
.text-smtext.css
.text-successtext.css
.text-truncatetext.css
.text-warningtext.css
.text-xstext.css
.block-empty-pageblock-empty-page.css
.block-empty-page-actionsblock-empty-page.css
.block-empty-page-codeblock-empty-page.css
.block-empty-page-descriptionblock-empty-page.css

Customization

Style it with the kit's tokens in your own CSS, loaded after @monoline/css. Prefer the attributes above over extra classes. See Theming for every token.

app.css
.heading {
  border-color: var(--accent);
}

Accessibility

  • A section named by its title, with the title as the page heading.
  • The large code is decorative and hidden from assistive technology.