Skip to content

Toast

Toast is used to display messages in an overlay.

Toast component is controlled via the ToastService, it is automatically loaded in the vue application

You only need to load the aptoast component into the app once. Used for teleport.

ts
  <ApToast />

Then call the useToast composable with your toast message.

Example Toasts

Success

ts
import {useToast} from 'active-designsystem'
const toast = useToast()

  toast.add({
    severity: 'success' ,
    summary: 'Success',
    detail: 'Message Content',
    life: 3000 })
ts
import {useToast} from 'active-designsystem'
const toast = useToast()

  toast.add({
    severity: 'warn' ,
    summary: 'Warning',
    detail: 'Message Content',
    life: 3000 })
ts
import {useToast} from 'active-designsystem'
const toast = useToast()

  toast.add({
    severity: 'error' ,
    summary: 'Danger',
    detail: 'Message Content',
    life: 3000 })

Parameters

NameType
severity'error', 'success', 'warn'
summarystring
detailstring
lifeNumber

Last updated: