dssoca docs
GitHub repository

EmptyState

Empty / error / no-results placeholder.

A centred placeholder for empty, error, or no-results states, with a decorative glyph or `visual` snippet, a message, and primary/secondary actions plus a low-emphasis footer. `compact` and `fullWidth` density options; the title heading level is configurable (or `false` for a plain paragraph). Errors announce assertively, others politely.

Demo

live · storybook Open in Storybook

Demo loads from https://dssoca-storybook.vercel.app/. Run pnpm storybook for it to render locally.

Usage

svelte
<script>
  import { EmptyState, Button } from 'dssoca';
</script>

<EmptyState title="No services yet" message="Add one to get started." icon="grid">
  {#snippet action()}
    <Button variant="primary">+ add</Button>
  {/snippet}
  {#snippet secondaryAction()}
    <Button variant="ghost">import</Button>
  {/snippet}
</EmptyState>

Props

PropTypeDefaultDescription
variant'empty' | 'error' | 'no-results''empty'Tone of the placeholder (error → role="alert").
titlestringRequired. Heading text.
messagestringSupporting message.
iconstringDecorative glyph fallback when no `visual` snippet is given.
visualSnippetVisual slot — drop in an <Icon>, illustration or <img> (rendered aria-hidden).
actionSnippetPrimary action slot (e.g. a button).
secondaryActionSnippetSecondary, lower-emphasis action beside the primary one.
footerSnippetLow-emphasis footer (tertiary links) below everything.
ariaLabelstringAccessible name for the live region — distinguishes multiple status/alert regions on one page. Optional; the visible `title` already provides the content.
headingLevelnumber | false2Heading level (aria-level); `false` renders a plain <p> with no heading role.
compactbooleanfalseCompact density — drops padding and shrinks the title for inline/cell use.
fullWidthbooleanfalseRemove the centred max-width cap and span the container.
size'sm' | 'md' | 'lg'Per-instance size override; inherits the ancestor `data-size-variant` when unset.