EmptyState
- Status
- Implemented
- Family
- 8 of 13
- Registry
- @lopifi/empty-state
npx shadcn@latest add @lopifi/theme @lopifi/empty-stateThe component, rendering
Real data, the shipped component. Switch the theme to check the claims the spec makes below.
The four-layer spec
Three variants, and they are genuinely different components:
| Variant | Illustration | Content |
|---|---|---|
first-run |
Isometric spot, 160px | "No transactions yet" + explanation + one primary action |
filtered |
None | "No transactions match these filters" + "Clear filters" |
period |
None | "No transactions between 1–30 Sep 2026" + "Widen the period" |
An illustration on the filtered variant is condescending — the user knows exactly what happened and wants the fix, not a picture.
Always exactly one clear next action. An empty state with no action is a dead end.
description is one line. The particulars — which three filters are active, what the import actually does before anything posts — go in detail, behind the ⓘ on the title. An empty state is read at a glance.
Illustration entrance: back-to-front, 60ms stagger, 8px translate, 320ms --ease-out, total capped at 480ms, never loops. Spec.
Lifted verbatim from System & states. The doc and this page are the same paragraphs, so they cannot disagree.
What lands in your repository
One component is never one file. Everything below is copied into your project, where you own it.
- Files
components/ledger/empty-state.tsx
- npm packages
- @base-ui-components/reactclass-variance-authorityclsxtailwind-merge
- Registry entry
- /r/empty-state.json
The whole component
No compiled bundle, no black box. This is the file the registry copies, and the file you will edit.
import * as React from "react";
import { cn } from "@/lib/ledger/cn";
import { Button } from "@/components/ledger/button";
import { InfoTip } from "@/components/ledger/info-tip";
import { type IsometricScene, IsometricSpot } from "@/components/ledger/isometric-spot";
export interface EmptyStateProps extends React.ComponentPropsWithoutRef<"div"> {
actionLabel: string;
/** One short line. Anything longer than a line belongs in `detail`. */
description?: string;
/**
* The particulars — which three filters are active, what the setup actually
* does — behind the ⓘ beside the title. An empty state is read at a glance;
* the person who wants the specifics will ask for them.
*/
detail?: React.ReactNode;
onAction?: () => void;
scene?: IsometricScene;
title: string;
/** Three genuinely different components sharing one shell. */
variant?: "first-run" | "filtered" | "period";
}
/**
* Always exactly one clear next action. An empty state with no action is a
* dead end.
*
* No illustration on `filtered` — the user knows exactly what happened and
* wants the fix, not a picture.
*/
export const EmptyState = React.forwardRef<HTMLDivElement, EmptyStateProps>(
(
{
className,
variant = "first-run",
title,
description,
detail,
actionLabel,
onAction,
scene = "ledger",
...props
},
ref,
) => (
<div
className={cn("flex flex-col items-center justify-center gap-4 px-6 py-16 text-center", className)}
ref={ref}
{...props}
>
{variant === "first-run" ? <IsometricSpot scene={scene} size="spot" /> : null}
<div className="max-w-[340px] space-y-1.5">
<p className="text-title-sm font-medium">
{title}
{detail ? (
<InfoTip
about={`More about: ${title}`}
className="text-left"
triggerClassName="ml-1.5 align-[-1px]"
>
{detail}
</InfoTip>
) : null}
</p>
{description ? <p className="text-body text-text-secondary">{description}</p> : null}
</div>
<Button onClick={onAction} variant={variant === "first-run" ? "primary" : "secondary"}>
{actionLabel}
</Button>
</div>
),
);
EmptyState.displayName = "EmptyState";
The accounting it encodes
Concepts this component renders. Each one is defined once, in the lexicon, and used identically in the code and the copy.
Also in System & states
- ErrorStateWith the financial reassurance sentence.
- SkeletonStructural, per-component.
- StaleIndicatorLast-synced + retry.
- ToastSonner, configured to our tokens.
- CommandPaletteMotionless. Money-aware search.
- SheetVaul, configured. The mobile primary overlay.
- HoldToConfirmIrreversible actions, with accessible fallbacks.
- DensityTogglePersisted, synced, phone-clamped.
See also
A component is specified in one place, defined in another, and running in a third. All three, from here.
- System & states — the family specThe four-layer specification this component was built against, before it was written.Doc
- States, density and system componentsThe family running, with real figures in it, in both themes and at every density.Live
- CatalogAll 179 components, specified before they are written.Doc
- TransactionA business event — a payment, a sale, a purchaseTerm
Elsewhere in the system
Where EmptyState sits in the rest of the system — the live section it renders in, the calculators that compute what it displays, and the ledger payloads it is fed from.
Components are copied into your repository and meant to be edited — rounding policy, fiscal calendar and compliance copy differ per company.
Told when System & states changes
Components are copied into your repo, so a fix here does not reach you on its own. One email when a component in this family changes in a way that needs a migration — and nothing when it does not.