1.6.0 • Published 4 months ago

react-strawberry-toast v1.6.0

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

React-Strawberry-Toast

A simple and customizable React toast library

Documentation

For more detailed information, please refer to the official Documentation

Installation

npm i --save react-strawberry-toast
yarn add react-strawberry-toast
pnpm i --save react-strawberry-toast

Usage

import { ToastContainer, toast } from 'react-strawberry-toast';
import 'react-strawberry-toast/dist/style.css';
  
function App() {
  const click = () => {
    toast('hello strawberry toast');
  };
      
  return (
    <>
      <ToastContainer />
      <button type='button' onClick={click}>click</button>
    </>
  );
}

API

<ToastContainer />

OptionDescriptionTypeDefault
positionGlobal toast's Positiontop-left, top-center, top-right, bottom-left, bottom-center, bottom-righttop-center
containerIdToastContainer's unique idString
reverseDirection when toast appearBooleanfalse
classNameClass of ToastContainerString
styleStyle of ToastContainerObject
gapGap Between toastsNumber9
pauseOnActivatePause Toast timer when blur events occursBooleantrue
limitLimit the number of toast to be displayedNumber

toast

OptionDescriptionTypeDefault
toastIdToast's unique IdString
positionPosition per toasttop-left, top-center, top-right, bottom-left, bottom-center, bottom-righttop-center
containerIdID shown in the Toast Container Unique IDString
pauseOnHoverOption that sets the timer to stop or not when a hover event occursBooleantrue
iconThe icon to be displayed in the toastReactNode
timeOutTime for toast to disappearNumber3000
removeTimeOutTime for toast to remove In Toast ListNumber200
classNameClass of toastString
styleStyle of toastObject
targetTarget element where toast will be locatedObject

License

MIT

1.6.0

4 months ago

1.5.4

5 months ago

1.5.3

5 months ago

1.5.2

5 months ago

1.5.1

5 months ago

1.5.0

5 months ago

1.4.0

5 months ago

1.3.0

5 months ago

1.2.2

6 months ago

1.2.1

6 months ago

1.2.0

6 months ago

1.1.0

6 months ago

1.0.0

6 months ago

1.0.0-alpha.3

6 months ago

1.0.0-alpha.2

6 months ago

1.0.0-alpha.1

6 months ago