@tokene/toasts
TypeScript icon, indicating that this package has built-in type declarations

0.0.0-rc.19 • Public • Published

@tokene/toasts

These packages aim to provide developers with a set of commonly used components for building TokenE web applications.

version (scoped package) types tree-shaking checks

Getting Started

Installing

yarn add @tokene/toasts

Setup

import { ToastPlugin } from '@tokene/toasts'
import '@tokene/toasts/dist/index.css'

app.use(ToastPlugin)

usage

const { showTxToast, removeToast } = useNotifications()

lastToastId.value = showTxToast('pending', txLink!)

removeToast(lastToastId.value!)
showTxToast('success', txLink!)

Or

import { ToolkitBus } from '@tokene/toolkit'
import { useNotifications, type NotificationPayload } from '@tokene/toasts'

const { showToast } = useNotifications()

ToolkitBus.on(Bus.eventList.success, payload =>
  showToast('success', payload as NotificationPayload),
)
ToolkitBus.on(Bus.eventList.warning, payload =>
  showToast('error', payload as NotificationPayload),
)
ToolkitBus.on(Bus.eventList.error, payload =>
  showToast('warning', payload as NotificationPayload),
)
ToolkitBus.on(Bus.eventList.info, payload =>
  showToast('info', payload as NotificationPayload),
)
ToolkitBus.on(Bus.eventList.default, payload =>
  showToast('default', payload as NotificationPayload),
)

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Readme

Keywords

none

Package Sidebar

Install

npm i @tokene/toasts

Weekly Downloads

0

Version

0.0.0-rc.19

License

MIT

Unpacked Size

6.89 MB

Total Files

19

Last publish

Collaborators

  • admindl
  • lukachi
  • volendi
  • arvolear