@zedtech/zedkit-ui
Fill a list's loading, empty, error and success states
One host per state: Spinner, EmptyState, ErrorState, then the filled list.
alpha
View props table
Usage
Empty
Error
Success
At a glance
- Who: Developers swapping a list between wait, nothing, failure, and rows.
- What: One host per state: Spinner, EmptyState, ErrorState, then the filled list.
- Use when: On a list page that loads from the network.
- Avoid when: For an empty row inside a table body — use
DataTableEmpty. For a field error — useFieldError. - See also: Name a spinner while something loads, Show an empty zone with a next step, Show what broke and a next step, Show a sortable, filterable, paginated data table
Preview
@zedtech/zedkit-ui — Spinner, EmptyState, ErrorState, DataTable, Button, Text, createDataTableColumns
Preview
Loading invoices
Install
pnpm add @zedtech/zedkit-uiLatest: 0.6.4 (via changesets).
Example
import { Spinner, Text } from "@zedtech/zedkit-ui";
<Spinner label="Loading invoices" />
<Text>Loading invoices</Text>Live preview: Empty
Preview
No invoices
Create an invoice to send to a client.
import { Button, EmptyState } from "@zedtech/zedkit-ui";
<EmptyState
title="No invoices"
description="Create an invoice to send to a client."
actions={<Button>New invoice</Button>}
/>Live preview: Error
Preview
import { Button, ErrorState } from "@zedtech/zedkit-ui";
<ErrorState
title="Could not load invoices"
description="Check your connection and try again."
actions={<Button variant="outline">Try again</Button>}
/>Live preview: Success
Preview
| Ada | 36 |
| Bob | 30 |
import { DataTable, createDataTableColumns } from "@zedtech/zedkit-ui";
const helper = createDataTableColumns<{ name: string; age: number }>();
const columns = [helper.accessor("name", { header: "Name" })];
<DataTable columns={columns} data={[{ name: "Ada", age: 36 }]} />Wraps: (none)
Props
Prop
Type