Fair point about copying text. Next version. 😉
I whipped this up pretty quick, so the x is just for show at the moment, since the quick thing to do for demo purposes was to close on click or if the ENTER key is pressed and the toast has focus.
The real question was what type of element to use. So far it’s one vote for <div />.
Me too, <div> for the win. I wouldn't use <button> for sure as the toast itself wouldn't have the close action later on as you say.
Note: nice cover photo 😆 (I'm hungry now).
I made it so you have to click the x button now.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.