@scalar/use-toasts

v0.7.7
display toasts in Vue
composable notifcation toast vue vue3

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>
npm i @scalar/use-toasts

Metadata

  • MIT
  • >=18
  • Scalar
  • released 10/14/2024

Downloads