Skip to content
Focsd homeFocsd homeFocsd
Forms

Empty state

Explains why a view is empty and what to do next.

  • Tag: focsd-empty-state
  • Pattern: Static
  • Category: Feedback

Example

Reports you create will appear here.

Create report
HTML
<focsd-empty-state headline="No reports yet" icon="search">
<p>Reports you create will appear here.</p>
<focsd-button slot="actions" variant="action">Create report</focsd-button>
</focsd-empty-state>

Usage

Import the module once, then use the tag like any HTML element. Every framework below renders the same element; see Frameworks for setup.

<script type="module">
import '@focsd-dev/components/focsd-empty-state.js';
</script>
<focsd-empty-state headline="No reports yet" icon="search">…</focsd-empty-state>

API

Attributes

AttributePropertyTypeDefault
headlineheadlinestring—
levellevelnumber2
iconiconstring—
icon-libraryiconLibrarystring—

Slots

SlotDescription
(default)Default content.
actionsButtons or links for the next step.
iconAny icon markup (an SVG, an icon component, an icon-font element), instead of icon.

CSS parts

Style the inside of the component with ::part(), for example focsd-empty-state::part(actions).

PartDescription
actionsThe actions element.
bodyThe body element.
emptyThe empty element.
headlineThe headline element.
iconThe icon element.

Accessibility

  • A real heading (level from level, default 2) so the state is discoverable by heading navigation.
  • Not a live region: announce changes elsewhere if content disappears after an action.