@biem/ui

Empty

A placeholder that tells users why a view has no content and how to continue.

An empty state takes the place of content that is not there, such as a list without entries or a search without results. Its title names what is missing, and its description explains why or tells users how to continue.

No transfers yet
Transfers between the warehouse and the store appear here as soon as the first one is sent.

Usage

empty-default.tsx
import {
	Empty,
	EmptyDescription,
	EmptyHeader,
	EmptyTitle,
} from "@biem/ui/components/ui/empty";

export function EmptyDefault() {
	return (
		<Empty>
			<EmptyHeader>
				<EmptyTitle>No transfers yet</EmptyTitle>
				<EmptyDescription>
					Transfers between the warehouse and the store appear here as soon as the first one is sent.
				</EmptyDescription>
			</EmptyHeader>
		</Empty>
	);
}

Examples

Default Media

A picture tells users at a glance which kind of content is missing, before they read a word. With variant left at "default", the media keeps the size the picture brings along, so an illustration can carry a view that has nothing else to show.

No deliveries today
The warehouse ships the next 12 cases on Monday, and the store receives them on Tuesday.

Icon Media

Where empty states recur across a product, such as a filter without matches or an archive without entries, a small sign should mark them without competing with the explanation. Set to "icon", variant gives every icon the same size and setting, so these empty states stay consistent and an icon needs no size of its own.

No items found
No item matches the search. Check the spelling or search by item number.

With Action

Many empty views have a remedy that users can apply themselves, such as adding a first entry or importing a list. Placed in EmptyContent, an action lets them take that step on the spot, so the empty state leads onward instead of ending the task.

No open orders
The store has no order waiting for the warehouse. Create one to restock before Friday.

API Reference

Empty

Empty holds the header and the content and centers them in the area it fills. It renders a div and has no props of its own.

EmptyHeader

EmptyHeader groups the media, the title and the description. It renders a div and has no props of its own.

EmptyMedia

Propvariant
Type"default" | "icon"
Default"default"
DescriptionControls how the media is presented. With "default", the media keeps its own size on a transparent background. With "icon", it sits in a small rounded square with a muted background that sizes the icon inside it.

EmptyTitle

EmptyTitle names what is missing. It renders a div and has no props of its own.

EmptyDescription

EmptyDescription explains why the content is missing or tells users how to continue. It renders a div and has no props of its own.

EmptyContent

EmptyContent holds actions below the header and stacks them in a centered column. It renders a div and has no props of its own.