Live data from Hacker News

Show HN: Popper.js, a 3KB library to manage tooltips and popovers

github.com

31–40 of 62 posts

Re: Show HN: Popper.js, a 3KB library to manage tooltips and popovers

#31

I am wondering how well does this work on svg? Also, I couldn't find the option to choose tooltip or popover, what's the default and how do I specify tooltip/popover?

The library just positions poppers, it doesn't decide about the behavior.

I've tested popper.js on svg and it seems to work well but I need to write some test for them.

Re: Show HN: Popper.js, a 3KB library to manage tooltips and popovers

#32

I am wondering how well does this work on svg? Also, I couldn't find the option to choose tooltip or popover, what's the default and how do I specify tooltip/popover?

The library just positions poppers, it doesn't decide about the behavior. I've tested popper.js on svg and it seems to work well but I need to write some test for them.

Ah, I see. I was wondering for a long time why the "poppers" in the examples are static.

Maybe coding the animation requires more JavaScript and increase the code base? Seems to me that some basic animation as popover/tooltip would be nice to have.

Re: Show HN: Popper.js, a 3KB library to manage tooltips and popovers

#33

Earlier quoted context omitted.

Hi! Popper.js dev here. There are several advantages: - The size is half of Tether (3.5 vs 7); - Popper.js doesn't need any additional CSS in your page; - It works even with elements not placed as direct children of body; - It's much much faster (compare both on mobile, you'll see Tether lagging a lot!); - It automatically detects the size of the tooltip arrow; - Inside Popper.js you already have a way to create tool…

What minimum browsers does this support? I glanced through the documentation, but did not notice it. Awesome work, by the way.

Tested it in browserstack, works in IE10+. IE9 is close but doesn't work when the browser is small. IE8 doesn't work at all (go figure)

Re: Show HN: Popper.js, a 3KB library to manage tooltips and popovers

#34
This is not a 3kb library for popups, given that the main source file popper.js is 44.6kb and the minimized version is 13.5kb large. I'm assuming 3kb refers to the gzipped size, but this isn't so meaningful because parsing and loading the javascript is more significant than reading a few extra kilobytes from a socket.

That said, this looks like a very nice library.

Re: Show HN: Popper.js, a 3KB library to manage tooltips and popovers

#35
post #34

This is not a 3kb library for popups, given that the main source file popper.js is 44.6kb and the minimized version is 13.5kb large. I'm assuming 3kb refers to the gzipped size, but this isn't so meaningful because parsing and loading the javascript is more significant than reading a few extra kilobytes from a socket. That said, this looks like a very nice library.

Yes I refer to the gzipped size as usually the other libraries do. I don't think that gzipping is so heavy on system resources considering that most of the websites are gzipped nowadays

Re: Show HN: Popper.js, a 3KB library to manage tooltips and popovers

#36

Earlier quoted context omitted.

The library just positions poppers, it doesn't decide about the behavior. I've tested popper.js on svg and it seems to work well but I need to write some test for them.

Ah, I see. I was wondering for a long time why the "poppers" in the examples are static. Maybe coding the animation requires more JavaScript and increase the code base? Seems to me that some basic animation as popover/tooltip would be nice to have.

I'm trying to keep the library as specialized as possible. Nothing prevent you/someone to write a plugin to add more behaviors tho

Re: Show HN: Popper.js, a 3KB library to manage tooltips and popovers

#37
post #34

This is not a 3kb library for popups, given that the main source file popper.js is 44.6kb and the minimized version is 13.5kb large. I'm assuming 3kb refers to the gzipped size, but this isn't so meaningful because parsing and loading the javascript is more significant than reading a few extra kilobytes from a socket. That said, this looks like a very nice library.

Yes I refer to the gzipped size as usually the other libraries do. I don't think that gzipping is so heavy on system resources considering that most of the websites are gzipped nowadays

gzipping is cheap, but it's not a very meaningful indicator of anything. It only refers to bandwidth and only for the first site visit. Even for js-heavy sites all the minimized and gzipped javascript put together will be smaller than a single png file.

That the library doesn't have dependencies is much more important, because then it can be loaded in parallel with other libraries. That matters a lot for performance.

Re: Show HN: Popper.js, a 3KB library to manage tooltips and popovers

#38
Popovers are the worst feature of the modern web. They're usually a very aggressive way of drawing attention to something I don't care about. Even when they're supposed to be a useful part of a web page interface, it's an obsolete modal dialog paradigm.

Should I block popper.js via an ad blocking filter?

Re: Show HN: Popper.js, a 3KB library to manage tooltips and popovers

#39

Popovers are the worst feature of the modern web. They're usually a very aggressive way of drawing attention to something I don't care about. Even when they're supposed to be a useful part of a web page interface, it's an obsolete modal dialog paradigm. Should I block popper.js via an ad blocking filter?

I'm not sure I understand your comment, perhaps we have different understanding of what a popover is?

For me a popover is essentially a small overlay of additional contextual information, visually attached to whatever it's providing additional context for. Historically triggered by hover, but increasingly triggered by click/touch. A drop-down menu in a navigation bar is a popover.

Re: Show HN: Popper.js, a 3KB library to manage tooltips and popovers

#40

Earlier quoted context omitted.

In my opinion the only one that wasn't immediately obviously an example was the scroll one, due to the lack of scrollbars (I thought "scroll" was referring to the page and was confused about why it wasn't moving when I scrolled the page).

Stupid mac scrollbars :P I'll do something to increase the visibility of the examples then. Thanks again!

I wouldn't recommend the CSS route as you'd be working against a core OS feature. On OS X: System Prefs > General > Show scroll bars > "Automatically based on mouse or trackpad"; "When scrolling"; "Always".

It's possible via something like [1], but the problem is you are hardcoding colors for a specific OS version. The example given in the link is a much darker scrollbar than is present in Yosemite.

I'd just go the route of labeling the example more explicitly. By the way, nice job on the site. Very snazzy, and you didn't make the mistake a lot of people make which is to hijack the native scrolling.

[1] http://stackoverflow.com/a/10100209/2609094

Post reply on HN