Empty state
Say that there is nothing here yet and offer the next step.
SourceStyles source@monoline/react 0.4.0Markdown for AI toolsstable
- Built on native elements
- Plain heading and text; put the action in children as a button or link.
- Styles in one file:
empty-state.css
Import
import '@monoline/css';
import {EmptyState} from '@monoline/react';
Not installed yet? Pick a route.
Copies the source and its styles into your project.
npx monoline add empty-state
Usage
import {Button, EmptyState} from '@monoline/react';
<EmptyState title="No projects yet" description="Projects you create show up here.">
<Button variant="solid">New project</Button>
</EmptyState>
Examples
With an action
Props
EmptyStateProps
| Prop | Type | Default | Description |
|---|---|---|---|
title required | ReactNode | – | Short headline saying what is missing, for example "No projects yet". |
description | ReactNode | – | Optional sentence explaining why it is empty or what to do next. |
icon | ReactNode | – | Optional inline SVG, `aria-hidden`. |
children | ReactNode | – | The next step: a Button or link. |
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 |
|---|---|
.empty | empty-state.css |
.empty-actions | empty-state.css |
.empty-description | empty-state.css |
.empty-icon | empty-state.css |
.empty-title | empty-state.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
.empty {
border-color: var(--accent);
}
Accessibility
- Plain heading and text; put the action in children as a button or link.