ComponentsOverlays & feedback
Points to the next step when a list is empty, a search finds nothing, access is denied or something failed. Five kinds with default icons and copy, three sizes, an illustration slot and a dashed frame. Server-compatible.
components/empty-state.tsx, styles/overlays.csstheme · material · accent · density · font
Installation
$ pnpm add @vamos-ui/react
The whole kit as one package — get updates by bumping the version. Add the styles to globals.css: @import "@vamos-ui/react/styles.css";
Usage
import { EmptyState, Button } from "@vamos-ui/react";
<EmptyState
title="No posts yet"
description="Write your first post."
actions={<Button variant="primary">Write a post</Button>}
/>Examples
No results (CRM)
kind="no-results" is announced with role="status". Offer "Clear filters".
Inside a table (HR)
size="sm" fits a table body or a card.
| Employee | Type | Until |
|---|---|---|
No access
Say who can grant access.
Error
kind="error" with a "Try again" action; framed draws the dashed border.
Sizes
sm for cards, md for page sections, lg for a whole page (display font title).
API
EmptyState
| Prop | Type | Default |
|---|---|---|
kindDefault icon, tint and title (dictionary empty.*). | "first-use" | "no-results" | "error" | "forbidden" | "done" | "first-use" |
sizesm inside a table/card, md a page section, lg a full page. | "sm" | "md" | "lg" | "md" |
titleDefaults to the kind's dictionary text. | ReactNode | — |
descriptionWhy it's empty and what to do. | ReactNode | — |
actionsOne primary next step, optionally a secondary one. | ReactNode | — |
iconReplace the kind's icon, or none. | ReactNode | false | — |
illustrationA larger picture in place of the icon well. | ReactNode | — |
framedDashed frame — empty columns and drop zones. | boolean | false |
asTitle element — match the page outline. | "h2" | "h3" | "h4" | "p" | "h3" |
EmptyStateIcon / EmptyStateTitle / EmptyStateDescription / EmptyStateActions
| Prop | Type | Default |
|---|---|---|
classNameParts for a custom arrangement. Title and Description take size; Title takes as. | string | — |