nili/ui
كل المكوّنات

EmptyState

عرض شامل
٤ تصدير٠ محور تنويع٧ خاصيّة٢ ملف
import { EmptyState } from '@nili/ui';

هذه صفحة العرض الشامل الخاصة بالمكتبة، معروضة حيّة. غيّر اللغة أو السمة من الأعلى وسَتتبعك.

أساسي

المطلوب هو title فقط. تأخذ فتحة illustration حجم أي SVG أو صورة تمرّرها من محور size، لذا مرِّر الأيقونة نفسها لا ما يؤطّرها — فالرسوم تبقى في فيجما وتُصدَّر، ولا يشحنها المكوّن.

No invoices yet

When you send your first invoice, it will show up here.

import { EmptyState, Button, Icon } from "@nili/ui"
import { RiInboxLine, RiAddLine } from "@remixicon/react"

export function Example() {
  return (
    <EmptyState
      illustration={<Icon icon={RiInboxLine} />}
      title={t('copy.noInvoices')}
      description={t('copy.noInvoicesBody')}
      actions={<Button startIcon={<Icon icon={RiAddLine} />}>New invoice</Button>}
    />
  )
}

الأحجام

ثلاث كثافات. sm لخلية فارغة أو لوحة ضيّقة، وmd لبطاقة، وlg لصفحة كاملة.

sm
No results

جرّب كلمة بحث أخرى.

md
No results

جرّب كلمة بحث أخرى.

lg
No results

جرّب كلمة بحث أخرى.

import { EmptyState } from "@nili/ui"

export function Example() {
  return (
    <>
      <EmptyState size="sm" title={t('copy.noResults')} />
      <EmptyState size="md" title="No results" />
      <EmptyState size="lg" title="No results" />
    </>
  )
}

الحالات الثلاث التي تستحق التمييز

«لم يُنشأ شيء بعد» و«لا نتائج مطابقة» و«حدث خطأ» ثلاث حالات مختلفة، والإجراء يختلف في كلٍّ منها. حالة «لا نتائج» التي تعرض «أنشئ أول عنصر» مربكة — العناصر موجودة، والمرشّح هو الخطأ.

No projects yet

Create one to get started.

لا نتائج مطابقة لـ «roadmap»

Check the spelling, or clear the filters.

Could not load projects

Check your connection and try again.

تواصل مع الدعم
import { EmptyState, Button, LinkButton, Icon } from "@nili/ui"
import { RiInboxLine, RiSearchLine, RiWifiOffLine } from "@remixicon/react"

export function Example() {
  return (
    <>
      {/* nothing created yet → offer to create */}
      <EmptyState
        illustration={<Icon icon={RiInboxLine} />}
        title={t('copy.noProjects')}
        description={t('copy.noProjectsBody')}
        actions={<Button>New project</Button>}
      />

      {/* nothing matched → offer to clear the filter */}
      <EmptyState
        illustration={<Icon icon={RiSearchLine} />}
        title="No projects match “roadmap”"
        description={t('copy.noMatchesBody')}
        actions={<Button appearance="stroke">Clear filters</Button>}
      />

      {/* something failed → offer to retry */}
      <EmptyState
        illustration={<Icon icon={RiWifiOffLine} />}
        title={t('copy.loadFailed')}
        description={t('copy.loadFailedBody')}
        actions={
          <>
            <Button appearance="stroke">Retry</Button>
            <LinkButton href="#">Contact support</LinkButton>
          </>
        }
      />
    </>
  )
}