Skip to content
TopClass UI

Empty state

What a list, a table or a search shows when there is nothing to show: an icon, a line, a sentence and your own action.

server - 0 KB

Empty state

server - 0 KB

What a list, a table or a search shows when there is nothing to show: an icon, a line, a sentence and your own action.

Install

Nothing here yet

When there is something to show, it will appear here.

The code

empty-state.tsx
import { EmptyState } from 'topclassui/empty-state'

/** No props at all: the tray icon, then the English title and description from labels. */
export default function Demo() {
  return (
    <div className="max-w-85">
      <EmptyState />
    </div>
  )
}

With no props it shows the tray icon and the two labels.state strings; a title of your own drops the default description.

Every state

5 states

Nothing here yet

When there is something to show, it will appear here.

Title only

With action

The action is the caller's own Button.

Failed

Check your connection, then try again.

Filtered

Nothing matches that search.

Import from the package

topclassui/empty-state
import { EmptyState } from 'topclassui/empty-state'

Install once:npm i topclassui@beta zod

Examples

  • Pass a title and the default description goes too, because it would describe the wrong thing.
  • null hides the icon, the title or the description.
  • The action is your own Button, passed as children; the component draws none of its own.
  • A search with no match or a list that failed to load is another icon and title, not a variant.
default

Nothing here yet

When there is something to show, it will appear here.
with-action

No projects yet

Create your first project and it will show up here.
New project
filtered

No matches

Nothing matches that search. Try fewer words, or clear the filters.
failed

The invoices did not load

Check your connection, then try again.
title-only

No comments yet

long-text

Nothing in https://example.com/workspaces/finance/reports/2026/quarterly/archive/unfiled

Files you move into this folder will show up here, newest first.
In Arabic, right to left

لا يوجد شيء بعد

عندما يصبح هناك ما يُعرض، سيظهر هنا.
مشروع جديد

Props

The props of EmptyState
PropTypeDefaultLimitsDescription
childrenReactNode--The action, which the caller passes as a Button. The component draws none of its own.
descriptionReactNode--Defaults to labels.state.emptyDescription only while title is unset too; null hides it.
iconReactNode--Above the title. Defaults to the tray icon in the muted colour; null hides it.
labelsLabels--The built-in strings. Defaults to English; pass getLabels(locale).labels for another.
localestring--Accepted so {...getLabels(locale)} spreads cleanly. Nothing here formats a number, so it is not used and never reaches the element.
titleReactNode--The bold first line, a paragraph and not a heading. Defaults to labels.state.empty; null hides it.

Keyboard and accessibility

Nothing to operate: it is not interactive on its own.

  • It has no role and no live region: it is page content, read in place.
  • The title is a paragraph, not a heading, so it adds nothing to the page outline.
  • The default icon is decorative and takes the muted colour; an icon you pass keeps its own.

Right to left

A centred column, so nothing mirrors. With the Arabic labels the default title and description are Arabic.

Server and client

Renders on the server and ships no JavaScript.

Files: index.tsx.

On the chip: server - 0 KB.