Empty page block
A full-page message for not found, nothing yet or no access.
SourceStyles source@monoline/react 0.5.0Markdown for AI toolsbeta
- 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
| Prop | Type | Default | Description |
|---|---|---|---|
code | ReactNode | – | A short code such as "404" or "Empty". Decorative. |
title required | ReactNode | – | The message headline, for example "Page not found". |
description | ReactNode | – | Optional muted sentence explaining what happened or what to do next. |
actions | ReactNode | – | The way out: a solid Button or link, and maybe a second. |
headingLevel | 1 | 2 | 3 | 1 | Outline 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
| Class | Stylesheet |
|---|---|
.heading | heading.css |
.heading-display | heading.css |
.heading-lg | heading.css |
.heading-md | heading.css |
.heading-sm | heading.css |
.heading-xl | heading.css |
.text | text.css |
.text-accent | text.css |
.text-danger | text.css |
.text-full | text.css |
.text-lg | text.css |
.text-md | text.css |
.text-muted | text.css |
.text-ok | text.css |
.text-sm | text.css |
.text-success | text.css |
.text-truncate | text.css |
.text-warning | text.css |
.text-xs | text.css |
.block-empty-page | block-empty-page.css |
.block-empty-page-actions | block-empty-page.css |
.block-empty-page-code | block-empty-page.css |
.block-empty-page-description | block-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.