Empty State
<wa-empty-state>
Communicates that a collection or view has no content, with an optional graphic and supporting text.
Examples
With an image
Use image-src instead of icon to display an illustration. The headline becomes the image's alternative text.
Alignment
Use logical alignment values so the layout follows the document's writing direction.
Custom graphic size
The graphic part can resize either an icon or image.
Notes
- Set either
iconorimage-src. When both are present,icontakes precedence. - Override
--wa-empty-state-min-heightto change the component's minimum height. - The default alignment is
center;startandendare also available.
API
Importing
If you're using the autoloader or a hosted project, components load on demand — no manual import needed. To cherry-pick a component manually, use one of the following snippets.
Import this component directly from the CDN:
import 'https://cdn.yoummday.com/packages/@yoummday/webawesome/0.5.1/dist/components/empty-state/empty-state.js';
After installing Web Awesome via npm, import this component:
import '@yoummday/webawesome/dist/components/empty-state/empty-state.js';
If you're self-hosting Web Awesome, import this component from your server:
import './webawesome/dist/components/empty-state/empty-state.js';
To import this component for React 18 or below, use the following code:
import WaEmptyState from '@yoummday/webawesome/dist/react/empty-state/index.js';
Attributes & Properties
Learn more about attributes and properties.
| Name | Description | Reflects |
|---|---|---|
alignmentalignment |
Aligns the content using logical directions.
Type
'start' | 'center' | 'end'
Default
'center'
|
|
headlineheadline |
The empty state's headline. It is also used as the image's alternative text.
Type
string
Default
''
|
|
iconicon |
The name of the Web Awesome icon to show. Takes precedence over
imageSrc.
Type
string
Default
''
|
|
imageSrcimage-src |
The URL of an image to show when no icon is set.
Type
string
Default
''
|
|
messagemessage |
Supporting text displayed below the headline.
Type
string
Default
''
|
CSS Custom Properties
Learn more about CSS custom properties.
| Name | Description |
|---|---|
--wa-empty-state-min-height |
The minimum height of the component.
Default
8rem
|
CSS Parts
Learn more about CSS parts.
| Name | Description | CSS selector |
|---|---|---|
empty-state |
The component's content container. |
::part(empty-state)
|
graphic |
The wrapper around the icon or image. |
::part(graphic)
|
headline |
The headline element. |
::part(headline)
|
message |
The supporting message element. |
::part(message)
|
base |
An alias for the component's content container. |
::part(base)
|
Dependencies
This component automatically imports the following elements. Sub-dependencies, if any exist, will also be included in this list.