Giter Club home page Giter Club logo

react-next-toast's Introduction

react-next-toast

๐Ÿ“ฆ Introducing react-next-toast ๐Ÿž

Tired of dealing with complex notification packages or having to spend time building components just to render alerts or toast notificaitons in your React projects? Look no further! Here, I introduce react-next-toast

๐Ÿš€ Why Choose react-next-toast??

  • Easy to use: react-next-toast was built with ease in mind - say goodbye to complex toast declarations - with react-next-toast you have a toast via a single function call.
  • Customizable: With our Four (4) different types of Toast Notifications - Success, Error, Warning and Info, you get a fine-tuned and different UI display for each which directly passes message from the choice of colour and design. It also provides option to choose duration of toasts, colours and fonts.
  • Lightweight: Designed with performance in mind as well, the package is designed to lightweight in other to ensure it does not slow down your app's performance.
  • Fully-typed: react-next-toast comes with TypeScript support out of the box to provide type safety and seamless renderings.

๐Ÿ“ How to Use:

  1. Install the package into your project
npm install react-next-toast
  1. Import the showToast & use in your Component:
import { showToast } from 'react-next-toast';

const MyComponent = () => {

const handleClick = () => {
    showToast.success('Log in successful')
}

return (
    <div>
      <h1>Hello Dev</h1>
      <button onClick={handleClick}>Log in</button>
    </div>
);
}
export default MyComponent;

Demo

react-next-toast-demo-gif

CodeSandbox

Code Sandbox Environment

๐Ÿ’ก Additional Features

You can customize the duration of the Toast Notification by passing time in ms as second parameter to the showToast function. The default is 5000 which is 5 seconds.

const handleClick = () => {
  showToast.error('incorrect login details', 4000)
}

Contribution

Project is OPEN SOURCE! Feel free to fork the repo and send a PR to contribute. I will be sure to merge if its a good piece. Thank you

NOTE: For more advanced customization, you can directly use the ToastNotification component and pass in the required props - duration, position, className.

Thank you for using `react-next-toast! ๐Ÿ™โค๏ธ If you experience any issue, have any questions or sugestions for improvement, feel free to raise an issue here on GitHub or reach out to me. Your feedback is very vital! โ˜บ:)

Cheers to toasting to simpler and delightful notes! ๐Ÿฅ‚

react-next-toast's People

Contributors

eimaam avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

react-next-toast's Issues

issue with zindex of Component

Works good
try fixing issue with zIndex with the ShowToast Component it appears below my navbar with the highest zIndex.

Request for a giphy

Would like to see a small giphy that shows how this would look like in it's base state in my application in the README

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.