Comments (7)
Thanks for your input @luongvanphuc. I've just opened a PR adding Notyf events. You'll now be able to listen to 'click' and 'dismiss' events.
const notyf = new Notyf();
notyf.success('Foo bar')
.on('click', () => console.log('I was clicked'));
On the other hand, Yes/No callbacks can be implemented using custom HTML in the message content.
from notyf.
Personally I think this runs against the purpose of this library, sounds like you want more of a dialog then a notification. Check out Vex or Alertify for super-custom dialogs
from notyf.
Thanks both for your input on this issue!
It's a great idea to have those buttons and callbacks, but I have to agree with @toish in that Notyf's mission is to serve as a pretty simple, minimal library to show simple notifications.
I'm going to close this issue but I'm happy to reopen it if someone else brings back the discussion.
Thanks again for your input and sorry for being so silent lately.
from notyf.
@kith-and-kin yeah, that functionality is on the PR too. I'm just waiting for Friday to review my PR with a fresh brain. It'll be released on v3.8. Thanks for your input!
from notyf.
Well, I have to agree with you, this library does one thing and does it right.
Thank you for your refs!
from notyf.
@caroso1222 I've recently replaced toastr with notyf, and found that notyf doesn't have callback options, so I had to come back with toastr.
Personally I think the buttons may be not necessary but the callbacks do. Sometime we want to redirect user to somewhere after clicking on the noti.
I raise my idea here because my company app is really big and the bundle size is a big problem. It's best if we can use tiny libs for big apps.
In the contrary, I also agree with @jcalixte that "this library does one thing and does it right", so it's all up to you.
from notyf.
Thanks for your input @luongvanphuc. I've just opened a PR adding Notyf events. You'll now be able to listen to 'click' and 'dismiss' events.
const notyf = new Notyf(); notyf.success('Foo bar') .on('click', () => console.log('I was clicked');On the other hand, Yes/No callbacks can be implemented using custom HTML in the message content.
This would be great. I'd love a callback functionality on the dismiss button especially, so we can save whether a message has been dismissed by way of cookie.
from notyf.
Related Issues (20)
- Using long text
- Link to the documentation flag as insecure HOT 1
- [Feature Request] Config option for a custom node to attach toast notifications HOT 2
- How to make a notification appear only once HOT 2
- Website SSL certificate expired HOT 2
- I don't know how to properly set the position value on vue? HOT 1
- Will this work inside of a shadow DOM? HOT 1
- How to make the notification called only once. And he didn't write it into the document every time he called.
- Is there a way to set position per call ? HOT 1
- esc key
- I want to change the z-index.
- Different position moves existing notifications
- All of my styling dosent work (vuejs(composition api) ,tailwindcss)
- Icons don't display on warn, info type
- Long text creates curve?
- Uncaught (in promise) TypeError: notyf is undefined HOT 1
- Pause timer when the window loses focus
- Add "style" attribute to package.json
- dismiss button does not have an accessible name
- When toast hidden time, need to callback some other function?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from notyf.