MIT
Open Source

CogoToast

Beautiful, Zero-Configuration, Toast Messages

- Plug & Play. No configuration required

~ 4K Gzipped (All Inclusive of Icons, Styles, & Code)

- Completely Customizable

- Built with React

5 Built in Types

Get Started, Plug & Play

Install via NPM or Yarn

npm install --save @successtar/cogo-toast
yarn add @successtar/cogo-toast

Usage

import cogoToast from '@successtar/cogo-toast';
cogoToast.success("Success!");

Positions & Heading

Use JSX

cogoToast is built using React. Which means any valid jsx can be used as the message in cogoToast

cogoToast.info(
<div>
<b>Awesome!</b>
<div>Isn't it?</div>
</div>
);

Returns a Promise, With Useful Callbacks

Returns a promise which resolves when the toast is about to hide.

This can be useful to do some action when the toast has completed showing.

cogoToast.loading('Loading your data...').then(() => {
cogoToast.success('Data Successfully Loaded');
});

When hideAfter = 0, It returns a callback function that hides the toast, instead of a promise.

Only ~ 4K Gzipped

The package contains the minified build file, along with the SVG Icons and the Styles

Built into the Code, with a total of ~4K Gzipped

Made with atCogoport - Simplifying International Logistics

Star on Github
html>