Component API

<empty-state>

Open live example

A centered placeholder for an empty list, an empty panel, or a zero-result
search: an optional leading glyph, a heading, a supporting line (or richer
slotted body), and an optional call-to-action row. Purely presentational —
it carries no interactive state of its own and no ARIA role; it is a
region of content, not a live status. Every optional part collapses
completely when absent, reserving no layout space.

Install

import "@f-ewald/components/empty-state.js";

Usage

<empty-state heading="No results found" description="Try adjusting your search or filters.">
  <span slot="icon">...</span>
  <ui-button slot="actions" variant="primary">Clear filters</ui-button>
</empty-state>
<empty-state size="sm" heading="No pinned items"></empty-state>

Attributes / properties

PropertyAttributeTypeDefaultDescription
headingheadingstring""The primary line.
descriptiondescriptionstring""The supporting line under the heading. Omitted entirely when empty.
sizesize"sm" | "md""md"sm for a small panel/sidebar, md (default) for a full page region. md matches the pre-size look exactly.
headingLevelheading-levelnumber2Heading rank the heading is exposed as, 1-6. An empty-state fills a page, a panel, or a sidebar, so no single rank is right everywhere; set this to whatever the surrounding outline needs. Applied via aria-level on the rendered h2, which overrides the element's native rank for assistive technology.

Events

None.

Slots

SlotDescription
iconOptional leading glyph. The consumer supplies it (e.g. an inline SVG icon).
(default)Optional rich body content, an alternative to description.
actionsOptional call to action, e.g. a ui-button.

CSS custom properties

Custom property
--ui-font
--ui-font-size
--ui-font-size-lg
--ui-font-size-sm
--ui-font-weight-regular
--ui-font-weight-semibold
--ui-line-height-normal
--ui-line-height-tight
--ui-text
--ui-text-muted