Malevich

Blocks/

State

Empty / loading / error / success block.

State

A self-contained block for empty / loading / error / success states. Used inside cards, sections, panels, or table containers when content is unavailable or an operation needs feedback.

When to use

For inline loading, prefer Spinner or Dots. For layout-shaped placeholders, prefer Skeleton. State is for when the whole container should communicate a single status.

Variants

Variant Class Use for
Default .state Canvas-tone background, generous pad
Bordered .state.-bordered Raised background + hairline border
Compact .state.-compact Smaller padding + title size

data-state attribute drives icon and title colors:

Value Effect
empty Icon: ink-subtle. Title: ink-strong.
loading Icon: accent. Title: ink-strong.
error Icon: danger. Title: danger.
success Icon: success. Title: success.

Anatomy

<section class="state" data-state="empty">
  <div class="state__icon">📭</div>
  <h3 class="state__title">No projects yet</h3>
  <p class="state__description">Create your first project to get started.</p>
  <div class="state__action">
    <button class="button -primary">New project</button>
  </div>
</section>

<section class="state" data-state="loading">
  <div class="state__icon">
    <span class="spinner -l" role="status" aria-label="Loading"></span>
  </div>
  <h3 class="state__title">Loading projects…</h3>
</section>

<section class="state -bordered" data-state="error">
  <div class="state__icon">⚠</div>
  <h3 class="state__title">Couldn't load</h3>
  <p class="state__description">
    The server returned an error. Check your connection and try again.
  </p>
  <div class="state__action">
    <button class="button -primary">Retry</button>
    <button class="button -ghost">Cancel</button>
  </div>
</section>

<section class="state -compact" data-state="success">
  <div class="state__icon">✓</div>
  <h3 class="state__title">All done</h3>
  <p class="state__description">Your changes have been saved.</p>
</section>

Every part is optional except the wrapper. Authors compose only what the state needs.

Tokens used

From semantic tier

Accessibility

Edge cases

Do

Don't