التخطّي إلى المحتوى
menumenu tanreiexpand_morecontrasttranslate
tanreiexpand_more
البدءWebReactSwiftUIJetpack ComposeFlutterReact Nativeالإعدادات الجاهزةنظام التصميم الخاص بكاستخدام Tanrei مع وكلاء الذكاء الاصطناعيالعلامة التجاريةرموز التصميمأنظمة التصميم والتخصيصTheme Studioاللونالطباعةالأيقوناتالشكلالارتفاعالحركةحالات التفاعلالسلوكالتخطيطإمكانية الوصولالكلماترموز الألوانرموز السلّم الطباعيرموز الشكلرموز الارتفاعرموز الحركةرموز الحالةرموز التباعد والقياسالمكوّناتالزرزر الإجراء الرئيسيالزر المقسَّممجموعة الأزرارزر مع قائمةشريط الأدواتزر النسخخانة الاختيارزر الاختيارمفتاح التبديلالرقاقةقائمة الخياراتشريط التمريرحقل شريط التمريرالتقويمDateTimePickerمجموعة الحقولمجموعة أزرار الاختيارمجموعة خانات الاختيارعنصر الاختيارحقل الاختيارشريط القوائمرفع الملفاتمنتقي الملفات متقدّمساحة الإفلاتحقل إدخال النص متقدّمحقل النصحقل الرقاقاتالحقلمربع التحرير والسرد متقدّمحقل التحرير والسردحقل إدخال العدد متقدّمحقل العددحقل إدخال اللون متقدّمحقل اللونحقل إدخال الرمز لمرة واحدة متقدّمحقل الرمز لمرة واحدةحقل إدخال النص المدمج متقدّممربع كتابة الرسائلالبطاقةالفاصلالطبقة النمطية متقدّممربع الحوارالقائمة (list)صف القائمةاللوحة السفليةاللوحة الجانبيةالعرض الدوّاركتلة الشيفرةالجدولاللوحة المنبثقةالخطواتالأكورديونقائمة الوصفالشكل التوضيحيهيكل التطبيقرأس الصفحةالعرض الشجريالخط الزمنيمعاينة الصورمقبض تغيير الحجمالإطار القابل لتغيير الحجممنطقة التمريرالشارةمؤشر التقدمالعدّادعارض الأرقام المتحرّكمؤشر التحميلشريط الإشعار (Snackbar)التلميحاختصار لوحة المفاتيحالوسمالشيفرة المضمَّنةالتنويهالصورة الرمزيةالحالة الفارغةمجموعة الوسومهيكل التحميلعنصر الملفمربع اللونالنص المتحركعلامات التبويبعرض التبويباتشريط التطبيقشريط التنقلدرج التنقلالبحثالرابطالتنقل بين الصفحاتروابط السابق والتاليمؤشر الخطواتمسار التنقلجدول المحتوياتبطاقة الرابطقائمة FABالحالةكيف يُبنى Tanreiالمساهمةالترخيص والإسناد
الرئيسيةالمكوّناتالحالة الفارغة

الحالة الفارغة

ما يقف مكان محتوى غير موجود، كبحث بلا نتائج، أو قائمة لم يُضف إليها أحد شيئًا، أو صفحة قبل عنصرها الأول. يقول ما الناقص، ولماذا أو ما العمل، ويعرض الإجراء الذي يقوم بذلك.

content_copyعرض بتنسيق Markdown
الفئة
التواصل
الرموز
comp.empty-state
المستوى
أساسي

نظرة عامة

Web
tanrei-empty-state
schedule
SwiftUI
TanreiEmptyState
radio_button_unchecked
Jetpack Compose
TanreiEmptyState
radio_button_unchecked
Flutter
TanreiEmptyState
radio_button_unchecked
React Native
EmptyState
radio_button_unchecked

مولَّد من docs/status/status.json, specs/empty-state.spec.json

قائمة لم يُضف إليها أحد شيئًا بعد، وبحث لم يجد شيئًا

folder_openالمشروع يجمع طبقات نظام تصميم واحد وملفاته المصدَّرة وأعضاءه في مكان واحد.مشروع جديداستيراد طبقةsearch_offتحقق من الإملاء، أو ابحث بكلمة أقصر.مسح البحث

الحالة الفارغة (empty state) تقف حيث كان المحتوى سيكون وليس هناك محتوى: تحلّ محل القائمة أو الصفوف أو النتائج. تقول ما الناقص في كلمات قليلة، ولماذا أو ما العمل في جملة، وتعرض عنصر التحكم الذي يقوم بذلك. وهي هادئة ومسطّحة، بلا تعبئة ولا حافة، وهي محتوى يُقرأ حيث يقف: لا تأخذ تركيزًا وليست لها حالات.

