Detalhes do pacote

@scalar/use-toasts

scalar196.8kMIT0.8.0

display toasts in Vue

composable, notifcation, toast, vue

readme (leia-me)

Scalar useToasts()

Version Downloads License Discord

Installation

npm install @scalar/use-toasts

Usage

// App.vue
<script setup>
import { ScalarToasts } from '@scalar/use-toasts'
</script>
<template>
  <ScalarToasts />
</template>
// ChildComponent.vue
<script setup>
import { useToasts } from '@scalar/use-toasts'

const { toast } = useToasts()

const sendMessage = () => {
  toast('This is a message from the toaster!', 'success', { timeout: 2000 })
}
</script>