- Docs
- Components
- Feedback
Empty state
The message where content would be: nothing yet, no results, or an error. DataState picks the right one.
- Import
- @qeetrix/react/experimental
- Status
- ExperimentalSince 0.0.4
- Renders
<div>Server-rendered- Tested
- WCAG 2.2 AAaxe on every pull request
01
Playground
Every prop, live, and the code it takes.
No users yet
Invite your team, or connect a directory to sync them.
import { PlusIcon, UsersIcon } from "@qeetrix/icons";
import { Button } from "@qeetrix/react";
import { EmptyState } from "@qeetrix/react/experimental";
<EmptyState
icon={UsersIcon}
title="No users yet"
description="Invite your team, or connect a directory to sync them."
actions={<Button icon={PlusIcon}>Invite users</Button>}
/>02
Nothing yet
A 24px icon, what's missing, why and what to do, and one primary action.
No users yet
Invite your team, or connect a directory to sync them.
<EmptyState
icon={UsersIcon}
title="No users yet"
description="Invite your team, or connect a directory to sync them."
actions={<Button icon={PlusIcon}>Invite users</Button>}
/>03
No results
Say what was searched for, and the way back.
No users match “priya.s”
Check the spelling, or search by email.
<EmptyState
size="section"
icon={SearchXIcon}
title="No users match “priya.s”"
description="Check the spelling, or search by email."
actions={<Button variant="soft" icon={FunnelXIcon}>Clear search</Button>}
/>04
An error
tone="danger" colours the icon. Say that what matters is safe, and how to try again.
Couldn't load API keys
Your keys are safe. Try again in a moment.
<EmptyState
size="section"
tone="danger"
icon={CircleAlertIcon}
title="Couldn't load API keys"
description="Your keys are safe. Try again in a moment."
actions={<Button variant="soft">Try again</Button>}
/>05
A second way in
children, under the actions in small subtle text: a link to the docs, or another way to start.
No API keys yet
Create a key to call the Management API.
<EmptyState size="section" icon={KeyRoundIcon} title="No API keys yet" … actions={…}>
<Link href="/docs/api-keys">About API keys</Link>
</EmptyState>06
Every state
DataState: loading, then error, then empty, then the content. The raw error is never shown; onRetry adds Try again.
<DataState
loading={isLoading}
error={error}
empty={keys.length === 0}
emptyState={<EmptyState size="section" title="No API keys yet" … />}
onRetry={refetch}
>
<KeyList keys={keys} />
</DataState>