Trigger built in notifications
How can I show a notification using the built in notification snackbars? Is there any method I can use as a service without having to reimplement notification provider?
2 Replies
Hi @❴𝖒𝖔𝖗❵. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Yes, you can use the built-in notification providers in Refine to show notifications without having to reimplement the notification provider. Refine offers out-of-the-box support for several design systems and UI libraries such as Material UI, Ant Design, Mantine, and Chakra UI.
To use a built-in notification provider, you need to import the notification provider and pass it as a prop to the
Refine
component. Here is an example of how to do this:
(Source: refine.dev (https://refine.dev/blog/react-toastify#notification-providers-in-refine))
To open and close notifications, you can use the useNotification
hook. Here is an example:
(Source: refine.dev (https://refine.dev/docs/guides-concepts/notifications#built-in-notification-providers))
Please note that in most cases, you won't need to manually open and close notifications, as Refine typically manages notifications for you automatically.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@245678638211661824> kapa.ai is still learning and improving, please let us know how it did by reacting below