crostini

1.5.1 • Public • Published

Crostini

A super simple toast notification

npm install crostini
import crostini from 'crostini';

// show a regular notification
crostini("Document successfully archived");

// show a notification with default error styles
crostini("Error: Can't save data", {type: "error"});

// overwrite default styles and behavior
crostini("Successfully signed up! 🎉", { 
  slideInFromTop: true, // slide in from top instead of bottom
  backgroundColor: "#4f46e5", // set a custom background color
  textColor: "#fff", // set a custom text color
  customCss: "border: 3px solid #fff; border-radius: 8px;" // overwrite the default css (on the top-level .crostini element only)
})

Or simply:

<script src="https://cdn.jsdelivr.net/npm/crostini@1.4.0/dist/crostini.umd.js"></script>

Original Project

This library is based on a Pen by Pierre Smith: https://codepen.io/kipp0/pen/pPNrrj

Readme

Keywords

none

Package Sidebar

Install

npm i crostini

Weekly Downloads

3

Version

1.5.1

License

SEE LICENSE IN LICENSE.md

Unpacked Size

90.3 kB

Total Files

16

Last publish

Collaborators

  • panphora