Description
react-alert is a React library for showing alert messages. You wrap your app in a Provider and give it an alert template and optional options. Then you import the useAlert hook to show alerts from any component, or use a higher-order component. The package ships three templates, Basic, Dark and Material UI, and you can write your own template for a custom look. A message can be a plain string or a component. Options such as position, type and transition are passed to the Provider, and the README lists the constants for these settings and their default values. The API section explains what you can do with the alert object the hook returns. To show alerts in several positions at once, you can nest multiple AlertProviders in the tree, or use different contexts to reach each kind of alert separately.…
Highlights
- Alerts from any component with useAlert
- Basic, Dark and Material UI templates
- Custom alert templates
- Position, type and transition options
Ratings & Reviews
No ratings yet
Be the first to rate react-alert.
People also visit

react-notifications-component
React component for creating notifications on the fly
react-alert FAQ
What is react-alert?
A React library for showing alert messages through a Provider and a useAlert hook.
How do I show an alert?
Wrap your app in the Provider, import useAlert, then call the alert from a component. A higher-order component also works.
Which templates are included?
Basic, Dark and Material UI. You can also write your own template.
Can I show alerts in more than one place?
Yes. Nest several AlertProviders in the tree, or use different contexts for each type of alert.
What do I need to install?
The package and the peer dependencies listed in the README, installed with npm or yarn.
What are the best react-alert alternatives?
Popular alternatives to react-alert include react-notifications-component, react-toastify and react-hot-toast. See all react-alert alternatives
















