Skip to main
Link
A woman cradles her head in her hands and covers her eyes rather than looking at a laptop's screen.

Taking Interest

Navigating to a new page is a relatively significant change, but interest invokers provide a declarative way to peek into a page without fully committing. They can also provide an additional view on an action.

See more at web.dev »

To use an interest invoker, add the interestfor attribute to the trigger element with its value pointing to the id of the popover you want to open.

Interest invokers are somewhat unique to the web platform as a concept. Most events are in response to a user’s action that significantly changes the user’s context – they clicked a link to a new page, pressed play, or submitted a form.

Interest invokers drive more subtle behaviors. They allow for a temporary state before reverting back to the original state. It’s a much lower investment for the user.

The cost of a user accidentally triggering an action can be high – for example, if they lose (or send) a half-written email, or make an unintended purchase. If a user accidentally opens a popover, and then closes it, they will likely only be annoyed or distracted. Because the cost of accidentally triggering a popover is lower, you can make it easier for the user to trigger.

See the Pen Interest Invokers Delays by @jamessw on CodePen.

Read full article »

Posts about HTML

  1. Winging It post type

    Take Command with Invokers

    With special guest Luke Warlow

    Learn how to declaratively add behavior to buttons with the Invoker Commands API. Join James Stuckey Weber and Miriam Suzanne for a live conversation with special guest Luke Warlow, Web Platform Engineer at Igalia.

    see all Winging It posts
  2. Winging It post type

    htmx

    During our conversation, we discuss what htmx is, how it improves user experience, and walk through some examples of common UI patterns using htmx.

    see all Winging It posts