@akhatmirzo/ui

EmptyState

For empty lists, searches with no results and first-run screens — an icon, a title, a description and actions.

Buyurtmalar hali yo'q

Birinchi buyurtma kelganda shu yerda ko'rinadi.

Import

import { EmptyState } from '@akhatmirzo/ui';

When to use

  • When a list or table is empty — "No orders yet". Instead of blank space, explain what happened and what to do next.
  • When a search or filter returns nothing — suggest changing the query or clearing filters.
  • On first run — guide people to their first action (size="lg").
  • One main action — action (primary), with an optional secondaryAction (ghost).
  • Keep the title short and the description useful — not "Nothing here", but "Your first order will show up here".

No search results

bordered adds a dashed border for use inside a section.

Hech narsa topilmadi

"Namangan" bo'yicha natija yo'q. So'zni o'zgartirib ko'ring.

Sizes

size: sm has 24px vertical padding, md (default) 40px and lg 64px, with a 64px icon circle and a larger title.

Kichik

sm

O'rta

md

Katta

lg

With DataTable

When a DataTable is empty, its empty slot draws this same layout. Pass icon, title, description and action to empty, just like with EmptyState.

№MijozSumma

Buyurtmalar hali yo'q

Birinchi buyurtma kelganda shu yerda ko'rinadi.

Props

EmptyState accepts every other <div> attribute (except title, which is used as a prop).

PropTypeDefaultDescription
titlerequiredReactNode—Title
descriptionReactNode—Short description (max 40ch wide)
iconReactNode—Shown in a 48px circle (64px on lg)
actionReactNode—Main action
secondaryActionReactNode—Secondary action
size'sm' | 'md' | 'lg''md'Vertical padding: 24 / 40 / 64px
borderedbooleanfalseDashed border and radius (for use inside a section)
headingLevel2 | 3 | 4 | 5 | 63Title tag (h2–h6)

Data attributes

On the root: data-size and data-bordered (when bordered). emptyStateVariants is exported too, so you can apply the styles to another element.

Accessibility

  • The title is a real h* element — h3 by default. Set headingLevel to fit your page so the heading order stays intact.
  • The icon is decorative — it's aria-hidden together with its circle.
  • Actions are your own buttons and work with the keyboard as usual. On narrow screens (< 640px) they stack and go full width.
  • If the content changes dynamically (search) and you want it announced, put role="status" on the surrounding container.

On this page