GitHub

/ toast

Toast

@kumiki/components/toast

Compound <Toaster> / <Viewport> / <Item> / <Title> / <Description> / <Close> for transient notifications with auto-dismiss + hover-pause.

This component, layer by layer

Styled, copy-paste presets (preview). Run pnpm kumiki add to drop the source into your project, then edit freely.

Live preview

Live preview…

Install
pnpm add @kumiki/atelier
Auto-dismissing toasts
<script lang="ts">
  import { Tailwind as Toast } from '@kumiki/atelier/toast';
  let counter = 0;
</script>

<Toast.Toaster defaultDuration={4000}>
  {#snippet children({ toasts, controller })}
    <button onclick={() =>
      controller.add({
        id: `s-${++counter}`,
        title: 'Saved',
        description: 'Your changes were saved.',
        type: 'success',
      })}
    >Save</button>

    <Toast.Viewport>
      {#each toasts as toast (toast.id)}
        <Toast.Item {toast}>
          <Toast.Title>{toast.title}</Toast.Title>
          {#if toast.description}<Toast.Description>{toast.description}</Toast.Description>{/if}
          <Toast.Close />
        </Toast.Item>
      {/each}
    </Toast.Viewport>
  {/snippet}
</Toast.Toaster>

/ accessibility

Accessibility

axe-core — run on every PR (LTR + RTL × every documented state).

Keyboard

No component-specific keymap. Inherits standard browser focus / activation behaviour.

Test discipline

  • axe-core — run on every PR (LTR + RTL × every documented state).
  • APG keyboard tests — Playwright, hand-written per pattern.
  • VoiceOver / NVDA — Guidepup nightly schedule.
  • Type-level required names — title / aria-label / aria-labelledby.
Read the W3C ARIA APG pattern ↗