Skip to content

Toast

Non-blocking notifications. A "host component + composable" pair: mount LxToastHost once at your app root, then trigger with useToast() from any component.

Mount the host

vue
<!-- App.vue (app root, once) -->
<template>
  <RouterView />
  <LxToastHost />
</template>

<script setup lang="ts">
import { LxToastHost } from '@luxeanor/ui'
</script>

This docs site already mounts the host in its layout — the demo below just works.

Trigger

API

useToast()

MethodSignatureDescription
show(type: 'success' | 'error' | 'info' | 'warning', message: string, duration = 3000)generic trigger
success / error / info / warning(message: string)semantic shortcuts (3s)
  • No-op under SSR (module-level state never leaks across requests)
  • Auto-dismisses; no manual close

Full mechanics: useToast.