← All Components
<mth-network-status>
Reactive network connectivity indicator subscribing idempotently to browser online/offline events with live-region announcements and retry action.
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-network-status>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/network-status"></script>
<mth-network-status online retryable>Example</mth-network-status>import '@methane-ui/ui/network-status';
import '@methane-ui/react';
export function Example() {
return <mth-network-status online retryable>Example</mth-network-status>;
}<script setup lang="ts">
import '@methane-ui/ui/network-status';
</script>
<template>
<mth-network-status online retryable>Example</mth-network-status>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/network-status';
import { MthNetworkStatusDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthNetworkStatusDirective],
template: `<mth-network-status online retryable>Example</mth-network-status>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/network-status';
import MthNetworkStatus from '@methane-ui/svelte/MthNetworkStatus.svelte';
</script>
<MthNetworkStatus online retryable>Example</MthNetworkStatus>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
online | online | boolean | true | Current connectivity state (true when online). |
showWhenOnline | show-when-online | boolean | false | Keeps the indicator rendered even while online is true. |
offlineLabel | offline-label | string | "" | Custom message shown when offline. |
onlineLabel | online-label | string | "" | Custom message shown when back online. |
retryable | retryable | boolean | true | Shows a retry button while offline. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-status-change | { online: boolean } | Fired when connectivity transitions between online and offline. |
mth-retry | undefined | Fired when the user triggers a manual retry check. |
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(online), :state(offline). | Conformance suite |
| i18n | Routes 3 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |