j3w1 / Empty stateVue · HTML · React · Astro

J3W1 / DESIGN SYSTEM

Empty state

What a container shows when it has nothing to list; a glyph, a heading in the bright text colour, one sentence in the muted colour and an optional secondary action.

stable · LIGHT DOM · 1.1.0

Light DOM retains static content, native semantics, label relationships and host composition without duplicating controls.

Live variants

with-action

No components match

Three filters are active; none of the 67 components passes all of them.

<j3w1-empty-state id="example-empty-state-with-action"><div class="empty-state">
  <span class="empty-state-glyph" aria-hidden="true">∅</span>
  <h3 class="empty-state-heading">No components match</h3>
  <p class="empty-state-text">Three filters are active; none of the 67 components passes all of them.</p>
  <button class="empty-state-action" type="button">Clear filters</button>
</div></j3w1-empty-state>

without-action

No notifications

New ones appear here and in the corner of the screen.

<j3w1-empty-state id="example-empty-state-without-action"><div class="empty-state">
  <span class="empty-state-glyph" aria-hidden="true">·</span>
  <h3 class="empty-state-heading">No notifications</h3>
  <p class="empty-state-text">New ones appear here and in the corner of the screen.</p>
</div></j3w1-empty-state>

Install and register

Use the exact version. If npm publication is pending, install the release tarball from the installation guide.

npm install --save-exact @j3w1/ui@1.1.0
import '@j3w1/ui/tokens.css';
import '@j3w1/ui/styles/empty-state.css';
import '@j3w1/ui/register/empty-state';

Insert the maintained markup above after loading these imports. Its native children provide accessible names and form behavior; the empty custom tag alone does not create a control.

Vue SFC, React, Astro and plain HTML integration →

Copy the complete implementation

npx --package=@j3w1/ui@1.1.0 j3w1-ui copy empty-state --out ./vendor/j3w1/empty-state

The CLI verifies every file before writing and refuses overwrites. Serve the output over HTTP and open index.html. Keep its modules, CSS, tokens and licence notices together.

Public API

attributes

NameType / signatureMeaning
disabledCustomEventDisable the native controls owned by this instance.
loadingCustomEventMark the primary control busy and prevent duplicate activation.

properties

NameType / signatureMeaning
disabledbooleanDelegates disabled state to native children.
namestringNative control name; application form keys remain explicit.

methods

NameType / signatureMeaning
refresh(): voidReconnect behavior after replacing native child structure.
focus(options?: FocusOptions): voidFocus the first usable native control.
dismiss(id?: string): voidDismiss a message; focused actions move to the next available control.

events

NameType / signatureMeaning
j3w1-dismissCustomEventCancelable message dismissal.
j3w1-retryCustomEventRequest recovery; the host owns the result.
j3w1-actionCustomEventAn explicit message action.

Dependencies and verification

Registered components: none. Style dependencies: none.

Package presence establishes an available implementation. Actual passes depend on the tested artifact and environment. Read specification execution evidence; read packed-consumer evidence; inspect the complete state matrix.

Full implementation manifest, API and token dependency closure

Canonical specification

Purpose

A region with nothing in it says so, and says what would fill it. It replaces a blank pane, an empty table body or a list with no rows after a filter, and it offers the one action that changes that when there is one. A failure is the error state; a wait is the loading indicator.

Anatomy

The block on color.surface.default inside a 1px color.border.divider, content centred; the glyph in color.icon.decorative; the heading in color.text.bright; the sentence in color.text.muted; the optional secondary action in color.action.secondary.text with a 1px color.action.secondary.border.

States

StateVisualNon-colour channel
defaultglyph, heading and sentence centred; the action, when present, below themthe worded heading; the action is a real button

The block has no states of its own; the action takes the secondary button’s hover and ring.

Keyboard

Only the action is in the tab order. When a filter empties a list that had focus inside it, focus moves to the heading of the region, not into the empty state, so the person hears where they are.

Accessibility

The heading is a real heading at the level the region uses, so the empty state appears in the outline; the sentence follows it in the reading order. The glyph is aria-hidden. When content becomes empty after an action (filter, delete), a polite live region announces the heading text. The action is never the only route: filters can also be cleared where they were set. Contrast: heading 10.10:1, sentence 5.66:1, action text 10.10:1 and its border 4.33:1 on the panel surface.

Portability

Text and one optional button. Toolkits with a status page use it with the glyph as text; toolkits with only a placeholder string add the action as a separate button below the view.

Non-examples

An illustration or mascot. A primary (filled) call to action. A blank pane. A greyed-out table header with no message. A message that only says “No data”. A heading in the accent red. An empty state that appears while loading. Centred text in a rounded card with a shadow.

j3w1 / command

  • SPEC Overview
  • SPEC Foundations
  • SPEC Components
  • SPEC Patterns
  • SPEC Tokens
  • SPEC Tools
  • SPEC Implement
  • SPEC For agents
  • SPEC Ports
  • SPEC Releases
  • DEMO Vue application demo
  • SPEC Complete UI theme specification