Toast React Component made with typeScript and parcel
a configurable toasts for react projects.
Local setup
- Clone the repo
- Run
npm install
- Run
npm start
for demo and development - Run
npm run build
for production ready build (can be found inlib
)
Using component
- Add component to your project via
npm install bxjs-react-component
- Import and use time like so:
;// TOP = "position_top", //BOTTOM = "position_bottom",//LEFT = "position_left",//RIGHT = "position_right"//duration is in seconds 1=>1 second <Toast show=true backgroundColor="red" text="this is a text of the toast" position="position_top" duration=1 />;
don't forget to copy this css into your css file
/* The snackbar - position it at the bottom and in the middle of the screen */ /* Animations to fade the snackbar in and out */ @- } @ } @- } @ }