j3w1 / theme

j3w1 / theme4.0.0

j3w1 / command

  • SPEC Overview
  • SPEC Foundations
  • SPEC Components
  • SPEC Patterns
  • SPEC Tokens
  • SPEC Tools
  • SPEC Workbench
  • SPEC Form builder
  • SPEC Task kit
  • SPEC Recipes
  • SPEC Figma bridge
  • SPEC Report an issue
  • SPEC Implement
  • SPEC For agents
  • SPEC Ports
  • SPEC Releases
  • SPEC Specification
  • DEMO Vue application demo

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 · 4.0.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.

Markup
<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.

Markup
<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@4.0.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@4.0.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

Empty state empty-state

  • Family: Feedback and overlays
  • Maturity: stable
  • Priority: R1
  • Since: 0.1.0
  • Native control: native block; a heading and a paragraph inside the region the content would fill; the action is a native <button> or <a> — APG pattern
  • specified
  • demonstrated

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.

Report an issue with this component

Tokens

Focus a role to inspect its values; follow its link for persistent usage and source details.

PartRoleValueUse
root.bgcolor.surface.defaultapproveduse#0d0707D-041 surface.default: color.primitive.modern.panel.
root.bordercolor.border.dividerapproveduse#482b2bD-041 border.divider: color.primitive.modern.divider.
glyph.textcolor.icon.decorativeapproveduse#986f72D-041 icon.decorative: color.primitive.modern.control.
heading.textcolor.text.brightapproveduse#ffa2a7D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
text.textcolor.text.mutedapproveduse#d4868bD-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
action.textcolor.action.secondary.textapproveduse#ffa2a7D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
action.bordercolor.action.secondary.borderapproveduse#986f72D-041 action.secondary.border: color.primitive.modern.control.
action.bg-hovercolor.action.secondary.hover-bgobserveduse#630f0dSecondary button hover.
action.ringcolor.interaction.focus.ringobserveduse#e539351px dashed focus ring on controls and rows.

State matrix

Every declared state and combination, statically rendered; the default cell is live. Sizes: compact, comfortable (switch with the density control above).

StateWith actionWithout action
default

No components match

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

No notifications

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

Purpose

Replaces a blank pane, an empty table body or a filtered-out list: it says what is empty and offers the one action that changes it, when there is one. A failure is the error state; a wait is the loading indicator.

Anatomy

Parts as listed in the anatomy.

States

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

No states of its own; the action takes the secondary button’s hover and ring.

Keyboard

As in the key table. When a filter empties a list that had focus inside it, focus moves to the region’s heading, not into the empty state, so the person hears where they are.

Accessibility

The heading is a real heading at the region’s level, so the empty state appears in the outline; the sentence follows it in reading order. 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. Text meets 4.5:1; the action border 3:1.

Portability

A toolkit with only a placeholder string adds 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. Only “No data”. A heading in the accent red. An empty state shown while loading. Centred text in a rounded, shadowed card.

Contrast report

6 declared pairs measured on resolved sRGB values with the WCAG 2.x formula; 0 waived (decorative only), 0 failing. A pass is a design target for the named role, not an application-wide conformance claim.

PairStateKindForegroundBackgroundRatioMinResult
empty-state default textdefaulttextcolor.text.muted #d4868bcolor.surface.default #0d07077.224.5pass
heading on the panel surface—textcolor.text.bright #ffa2a7color.surface.default #0d070710.454.5pass
action text on the panel surface—textcolor.action.secondary.text #ffa2a7color.surface.default #0d070710.454.5pass
action boundary on the panel surface—uicolor.action.secondary.border #986f72color.surface.default #0d07074.623pass
glyph (decorative)—uicolor.icon.decorative #986f72color.surface.default #0d07074.621pass
container edge (decorative)—uicolor.border.divider #482b2bcolor.surface.canvas #0000001.661pass

Keys

KeyAction
TabReaches the action when present; the block itself is never focusable.
Enter / SpaceActivates the action.

For agents

Component JSON ·Implementation brief ·Build a task kit ·

Related: error-state loading-indicator list table data-table button

Stress fixtures: FX-LONG FX-320 FX-ZOOM-200 FX-I18N FX-RTL FX-RM FX-HC FX-STATE-MATRIX