React Toast Component
Custom push notification (Toast) implementation under React + stayed by TailwindCSS.
This is custom toast component implemented by react hooks + React Context API and stayled using tailwindCSS framework. Feel free to inspirate by implementation :) This is trim of my UI lib that i use for my projects.
This componnent allow to push notifications to user screen and auto remove it after set or default time..
Example implements this push-Events:
- Info
- Error
- Warning
- Success
- Custom body
Concepts
- Responsive
- Using Hooks and Context API
- Using Tailwind and Fontawesome
(All can be adjusted by endpoint user)
Installation
- Clone the repo
- Restore packages
yarn install
- Build and run demo
yarn run start
Configuration API
Toast Provider
- Usually placed in Providers.tsx or on top of App.tsx
- Give you access to toast
- In this example toast are send from "HomePage"
Use hook to access toast actions
Example:
Various types to push
Predefined types (can be extended)
Support message truncate trim
Pass any custom React.ReactNode component to body
Various toast position