← All Components
<mth-empty-state>
Accessible empty, no-results, or error placeholder container with optional icon, heading, description, and action slots.
When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.
Live Interactive Preview
Ready · interact with <mth-empty-state>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/empty-state"></script>
<mth-empty-state variant="default" tone="neutral">Example</mth-empty-state>import '@methane-ui/ui/empty-state';
import '@methane-ui/react';
export function Example() {
return <mth-empty-state variant="default" tone="neutral">Example</mth-empty-state>;
}<script setup lang="ts">
import '@methane-ui/ui/empty-state';
</script>
<template>
<mth-empty-state variant="default" tone="neutral">Example</mth-empty-state>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/empty-state';
import { MthEmptyStateDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthEmptyStateDirective],
template: `<mth-empty-state variant="default" tone="neutral">Example</mth-empty-state>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/empty-state';
import MthEmptyState from '@methane-ui/svelte/MthEmptyState.svelte';
</script>
<MthEmptyState variant="default" tone="neutral">Example</MthEmptyState>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
heading | heading | string | "" | Primary empty state heading text. |
description | description | string | "" | Secondary explanatory text. |
variant | variant | 'default' | 'compact' | 'card' | "default" | Visual container layout variant (default, compact, card). |
tone | tone | 'neutral' | 'info' | 'warning' | 'danger' | "neutral" | Semantic icon badge tone (neutral, info, warning, danger). |
align | align | 'center' | 'start' | "center" | Horizontal alignment (center or start). |
roleMode | role-mode | 'region' | 'status' | 'none' | "region" | Semantic container role (region, status, or none). |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | Focus ownership matches focusModel="none". | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| states | Exposes ElementInternals CustomStateSet flags: :state(compact), :state(tone). | Conformance suite |
| i18n | Routes 1 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |