<kern-empty-state>
Placeholder where content would be: nothing created yet (empty), no matches for the current filters (no-results) or the data could not be loaded (error). Icon, heading, a sentence and the actions that help, e.g. «Add device», «Reset filters» or «Try again». The app decides which state applies; for a lost connection with data already shown, keep the data and put a kern-alert above it instead.
Only error is a live region (role="status", announced once when it appears). The heading is plain text, so it does not change the page outline; heading-level makes it a heading for screen readers when the state replaces a whole page section.
Examples
Variants
variant picks the icon and the default heading: empty when nothing was created yet, no-results when filters or a search match nothing, error when the data could not be loaded. The default slot holds one or two sentences, the actions slot the buttons that get the user going again. Only error is announced (once, as status).
Compact, own heading and icon
compact takes less room, for a table cell, a list or a small card. heading replaces the default text, icon the glyph (any Kern glyph, see kern-icon); icon="none" hides it.
| Name | IP | Status |
|---|---|---|
|
| ||
Whole page section
The heading is plain text, so a state inside a table or card does not add to the page outline. When the state stands in for a whole section of the page, heading-level exposes the heading to screen readers as a heading of that level; it looks the same.
Properties
compactboolean
Less space and a smaller icon, e.g. in a table cell or a card.
headingstring | undefined
Heading; defaults to a Kern text per variant («No entries yet», «No matches», «Could not load»).
headingLevel1 | 2 | 3 | 4 | 5 | 6 | undefined
Exposes the heading as a heading of this level (1–6) to screen readers, without changing its look.
icon"bulb" | "calendar" | "check" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "clock" | "close" | "copy" | "download" | "edit" | "external" | "eye" | "eye-off" | "filter" | "home" | "inbox" | "info" | "link" | "lock" | "menu" | "minus" | "moon" | "more" | "none" | "plus" | "power" | "refresh" | "search" | "settings" | "star" | "sun" | "thermometer" | "trash" | "upload" | "warn" | "wifi" | undefined
Glyph instead of the variant's default (see kern-icon); none hides the icon.
variant"empty" | "error" | "no-results"
Which state: sets the default icon and heading.
Slots
(default)Description: one or two sentences
actionsButtons, e.g. a kern-button
CSS parts
headingThe heading
iconThe icon