Feedback
EmptyState
One frame for an empty or loading region.
import { EmptyState, LoadingState } from 'faifo-design'EmptyState is the same frame and size wherever a region is empty: an illustration, a title, a
message and an optional next step. Its badge names why the region is empty: nothing yet, first use,
no match, cleared, or not allowed. LoadingState holds the region while its content is read.
#When to use
- Say why the region is empty and what the reader can do about it.
- Use
visual="search"after filters that match nothing,startto invite the first record,donefor a cleared queue andlockedfor a region the reader may not see. - Tables and lists show their own empty state; do not wrap them in another.
#Examples
Each example is a specimen of the package catalogue, rendered on the server exactly as shown in its code.
#Empty and loading
Explicit state preserves layout and gives the reader a next step.
No saved views
Save the current filters to reuse them later.
Show codeHide code
import { Button, EmptyState, Grid, LoadingState, Surface } from 'faifo-design'
export const Example = () => (
<Grid
columns={2}
items={[
<Surface
body={
<EmptyState
visual="start"
title="No saved views"
message="Save the current filters to reuse them later."
actions={<Button label="Save current view" size="compact" />}
/>
}
/>,
<Surface body={<LoadingState label="Loading order history" lines={3} />} />,
]}
/>
)#Empty state visuals
One frame and size everywhere; the badge names why the region is empty: nothing yet, first use, no match, cleared or not allowed.
No activity
Changes to this record appear here.
No products yet
Add the first product to start selling.
No matching orders
Clear the filters to see every order.
Nothing to review
Every receipt has been checked.
Costs are hidden
Ask an accountant for access to purchase costs.
Show codeHide code
import { Button, EmptyState, Grid } from 'faifo-design'
export const Example = () => (
<Grid
columns={3}
items={[
<EmptyState title="No activity" message="Changes to this record appear here." />,
<EmptyState
visual="start"
title="No products yet"
message="Add the first product to start selling."
actions={<Button label="Add product" size="compact" />}
/>,
<EmptyState
visual="search"
title="No matching orders"
message="Clear the filters to see every order."
actions={<Button label="Clear filters" size="compact" variant="secondary" />}
/>,
<EmptyState
visual="done"
title="Nothing to review"
message="Every receipt has been checked."
/>,
<EmptyState
visual="locked"
title="Costs are hidden"
message="Ask an accountant for access to purchase costs."
/>,
]}
/>
)#Empty state with a long search term
Unbroken titles and search terms wrap within narrow panels without losing text.
REFERENCEREFERENCEREFERENCEREFERENCEREFERENCEREFERENCEREFERENCEREFERENCEREFERENCEREFERENCEREFERENCEREFERENCE
No match for “WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW”. Clear the filters to try again.
Show codeHide code
import { Button, EmptyState } from 'faifo-design'
export const Example = () => (
<EmptyState
visual="search"
title={'REFERENCE'.repeat(12)}
message={`No match for “${'W'.repeat(100)}”. Clear the filters to try again.`}
actions={<Button label="Clear filters" />}
/>
)#Contract
#Empty states and long content
EmptyState has one frame and one size in every context: a dashed placeholder panel
(--faifo-radius-lg, surface fill, minimum height 15rem) holding a decorative illustration, the
title, the message and an optional next step. It is a placeholder, not a card, so it reads the same
on the canvas and inside a Surface; consumers do not wrap it in another frame or resize it. The
optional visual names why the region is empty through the illustration badge: empty (default,
nothing yet), start (first use, invite the first record), search (filters match nothing), done
(a cleared queue) and locked (the reader may not see the region). icon still replaces only the
badge glyph. A titled DataTable keeps its panel inset while empty and runs rows edge to edge once
there are rows. The backend kit's positional emptyState(message, hint, { visual, actions })
renders this component too, so older screens share the frame; its icon option is deprecated and
ignored. See empty-visuals in the catalogue.
Thumbnail({ src, alt, size, fit }) renders square object/product media, with
token-owned rounded corners and 32/48/64px sizes (small/default/large). It uses
cover by default; contain preserves the whole image. A missing source reserves
the same geometry with an image glyph, never person initials. Supply an empty
alt beside text that already identifies the product; otherwise name the image.
A Thumbnail in ContentCard.leading keeps its own size (the slot's 2rem icon tile
does not apply to it); keep Avatar for people. Source URLs and image authorization
remain the consumer's concern.
A catalogue card whose picture identifies the item passes the Thumbnail as media
with mediaPlacement: 'start'. The picture is a 6rem square (5rem below 48rem) beside
all of the card's content instead of edge to edge above it (top, the default), and
meta becomes the item's key-figure row: it spans the content, sits at its end and
uses the main ink, so a price and a status line up across a row of cards. Put the
code and unit line in summary. Collect such cards in CardGrid so the column count
follows the width. See attachments-media in the catalogue.
A ContentCard with href is one target, like a table row with rowHref: its
title link covers the whole card, so pressing anywhere opens it, and the card wears
the focus outline while that link has keyboard focus. Any other link, button or
control inside the card stays pressable above the covering link. Use a pair of such
cards (leading icon, title, one-line summary) for ways into other screens
instead of a row of buttons; do not wrap a card in a second anchor.
EmptyState wraps complete titles and messages, including unbroken search terms, inside
its available width. Its grid column can shrink and text breaks where needed; consumers
do not clip the content or truncate the reader’s query. See empty-long-content in the catalogue.
#API
Generated from the package source. A property without a description has none in the source yet.
#EmptyStateComponent
One frame and one size wherever a region is empty: a dashed placeholder panel holding an illustration, the title, the message and an optional next step. The panel owns its inset and minimum height, so a list, a record table and a dashboard block show the same state.
| Property | Description | Type | Default |
|---|---|---|---|
titlerequired | – | string | – |
messagerequired | – | string | – |
actions | – | JSXChild | – |
visual | – | EmptyVisual | 'empty' |
icon | Replaces the badge glyph of the chosen visual. | IconName | – |
#LoadingStateComponent
| Property | Description | Type | Default |
|---|---|---|---|
labelrequired | – | string | – |
lines | – | number | – |
#Types
#EmptyVisual
Why the region is empty, shown as the badge on the illustration. empty is the neutral default; start invites the first record, search follows filters that match nothing, done marks a cleared queue and locked a region the reader may not see.
type EmptyVisual = 'empty' | 'start' | 'search' | 'done' | 'locked'