على الويب هي <tanrei-empty-state>. والمنصات الأخرى لم تنفّذها بعد.

الاستخدام

الوصف هو محتوى العنصر نفسه. والعنوان هو خاصية HTML (attribute) المسماة headline، ويُعرَض عنوانَ قسم من المستوى الذي تعطيه level، أو المنفذ title حيث يكون عنوان قسم أو محتوى آخر من عندك. ورسم (glyph) من مجموعة الأيقونات، أو صورة من عندك، يوضع في المنفذ media، وأزرارك أو روابطك أنت في المنفذ actions. كل كلمة لك أنت: ليس للمكوّن كلمات من عنده.

<!-- منطقة داخل عرض: رسم، وعنوان، وجملة، والإجراء. -->
<tanrei-empty-state headline="لا توجد مشاريع بعد">
  <span slot="media">folder_open</span>
  المشروع يجمع طبقات نظام تصميم واحد وملفاته المصدَّرة وأعضاءه في مكان واحد.
  <tanrei-button slot="actions">مشروع جديد</tanrei-button>
  <tanrei-button slot="actions" variant="text">استيراد طبقة</tanrei-button>
</tanrei-empty-state>

<!-- صفحة فارغة كلها: الحجم large، وعنوانها هو عنوان الصفحة. -->
<tanrei-empty-state size="large">
  <h1 slot="title">هذه الصفحة غير موجودة</h1>
  ربما كُتب عنوان الصفحة خطأً، أو نُقلت الصفحة.
  <a slot="actions" class="tanrei-link" href="/">الانتقال إلى الصفحة الرئيسية</a>
</tanrei-empty-state>

<!-- في لوحة جانبية: عند حافة البداية، حيث كانت القائمة ستبدأ. -->
<tanrei-empty-state align="start" headline="لا شيء يختلف عن الأساس بعد">
  غيّر قيمة على اليسار فتُدرج هنا.
</tanrei-empty-state>

<!-- جوابًا عن تصفية: تُعلَن مرة واحدة، بتهذيب، حين تُعرض. -->
<tanrei-empty-state id="no-rows" live hidden headline="لا توجد مدخلات تطابق عوامل التصفية هذه">
  ثلاثة عوامل تصفية مفعَّلة. إزالة أحدها تُظهر مدخلات أكثر.
  <tanrei-button slot="actions" variant="outlined">مسح عوامل التصفية</tanrei-button>
</tanrei-empty-state>

<script type="module">
  import '@tanrei/web/components/empty-state';
  import '@tanrei/web/empty-state.css'; // المكان الذي تحتفظ به حالة فارغة مرسومة على الخادم قبل أن يُعرَّف العنصر
</script>
import { Button, EmptyState } from '@tanrei/react';

{rows.length === 0 && (
  <EmptyState live headline="لا توجد مدخلات تطابق عوامل التصفية هذه">
    ثلاثة عوامل تصفية مفعَّلة. إزالة أحدها تُظهر مدخلات أكثر.
    <Button slot="actions" variant="outlined" onClick={clearFilters}>مسح عوامل التصفية</Button>
  </EmptyState>
)}

المواصفات

الأجزاء، مضافةً واحدًا بعد آخر

المشروع يجمع طبقات نظام تصميم واحد وملفاته المصدَّرة وأعضاءه في مكان واحد.folder_openالمشروع يجمع طبقات نظام تصميم واحد وملفاته المصدَّرة وأعضاءه في مكان واحد.folder_openالمشروع يجمع طبقات نظام تصميم واحد وملفاته المصدَّرة وأعضاءه في مكان واحد.مشروع جديداستيراد طبقة

عند حافة البداية، والحجم large

غيّر قيمة على اليسار فتُدرج هنا.explore_offربما كُتب عنوان الصفحة خطأً، أو نُقلت الصفحة.الانتقال إلى الصفحة الرئيسية

البنية

البنية

مرسوم فوق نموذج الاختبار title كما ترسمه حزمة الويب.
الجزء الوصف
1 container The block that holds the message, as wide as the region it stands in and as tall as its content and its padding, with no fill, no edge and no elevation: it is drawn on the surface of the region whose content is missing. It carries no state.
2 media · اختياري What pictures the empty place, above the title: a glyph of the system's icon set, in a quiet color, or a picture of the product's own. Decorative: the title says it.
3 title What is missing, in a few words ("No results", "No projects yet"). The one part at the surface's full text color. Plain text unless the product gives a heading; it wraps and is never cut.
4 description · اختياري Why the place is empty, or what the person can do about it, in a sentence or two, in a quiet color. The product's content: text, with links where it needs them.
5 actions · اختياري One or two of the product's own Buttons or links that fill the place or change what was asked for ("New project", "Clear the filter"), in a row below the text.

القياسات

القياسات

الطول الرمز القيمة (px)
container padding-inline tanrei.comp.empty-state.container.padding-inline 16
مرسوم فوق نموذج الاختبار title كما ترسمه حزمة الويب.

الخصائص

الخاصية النوع القيمة الافتراضية الوصف
title string "" What is missing, in a few words, in the product's language ("No results for tokne"). Exposed as a heading of the level `level` gives, since it is drawn as one. The title slot takes its place where the product needs inline content or a heading element of its own.
level number 2 The level of the heading the title prop is exposed as, 1 to 6, so that the empty state takes its place in the outline of the page around it: 2, the default, for the main region of a view under the page's own title; deeper inside a section, a card or a panel that has a heading of its own. Ignored where the title slot holds the product's own content, whose role and level are the product's.
size medium | large "medium" Medium is for an empty region inside a view: a list, a table's body, a card, a panel, a search's results. Large is for a view that is empty as a whole: the main region of a page before its first item, a page that was not found. It changes the room above and below, the glyph's size and the text styles. A design system may add values.
align center | start "center" Where the parts stand on the inline axis. Center, the default, is for a region that is otherwise blank. Start puts every part at the region's start edge with its text aligned there, for a narrow column, a list in a side panel or a table whose header stays in view, where the content would have begun at that edge.
live boolean false Whether the empty state is announced. False, the default, is for a place that is empty when its view is presented: it is read where it stands. True is for one that appears in answer to what the person did (a search that found nothing, a filter that matches no row, the last item removed): it is a live region, announced once, politely, when it is shown and when its text changes. It is never announced assertively and never takes focus: an empty place is not an error. It changes nothing that is drawn.

المنافذ

المنفذ الوصف
default The description: text, with the product's own links and inline content. Empty draws the title alone.
media A glyph of the system's icon set, by name, drawn through the platform's icon helper at the media size; or a picture of the product's own (an illustration), which keeps its own size and colors.
title The product's own title content in place of the title prop: a heading of the level the page's outline needs, or text with inline content. The empty state draws it in the title's style and changes neither its role nor its level.
actions The actions: the product's own Buttons or links, one or two, the main one first. The empty state lays them out below the text and does nothing else to them.

الحالات

السلوك

متطلبات بصيغة EARS. يُختبر تنفيذ كل منصة مقابل هذه المعرّفات. يُعرض نص المتطلبات كما ورد في ملف المواصفة، بالإنجليزية.

المعرّف المتطلب
EMP-1 THE empty state SHALL lay itself out as a block that takes the whole inline size of the region it is placed in and is as tall as its content and its padding: it SHALL lay out in one column, in this order, its media, its title, its description and its actions, those it has, padded above the first and below the last by the block padding of its size (comp.empty-state.container.padding-block.medium for medium, comp.empty-state.container.padding-block.large for large) and at the start and the end by comp.empty-state.container.padding-inline. THE empty state SHALL draw no fill, no edge and no elevation, SHALL bring no outer space of its own, SHALL set no height of its own and SHALL NOT scroll: where the region is taller, placing the block in it is the region's.
EMP-2 WHILE align is center THE empty state SHALL centre every part on the inline axis of its container and centre the lines of its title and its description; WHILE align is start THE empty state SHALL place every part at the container's start edge, inside the inline padding, and align the lines of its text to the start. In both THE empty state SHALL keep its title and its description no wider than comp.empty-state.content.measure times the description's font size, and no wider than the container less its inline padding.
EMP-3 WHERE the media slot holds a glyph THE empty state SHALL draw it first, in a box of the media size of its size (comp.empty-state.media.size.medium for medium, comp.empty-state.media.size.large for large), in comp.empty-state.media.color, with sys.icon.family.unselected and sys.icon.fill.unselected, sys.icon.weight and an optical size clamped between sys.icon.optical-size.min and sys.icon.optical-size.max, and SHALL begin the title comp.empty-state.media.gap below it. WHERE the slot holds a picture or a view of the product's own THE empty state SHALL draw it in the same place at its own size, never wider than the container less its inline padding and with its proportions kept, and SHALL NOT color, clip or mirror it. THE empty state SHALL keep the media from assistive technology, and SHALL draw no media the product did not give.
EMP-4 THE empty state SHALL draw its title in the text style of its size (comp.empty-state.title.typescale.medium for medium, comp.empty-state.title.typescale.large for large) and in comp.empty-state.title.color; the title SHALL wrap and SHALL never be cut. THE empty state SHALL expose a title given as text as a heading — of the level the level prop gives on a platform whose headings have levels, and with the platform's heading trait on one whose headings have none — because it is drawn larger and heavier than what follows it, and a text drawn as a heading and not exposed as one tells by its look alone what its structure is. IF level is not a whole number from 1 to 6 THE empty state SHALL use 2 and report it in debug builds. WHERE the title slot holds content THE empty state SHALL draw that content in the title's place, style and color instead of the title prop, and SHALL change neither its role nor its level: a title the product gives as a heading stays a heading of the level the product gave it, and inline content the product gives stays what it is. THE empty state SHALL set the title's letter-spacing by the script of its text, as every title is set (PRS-20): no negative letter-spacing WHERE its language is Chinese, Japanese or Korean, and none WHERE its script joins its letters or stacks marks on them.
EMP-5 WHERE the default slot holds content THE empty state SHALL draw it as the description, comp.empty-state.title.gap below the title, in the text style of its size (comp.empty-state.description.typescale.medium for medium, comp.empty-state.description.typescale.large for large) and in comp.empty-state.description.color; the description SHALL wrap and SHALL never be cut or limited to a number of lines. A link in the description is the product's own and is drawn by its own spec, in its own color and underlined.
EMP-6 WHERE the actions slot holds content THE empty state SHALL lay it out in one row comp.empty-state.actions.gap below the text, in the order given from the start, comp.empty-state.actions.item-gap apart, centred or at the start as align says (EMP-2); WHERE the row does not fit the container THE empty state SHALL wrap it, comp.empty-state.actions.item-gap between its lines, and SHALL never cut or shrink an action below its own minimum. THE empty state SHALL NOT restyle, resize, reorder or rename the actions, and SHALL emit no event of its own: an action's press is that control's.
EMP-7 THE empty state SHALL NOT take pointer, touch or keyboard input, SHALL NOT take focus or be a stop in the focus order, and SHALL NOT change anything it draws under a pointer, a press or focus: it has no hovered, focused, pressed, selected or disabled state and draws no state layer and no focus indicator. What the product places in it — a link in the description, a Button in the actions — takes input and focus by its own spec, in the order the parts are drawn, and text in the title and the description SHALL remain selectable where the platform lets text be selected.
EMP-8 WHILE live is false THE empty state SHALL be exposed to assistive technology as plain content, read where it stands in reading order: its title as a heading (of the level level gives, or the product's own content in the title slot as the product gave it), then its description, then its actions as the controls they are. It SHALL have no role and no name of its own, SHALL NOT be announced when it is shown or when its text changes, SHALL NOT move focus, and SHALL NOT be exposed as an alert, a status, a dialog or a note: an empty place is content, not a message.
EMP-9 WHILE live is true THE empty state SHALL be a polite live region. WHEN it is shown after its page or view was first presented, and WHEN its title or its description changes while it is shown, THE empty state SHALL have assistive technology announce it once, after what is being read: the title, then the description, and not the names of its actions. It SHALL never announce assertively and SHALL NOT move keyboard or screen-reader focus. A live empty state that is drawn with the first presentation of its page or view SHALL NOT announce itself then. live SHALL change nothing that is drawn.
EMP-10 WHEN title, the title slot's content, the description, the media or the actions change THE empty state SHALL draw and expose the new value at once, without a motion, and SHALL announce it only as EMP-9 says. THE empty state SHALL neither show nor hide itself: whether the place is empty is the product's to know, and the product puts the empty state there and takes it away.
EMP-11 WHILE the text size is enlarged THE empty state SHALL grow its title and its description, and the measure with them, keep its paddings and gaps, wrap, and grow in height; it SHALL keep a glyph's box at the media size of its size, SHALL cut nothing and set no fixed height, SHALL lose no content when the reader raises line height, paragraph spacing, letter spacing or word spacing, and SHALL need no horizontal scrolling at a width of 320 points with text at 200 %, its actions then each on a line of their own where two do not fit side by side.
EMP-12 WHERE the platform draws with a person's own forced colors (the web's forced-colors mode, and a platform's equivalent where it has one) THE empty state SHALL draw its glyph, its title and its description in the platform's text color, and leave links, Buttons and a picture of the product's own to their own specs and colors; nothing the empty state draws relies on a fill.
EMP-13 WHERE the layout direction is right-to-left THE empty state SHALL apply its paddings by logical start and end and mirror the order of its actions, so that the first action is at the right; WHILE align is start it SHALL place every part at the right edge and align its text to the right; WHILE align is center the column stays centred.
EMP-14 THE empty state SHALL take its layout direction from where it is used — the direction of the nearest ancestor that sets one, and the platform's own where none does — and SHALL have no direction setting of its own; WHEN that direction changes while the empty state is shown THE empty state SHALL draw itself for the new direction at once, without a motion of its own, keeping what it shows.
EMP-15 WHERE the layout direction is right-to-left THE empty state SHALL draw the glyph of its media slot mirrored left to right exactly when the system's icon set marks that glyph's name as mirrored or the product forces mirroring for that use, and unmirrored when the product forbids it: the icon helper mirrors the glyph inside its own box, about the box's vertical centre line, changing neither its place, size, color and fill nor the order EMP-13 gives. THE empty state SHALL NOT mirror a glyph itself, and SHALL NOT mirror content the product gives as a picture or a view of its own rather than by a glyph's name.
EMP-16 THE empty state SHALL lay out a title given as text as text of its own direction, isolated from the text around it: it takes the base direction of its first strong character, or the layout direction where it has none, so that a title that quotes what the person typed, a file's name or a number keeps its own order in a right-to-left layout; THE empty state SHALL still place the title and align its lines by the layout direction and by align, not by the text's own. The description's direction is its content's.
EMP-17 WHEN size names a value that the active design system does not have, or align names a value this spec does not have, THE empty state SHALL render with the default value, and in debug builds report the unknown value.
EMP-18 IF the title, the title slot and the description are all empty THE empty state SHALL draw nothing, take no space and expose nothing, and in debug builds report that an empty state says nothing: a glyph or actions alone do not tell a person what is missing. IF the description is given and the title and the title slot are empty THE empty state SHALL still render and in debug builds report that an empty state has no title.

مطابقة الأسماء بين المنصات

التكافؤ لا يعني واجهات برمجية متطابقة. تعبّر كل منصة عن العقد نفسه بأسلوبها.

المواصفة Web SwiftUI Jetpack Compose Flutter React Native
المكوّن tanrei-empty-state TanreiEmptyState TanreiEmptyState TanreiEmptyState EmptyState
title · الخاصية headline title title title title
level · الخاصية level headingLevel headingLevel headingLevel headingLevel
size · الخاصية size size size size size
align · الخاصية align alignment alignment alignment align
live · الخاصية live isLive live live live
ملاحظات It is the form the callout takes. <tanrei-empty-state> with the description as light-DOM children, the glyph or the picture in the media slot, the title in the title slot (<p slot="title">, or <h2 slot="title"> where it is a heading) or the headline attribute (HTML's global title attribute would show a tooltip over the whole block, as on the callout), which the shadow root draws as an element with role="heading" and aria-level from level (a number property and attribute, 2 by default), and Buttons or links in the actions slot. Everything the product writes stays in the document: the title where it is slotted, the description, the links and the Buttons are light-DOM content, read by a crawler and by a page without script. **Before the element is defined** the stylesheet of @tanrei/web gives tanrei-empty-state:not(:defined) display: block, the block and inline padding of its size, the description's text style and color, and text-align by its align, so the content is readable in its place and the block keeps most of its height; a headline attribute does not show until the element is defined, which is why a page that must read without script gives the title in the slot. The host has no role, no tabindex and no listeners; the glyph is aria-hidden. With live the announcement is made through a visually hidden role="status" region in the shadow root that exists from the element's first render and is filled, with the title and the description's text, only when the element is connected or changed after the document's first presentation (EMP-9); the host itself gets no live role, so slotted content is not read twice. The text block's width is max-inline-size: calc(var(--tanrei-comp-empty-state-content-measure) * 1em) on the element that carries the description's font size (EMP-2). The description takes its color and text style through inherited color and font, so text placed directly in the element is styled. In a table the element goes in one <td colspan> of a body row, or directly after the table, which keeps its caption and its header row (the Table spec says nothing of an empty body); in a list it takes the list's place rather than being an item. Nothing changes under forced-colors: active but the colors the mode sets (EMP-12). TanreiEmptyState(_ title: String, size:, alignment:, isLive:, media:, actions:) { description }, the glyph given by name through icon: or a view through media:; a heading title is the title: view builder with the header trait set by the product. Not the platform's own unavailable-content view, whose sizes and colors are the platform's: the same structure drawn from Tanrei's tokens. isLive posts one announcement with the title and the description when the view appears after its screen did. Not built on this platform yet: EMP-4's title given as text exposed as a heading, and level. TanreiEmptyState(title, size, alignment, live, media, actions) { description }, the glyph given by name through icon or a composable through media. With live the text column has liveRegion = LiveRegionMode.Polite, set only after the first composition of its screen. Not built on this platform yet: EMP-4's title given as text exposed as a heading, and level. TanreiEmptyState(title: …, size:, alignment:, live:, icon:, media:, actions: […], child: description); titleWidget: takes a heading of the product's own. With live the text is wrapped in Semantics(liveRegion: true) after the first frame of its route, and announced through SemanticsService.announce with polite assertiveness where the platform does not read live regions. Not built on this platform yet: EMP-4's title given as text exposed as a heading, and level. <EmptyState title="No projects yet" icon="folder_open" actions={…}>description</EmptyState>; media takes an element of the product's own. With live, accessibilityLiveRegion="polite" on Android and one AccessibilityInfo.announceForAccessibility call on iOS when it mounts after its screen. Follows the app's direction where an ancestor's is not known. Not built on this platform yet: EMP-4's title given as text exposed as a heading, and level.

الرموز

الرمز يشير إلى القيمة المحلولة (فاتح)
--tanrei-comp-empty-state-actions-gap sys.space.space200 16px
--tanrei-comp-empty-state-actions-item-gap sys.space.space100 8px
--tanrei-comp-empty-state-container-padding-block-large sys.space.space800 64px
--tanrei-comp-empty-state-container-padding-block-medium sys.space.space400 32px
--tanrei-comp-empty-state-container-padding-inline sys.space.space200 16px
--tanrei-comp-empty-state-content-measure — 30
--tanrei-comp-empty-state-description-color sys.color.on-surface-variant #4b4b4b
--tanrei-comp-empty-state-media-color sys.color.on-surface-variant #4b4b4b
--tanrei-comp-empty-state-media-gap sys.space.space200 16px
--tanrei-comp-empty-state-media-size-large — 48px
--tanrei-comp-empty-state-media-size-medium sys.icon.large 32px
--tanrei-comp-empty-state-title-color sys.color.on-surface #1b1b1b
--tanrei-comp-empty-state-title-gap sys.space.space50 4px
--tanrei-comp-empty-state-description-typescale-large sys.typescale.body-large 400 16px/1.625
--tanrei-comp-empty-state-description-typescale-medium sys.typescale.body 400 14px/1.5714
--tanrei-comp-empty-state-title-typescale-large sys.typescale.heading-3 500 20px/1.4
--tanrei-comp-empty-state-title-typescale-medium sys.typescale.heading-5 500 16px/1.5

نماذج الاختبار

عروض مرجعية. تلتقط كل المنصات لقطة لكل نموذج بالمعرّف نفسه حتى يمكن مقارنة النتائج.

مولَّد من specs/empty-state.spec.json, tokens/comp/empty-state.tokens.json, design/tokens/

الإرشادات

الحالة الفارغة والتنويه وشريط الإشعار ونص الحالة

المكوّن ما هو أين يقف
الحالة الفارغة مكان محتوى غير موجود. حيث كانت القائمة أو الصفوف أو النتائج ستكون.
التنويه إشعار عن محتوى موجود. بجانب ذلك المحتوى، في مجرى الصفحة.
شريط الإشعار نتيجة شيء حدث للتو. فوق المحتوى، لوقت قصير.
نص الحالة في البحث عدد ما وُجد («لا توجد نتائج عن tokne»). في صف الحالة الخاص بالبحث.

المكان الفارغ ليس خطأ. المحتوى الذي أخفق تحميله تنويه بحالة الخطأ في المكان نفسه، والمحتوى الذي ما زال يُحمَّل مؤشر تحميل. والحالات الثلاث للمنطقة، التحميل والفراغ والإخفاق، تبدّل المنطقة نفسها بينها؛ والحالة الفارغة لا تُظهر نفسها ولا تخفيها.

الأحجام

size فوق وتحت الرسم العنوان الوصف يُستخدم لـ
medium (الافتراضي) 32 32 16 14 منطقة داخل عرض: قائمة، أو متن جدول، أو بطاقة، أو لوحة، أو نتائج بحث.
large 64 48 20 16 عرض فارغ كله: صفحة قبل عنصرها الأول، أو صفحة لم يُعثر عليها.

عرض الكتلة عرض منطقتها، وارتفاعها ارتفاع محتواها وحشوها. وحيث تكون المنطقة أطول، فوضع الكتلة فيها، بتوسيطها أو بحفظ الارتفاع الأدنى لجدول، من شأن المنطقة. ويُحصر النص في نحو 60 حرفًا لاتينيًّا في السطر (30 ضعف حجم الوصف)، فلا تمتد جملة في وسط جدول عريض من حافة إلى حافة.

المحاذاة

الخاصية align قيمتها center (الافتراضية) لمنطقة لا شيء فيها غير ذلك، و start لعمود ضيق، أو قائمة في لوحة جانبية، أو جدول تبقى ترويسته ظاهرة: تبدأ الرسالة عندئذ حيث كان المحتوى سيبدأ.

العنوان

تُعرَض الخاصية headline عنوانَ قسم، لأنها تُرسم كعنوان: من المستوى 2 افتراضيًا، للمنطقة الرئيسية لعرض تحت عنوان الصفحة نفسها. عيِّن level على المستوى الذي يحتاج إليه مخطَّط عناوين صفحتك: أعمق داخل قسم أو بطاقة أو لوحة لها عنوان قسم خاص بها. والعنوان في المنفذ title يُرسم كأي عنوان، ولا تغيّر الحالة الفارغة دوره ولا مستواه: ضع هناك عنصر عنوان قسم من عندك، أو نصًّا حيث لا ينبغي أن يكون العنوان عنوان قسم.

في صفحة تُرسم على خادم، أعطِ العنوان في المنفذ title: الخاصية headline يرسمها العنصر، فلا تُعرض قبل أن يُعرَّف العنصر.

الوسائط

الرسم يُعطى باسمه، في عنصر: <span slot="media">folder_open</span>. ويُرسم بحجم الوسائط، بلون هادئ. وكل ما سواه في المنفذ، من عنصر <img> أو <svg> أو عنصر من عندك، صورة: تحتفظ بحجمها وألوانها، ولا تكون أعرض من الكتلة أبدًا، ولا تُعكس أبدًا. والوسائط زخرفية ومخفية عن التقنيات المساعدة، فلا تجعل الصورة السبيل الوحيد إلى المتابعة. ولا يتضمن Tanrei رسومًا توضيحية.

الإجراءات

الإجراءات أزرارك أو روابطك أنت، واحد أو اثنان، والرئيسي أولًا. تضعها الحالة الفارغة في صف يلتفّ ولا تفعل بها شيئًا آخر. والإجراء الذي تسميته أطول من سطره يُعطى السطر: فيلفّ الزر تسميته، ولا يُقصّ شيء ولا يتجاوز شيء الكتلة.

في عمود ضيق يأخذ كل إجراء سطرًا، والتسمية الطويلة تلتفّ

search_offتحقق من الإملاء.مسح البحثفتح قائمة محتويات التوثيق

الظهور جوابًا عن شيء

الخاصية live لحالة فارغة تنتج عمّا فعله الشخص للتو: تصفية لا تطابق أي صف، أو إزالة العنصر الأخير. تُعلَن مرة واحدة، بتهذيب، العنوان ثم الوصف دون الإجراءات، حين تُعرض وحين يتغيّر نصها. أبقِها في الصفحة مع hidden، أو أضفها حين تنطبق.

حالة فارغة حيّة، تُعرض جوابًا عن ضغطة

تطبيق ثلاثة عوامل تصفية

أما التي في ترميز الصفحة وتُعرض حين تُحمَّل الصفحة فلا تُعلَن عندئذ. وعلى الويب، الحالة الفارغة الحيّة التي يضيفها سكربتك إلى الصفحة بعد تحميلها تُعلَن؛ والعنصر لا يستطيع أن يفرّق بين ما أضيف جوابًا عن شيء وما أضيف مع عرض جديد في تطبيق من صفحة واحدة، فلا تضع live على حالة فارغة هي مجرد جزء من عرض جديد.

في البحث، عدد النتائج هو نص الحالة الخاص بالبحث، وهو يُعلَن أصلًا. وحيث تعرض حالة فارغة أيضًا في عرض البحث، لا تضع عليها live، وإلا قُرئت الكلمات نفسها مرتين.

في جدول وفي قائمة

الجدول الذي بلا صفوف يحتفظ بشرحه وبصف ترويسته؛ والحالة الفارغة تقف حيث كانت صفوف المتن ستكون: في خلية واحدة تمتد على الأعمدة، أو بعد الجدول مباشرة. والقائمة التي بلا عناصر ليست قائمة من عنصر واحد: الحالة الفارغة تأخذ مكان القائمة.

قبل أن يُعرَّف العنصر

الوصف ومنفذ العنوان والإجراءات أبناء العنصر نفسه، فهي في المستند: يجدها البحث في الصفحة، وتُترجَم، وتُحدَّد، وتُقرأ بلا سكربت. والملف @tanrei/web/empty-state.css يعطي الحالة الفارغة التي لم تُعرَّف بعد حشوها وأنماط نصها ومحاذاتها، فتُقرأ الكلمات حيث ستقف. وإلى ذلك الحين تُعرض بلا رسمها.

افعل

  • قل ما الناقص في العنوان، بكلمات بسيطة، وما العمل في الوصف.
  • اعرض الإجراء الذي يملأ المكان أو يغيّر ما طُلب.
  • اقتبس ما كتبه الشخص في عنوان بحث بلا نتائج.

لا تفعل

  • لا تعطِها لون حالة ولا دور تنبيه (alert). المكان الفارغ معلومة عن المحتوى.
  • لا تستخدم live لمكان يكون فارغًا حين يُفتح عرضه.
  • لا ترسم بيدك جملة رمادية موسَّطة، ولا قائمة من عنصر واحد ليس عنصرًا.
  • لا تستخدمها لسطر واحد يقول «لا شيء هنا» داخل عنصر تحكم، كقائمة خيارات بلا خيارات: ذلك نص عنصر التحكم نفسه.

إمكانية الوصول

الدور
none
التسمية
An empty state that is not live has no role and no name: it is content, read where it stands — the title (a heading of the level level gives, or the product's own content in the title slot as the product gave it), the description, then the actions, which are the product's own controls with their own names. A live empty state is a polite live region instead (the status role on the web), announced once when it is shown after its view was presented and when its text changes. The glyph or the picture is hidden.
الحد الأدنى للهدف
تستوفي مساحة اللمس الحد الأدنى لحجم الهدف حتى لو كان الحجم المرئي أصغر. minimum 32px · pointer 44px · spacing 8px · touch 48px

لوحة المفاتيح

المفاتيح الإجراء

ملاحظات

  • Not interactive: the empty state takes no input and no focus (EMP-7), so there is no target of its own to size and minimumTarget holds trivially. Its actions meet the minimum target by their own specs.
  • Never an alert. An empty place is a fact about the content, not something that went wrong: it is announced only when it results from what the person just did (live), and then politely (EMP-9). A failure to load is a different thing and is said by a callout with the error status in the same place.
  • It replaces content, so it must not hide that the container is still there. A table that has no rows keeps its caption and its header; the empty state stands where the body's rows would be (on the web, outside the table element or in one cell that spans the columns, as the product's table allows). A list with no items is not exposed as a list of one item: the empty state stands in the list's place.
  • In a search, the count of results is the search's own status text, which is already a live region (SRC-48). Where the product also shows an empty state in the search's view, only one of the two is live, or the same words are announced twice: leave the empty state's live false there and let the status text speak.
  • The title is a heading (EMP-4) because it looks like one (WCAG 1.3.1). Its level is the product's to fit the page's outline: 2 by default, for the main region of a view under the page's title; deeper inside a section, a card or a panel that has a heading of its own. A product whose title must not be a heading gives it as inline content in the title slot.
  • Contrast in the default system: the title is on-surface and the description and the glyph are on-surface-variant, each held to 4.5:1 on every surface tone by the token invariants, so the empty state can stand on a page, in a card or in a panel. The glyph is decorative.
  • Say what to do, not only what is missing: a description and an action are what make an empty place a way forward. Do not put the only way forward in the picture.
  • Text size, text spacing and reflow: EMP-11.

مولَّد من specs/empty-state.spec.json, tokens/sys/measure.tokens.json

ما يتكفل به المكوّن

  • هي محتوى عادي بلا دور ولا اسم: العنوان، ثم الوصف، ثم الإجراءات، تُقرأ حيث تقف.
  • مع live تُعلَن مرة واحدة، بتهذيب، عبر منطقة حالة (status) خاصة بها: حين تُعرض بعد تقديم الصفحة، وحين يتغيّر عنوانها أو وصفها. ولا تُعلَن بإلحاح أبدًا.
  • الرسم أو الصورة مخفيان عن التقنيات المساعدة.
  • العنوان المعطى نصًّا عنوان قسم من المستوى الذي تعطيه level. وما تعطيه في المنفذ title يحتفظ بدوره ومستواه.
  • ليست موضع توقف في ترتيب التركيز ولا تنقل التركيز أبدًا. والمفتاح Tab يبلغ روابط الوصف، ثم الإجراءات.
  • مع تكبير النص يلتفّ كل شيء ويكبر؛ وعند عرض 320 والنص بنسبة 200% لا شيء يُمرَّر جانبيًّا ويقف كل إجراء على سطر خاص به.
  • في الألوان المفروضة (forced colors) يُرسم الرسم والعنوان والوصف بلون النص. ولا شيء يعتمد على تعبئة.
  • في التخطيط من اليمين إلى اليسار، البداية هي الحافة اليمنى والإجراء الأول في اليمين، والرسم الذي تعلّمه مجموعة الأيقونات يُعكس، والعنوان الذي يقتبس استعلامًا من اليسار إلى اليمين يحفظ ترتيب الاستعلام.
  • يُبلَّغ في بنيات التنقيح عن حجم أو محاذاة غير معروفين، وعن حالة فارغة بلا عنوان ولا وصف، وعن حالة فارغة لها وصف وليس لها عنوان.

ما عليك فعله

  • اكتب كل كلمة بلغة الصفحة. المكوّن لا يقدّم أي كلمة.
  • عيِّن level بما يناسب مخطَّط عناوين صفحتك، أو أعطِ عنوان قسم أو نصًّا من عندك في المنفذ title.
  • لا تستخدم live إلا لحالة فارغة تظهر جوابًا عن شيء، ولا تستخدمها أبدًا بجانب منطقة حيّة أخرى تقول الشيء نفسه.
  • لا تضع عنصر تحكم في المنفذ media: فهو مخفي عن التقنيات المساعدة.
  • أعطِ الإجراء تسمية يتسع لها مكانه. التسمية تلتفّ حيث يقصر سطرها، لكن الكلمة الواحدة الأطول من السطر لا تستطيع ذلك.