Skip to content
Fleetline

Empty state

Usage

Show an empty state where a list, table or dashboard tile has nothing to show, in the same place and at about the same height as the content it stands in for. Say what the situation is, what to do next, and offer one way to do it.

Anatomy

  1. Region — .empty-state (reserves the height of the missing content)
  2. Icon — .result__icon, decorative (aria-hidden)
  3. Title — .result__title, a heading one level below the surrounding section
  4. Guidance — .result__description, one sentence
  5. Actions — .result__actions: one primary button, optional secondary link

Examples

Empty state

variant:first-use — inside a card

Work orders

Van KX-219 · Ford Transit

No work orders yet

Repairs and services for this van appear here with their status and mechanic.

Import from spreadsheet

variant:no-results — filters stay editable

No vehicles found

No results for ‘KX-99’

No vehicle at North Yard matches that plate. Check the number, or search all 6 depots.

Browse all vehicles

variant:cleared — queue finished

Inspections due

North Yard · next 7 days

All caught up

Every vehicle at North Yard has a valid inspection. The next one is due on .

<div class="empty-state">
  <section class="result" aria-labelledby="wo-empty-t">
    <span class="result__icon" aria-hidden="true"><svg><use href="#icon-clipboard-list"></use></svg></span>
    <h2 class="result__title" id="wo-empty-t">No work orders yet</h2>
    <p class="result__description">Repairs and services for this van appear here with their status and mechanic.</p>
    <div class="result__actions">
      <button type="button" class="btn btn--primary">Create work order</button>
      <a class="btn btn--ghost" href="/work-orders/import">Import from spreadsheet</a>
    </div>
  </section>
</div>

<!-- No results: keep the search/filters above; announce the count in the search's role="status" node. -->
<!-- Cleared: .result--success, a link instead of a primary button. -->

API

HookValuesPurpose
.empty-stateblockRegion that replaces the list/table; centres the result panel vertically
--empty-state-min-block-sizelength (default 20rem)Match the height of the content it replaces
.empty-state__toolbarpartSearch + filters row kept above a no-results state
.result / .result--successcomponentIcon, title, guidance and actions (see Result panel)

Do and don't

Do repeat the query and give the way out: "No results for ‘KX-99’" + "Clear filters".
Don't show a bare "No data" or hide the filters that caused the empty result.

Accessibility

Announcements and focus
SituationBehavior
Page loads emptyNo live region; the heading is found by heading navigation
Filter or search returns nothingThe result count is announced politely ("No vehicles found") through the search's role="status"; focus stays in the search box
Last item in a queue is completedAnnounce "All caught up" through a status message; move focus to the empty-state heading (tabindex="-1") only if the focused row was removed

The icon is decorative; the title carries the meaning. The title is a real heading at the right level for its container (card title + 1).

Tokens

Custom propertyPurpose
--empty-state-min-block-sizeReserved height (pattern property)
--space-3, --space-4Toolbar gaps
--color-feedback-info-*, --color-feedback-success-*Icon disc via the result panel tones