Menu
All plugins

Popover and Tooltip for Bricks

Two things in one element. A tooltip shows a few words of plain text on hover or keyboard focus. A popover holds any Bricks content behind a button: text, images, links, buttons, even a form. Both place themselves, flip to the other side when there is no room, and stay on screen.

Open the live demo

Adding one

  1. Add Popover and Tooltip to the page (General).
  2. Choose Popover or Tooltip for Type, and write the Trigger text.
  3. For a tooltip, type the tooltip text. For a popover, drop elements inside it.

The trigger

  • Looks like a button, a link, or plain text with a dotted underline.
  • An optional icon: info, question mark, plus or chevron. Tick Icon only for a small round icon button; the text stays for screen readers.
  • It is always a real button, so it can be reached and used from the keyboard.
  • Trigger text and tooltip text accept dynamic data, so in a query loop every item can have its own.

Opening

  • Tooltip: opens on hover and keyboard focus. On touch screens a tap opens it.
  • Popover: opens on click, or on hover and click. When it opens on hover, clicking keeps it open.
  • An optional wait before opening on hover, and how long it stays open after the pointer leaves, so people can move onto it.
  • Clicking outside closes a popover (optional), and opening one can close any others (optional).
  • Add the class ppfb-close or the attribute data-pp-close to any element inside a popover to make it a close button.

Placement

  • Preferred side: automatic (below, above, right, left, whichever fits first), or choose one. It flips to the opposite side when it does not fit and is held inside the screen.
  • Line up with the start, centre or end of the trigger.
  • Distance from the trigger and space kept from the screen edge, both settable per breakpoint.
  • An optional arrow that keeps pointing at the trigger even when the panel is pushed back on screen.
  • Fade, rise, scale or no animation, with a speed. People who prefer reduced motion get none.

Style

Panel background, text colour, border colour, corner radius, padding, widest width, shadow and typography, plus the trigger colour, text colour and typography. Tooltips are dark by default and popovers are light.

Keyboard and screen readers

  • A tooltip is linked to its trigger with aria-describedby, and Escape dismisses it.
  • A popover reports open or closed on the trigger. Opening it from the keyboard moves focus into it, Tab stays inside, and Escape closes it and returns focus to the trigger.
  • The panel can be hovered without it disappearing.

Good to know

  • In the builder the panel is shown open beneath the trigger so you can edit and style it. Untick Keep open in the builder to hide it.
  • Control it from JavaScript with PPFB.open(element) and PPFB.close(element).
  • Tooltips are for short plain text. Put anything interactive in a popover.