ErrorState
What a page or a panel shows when loading failed.
Example
Rounds did not load
The server did not answer (tries: 0).
<script lang="ts">
import { ErrorState } from '@onlywin/ui-svelte';
let tries = $state(0);
</script>
<ErrorState
title="Rounds did not load"
description={`The server did not answer (tries: ${tries}).`}
onRetry={() => (tries += 1)}
/>Usage
Do
- Offer a retry when retrying can work.
Don’t
- Do not show error codes alone; say what happened.
Accessibility
- An alert, so screen readers hear it at once; the retry is a button.
Keyboard
| Keys | Action |
|---|---|
Enter, Space | Activate |
Props
The same props in both frameworks. In React, class is className, events are camelCase (onClick),
content passed as Svelte snippets is a ReactNode prop, every bindable value has a default… twin for uncontrolled use,
and elementRef reaches the DOM element.
| Prop | Type | Default | Description |
|---|---|---|---|
description | string | — | |
onRetry | () => void | — | |
retryLabel | string | — | |
title | string | — |