Back to Scalar

Scalar useToasts()

packages/use-toasts/README.md

latest944 B
Original Source

Scalar useToasts()

Installation

bash
npm install @scalar/use-toasts

Usage

vue
// App.vue
<script setup>
import { ScalarToasts } from '@scalar/use-toasts'
</script>
<template>
  <ScalarToasts />
</template>
vue
// 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>