Ship useNotification hook
See original GitHub issueWe offer a variety of notification styles but unfortunately leave much of the animation and logic around display notifications to the end-user. We would like to codify this behavior/logic into a single hook, useNotification
, that would encapsulate this behavior and make it easier for product teams to display/render notifications in their UI. This may look like:
function MyComponent() {
const send = useNotification();
function sendNotification() {
send({ title: 'This is the notification title' });
}
return <button type="button" onClick={sendNotification}>Send test notification</button>;
}
Packages impacted
@carbon/react
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
useNotification hook #15 - carbon-design-system/roadmap
We would like to codify this behavior/logic into a single hook, ... Ship and document a React hook to send notifications to a...
Read more >react-notifications-hook - npm
Easily create your own notification system in your React app without having to buy into prescribed styling or templating.
Read more >React hooks & Context: Error when using context inside a ...
React Hook useEffect has a missing dependency: 'itemContext.actions'. Either include it or remove the dependency array ...
Read more >Power Real-Time Tracking Notifications with Webhooks ...
Use tracking webhooks to gather real-time data that can help influence decisions about your shipping workflow in real-time. Want to improve your ...
Read more >Building a reusable notification system with react hooks and ...
The problem While building a re-usable component we tend to forget what are the essential... Tagged with react, javascript, reactnotifier, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here’s a rough pass on how multiple inline notifications could stack and be dismissed. I kept it simple for now to make sure we like the overall mechanics.
@mjabbink @jeanservaas @tay1orjones Let me know if you have any feedback I should take into the next pass. Thanks!
https://user-images.githubusercontent.com/70543333/120850559-752c4300-c52c-11eb-9606-de8e26c54cbf.mp4
@johnbister
I like the updates you’ve done. I think the fade gradient can work and wonder what @jeanservaas thinks on the details of the gradient?
I like the addition of a taller notification in the stack to see what that looks like
I also think timeout bar is cool.