What is popover=hint?

Chris Coyier Chris Coyier on

If you know a bit about the popover API in HTML, you might know it’s basically 1) click a button 2) toggle visibility of another element. Una has a great article explaining that there is a bit more to it.

First, there are actually three kinds of popovers. There is the normal kind, which close when you click away (or ESC). If you don’t want that, there is the “manual” kind which requires very explicit closing and lives an isolated life, not affecting other popups. The new kind, “hint”, is an in-betweener where it can be opened without closing other normal popups, yet retains the light dismissal properties.

Second, it doesn’t have to be a click to open a popover. You could bind whatever you want in JavaScript naturally, but with a new interestfor attribute (and CSS friends) you can cause a trigger on essentially a hover (with a mouse) or focus (with a keyboard). All experimental stuff, but ✨cool✨.

Looking for a complete course on getting into web development?

Frontend Masters logo

We have a complete intro course to web development by renowned developer Brian Holt from Microsoft. You'll learn how to be a successful coder knowing everything from practical HTML and CSS to modern JavaScript to Git and basic back-end development.

7-Day Free Trial

Leave a Reply

Your email address will not be published. Required fields are marked *

$839,000

Frontend Masters donates to open source projects through thanks.dev and Open Collective, as well as donates to non-profits like The Last Mile, Annie Canons, and Vets Who Code.