Empty state
Centered icon + title + copy + optional action for a list/table with no data yet.
Preview
No jobs
No jobsCreate your first job to get started.
<div class="nx-empty">
<span class="nx-empty__icon" aria-hidden="true">▤</span>
<span class="nx-empty__title">No jobs</span>
<span>Create your first job to get started.</span>
<button class="nx-btn nx-btn--primary nx-btn--sm" type="button"
style="margin-top:8px">Create job</button>
</div><NxEmptyState
icon="▤"
title="No jobs"
action={<NxButton className="nx-btn--sm">Create job</NxButton>}
>
Create your first job to get started.
</NxEmptyState>API
React props (NxKit)
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
title | ReactNode | Required | What is empty. | |
action | ReactNode | Required | The next step. Required. | |
icon | ReactNode | undefined | Decorative, aria-hidden. |
Classes
| Class | Description |
|---|---|
.nx-empty | Centered column, padded |
.nx-empty__icon | Decorative, aria-hidden |
.nx-empty__title | Ink, semibold |
Accessibility
- The icon is aria-hidden; the title + copy carry the meaning.
- Always offer the next action (a button) rather than a dead end.
Do / Don’t
- Do: Always pair the empty message with a primary next action.Don't ship an empty table/list cell with no guidance at all.