WlEmpty
Empty state: icon, title, description, action.
Components / Data v0.1.0
Content
icon
Default
title
description
No materials yet
Create the first material.
Full example
<div class="wl-stack" data-space="md">
<WlEmpty
v-if="!added"
icon="file"
title="No materials yet"
description="Create the first material."
><template #action><WlButton @click="added = true">{{ "Add material" }}</WlButton></template></WlEmpty>
<p v-else role="status">{{ "Material added." }}</p>
</div>No data, no results and custom slot
Adding the first article, clearing search, repeating the empty state, icon/default/action.
No materials yet
Add your first material.
Nothing found
No results for «archive».
Choose a folder
The default slot lets you add a documentation link and your own instructions.
Full example
<script setup lang="ts">
import { WlButton, WlEmpty, WlIcon, WlTag } from "legato-ui";
import { ref } from "vue";
const created = ref(false);
const query = ref("archive");
</script>
<template>
<div class="wl-stack" data-space="lg">
<WlEmpty
v-if="!created"
icon="file"
title="No materials yet"
description="Add your first material."
>
<template #action>
<WlButton size="sm" variant="primary" @click="created = true">{{ "Add first material" }}</WlButton>
</template>
</WlEmpty>
<div v-else class="wl-inline" data-space="sm">
<WlTag color="green">{{ "First material added" }}</WlTag>
<WlButton size="sm" variant="ghost" @click="created = false">{{ "Clear local list" }}</WlButton>
</div>
<WlEmpty
v-if="query"
icon="search"
title="Nothing found"
:description="'No results for «' + query + '».'"
>
<template #action>
<WlButton size="sm" @click="query = ''">{{ "Clear search query" }}</WlButton>
</template>
</WlEmpty>
<p v-else class="wl-text-body">{{ "Search cleared: all materials are available." }}</p>
<WlEmpty title="Choose a folder">
<template #icon><WlIcon name="folder" :size="36" /></template>
<p>
{{ "The default slot lets you add" }}
<a href="?view=docs">{{ "a documentation link" }}</a>
{{ "and your own instructions." }}
</p>
</WlEmpty>
</div>
</template>Props
Types, accepted values and literal defaults come from the public manifest. Inherited settings name their source; “Not set” means no default is declared.
| Prop | Type / values | Default | Purpose |
|---|---|---|---|
icon | WlIconInput | Not set | Icon (when no icon slot is provided). |
title | string | Not set | Title. |
description | string | Not set | Description (when no slot is provided). |
Events
No public events.
Slots
| Slot | Type / values | Content |
|---|---|---|
default | — | Custom description. |
icon | — | Custom icon or illustration. |
action | — | Button or another action below the description. |
Keyboard and accessibility
- Title/description/default explain missing data, filters or selection; title does not create an HTML heading itself.
- The action slot provides a specific next step: add data, clear a filter or select an object.
- A custom icon illustration stays decorative when text already explains its meaning; Empty does not change data itself.
Keyboard and application responsibilities
Provide a meaningful accessible name and connect labels, hints and errors to the focusable element. Check the behavior with your own data and a screen reader.
WAI-ARIA Authoring PracticesIn your application, check keyboard controls, zoom and focus visibility. State labels and required information must be readable in every theme.