1.0.0 • Published 10 months ago

bare-toasts v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

bare-toasts

A minimalistic, toast notification library.

Watch the demo

Features

  • Framework Agnostic: Works seamlessly with any JavaScript framework/library.
  • Lightweight: Minimal overhead.
  • Customizable: Easy to customize toast appearance.

Installation

npm install bare-toasts

Usage

import { ToastManager } from "bare-toasts";

const toastManager = ToastManager.getInstance();

toastManager.createToast({
    message: "Hello World",
    duration: 5000,
});

Parameters for createToast

ParameterTypeDescriptionDefault Value
messagestringThe message to display in the toast.
typestringThe type of toast (normal, success, info, warning, error).normal
positionstringThe position of the toast (top-left, top-right, bottom-left, bottom-right, top-center, bottom-center).bottom-right
durationnumberThe duration the toast should be visible (in milliseconds).3000
showIconbooleanDetermines whether to show an icon in the toast.true
classNamestringAdditional class names to apply to the toast.
stylesobjectInline styles to apply to the toast.
onShowfunctionA callback function to be called when the toast is shown.
onHidefunctionA callback function to be called when the toast is hidden.
1.0.0

10 months ago

0.1.1

11 months ago

0.1.0

11 months ago

0.0.10

11 months ago

0.0.9

11 months ago

0.0.8

11 months ago

0.0.7

11 months ago

0.0.6

11 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago