0Pricing
React Academy · Lesson

Tooltips & Dropdown Menus with Portals

Use portals to render tooltips and dropdowns that escape overflow-hidden containers.

Welcome

In this lesson you will build tooltip and dropdown components that use React Portals to render in document.body, escaping parent overflow-hidden and z-index stacking context constraints.

The Overflow Problem

A tooltip positioned relative to its trigger button will be clipped if any ancestor has `overflow: hidden` or `overflow: scroll`. Moving the tooltip to document.body via a portal solves this completely.

All lessons in this course

  1. What Are React Portals?
  2. Building a Modal Component with Portals
  3. Handling Focus & Keyboard Traps in Modals
  4. Tooltips & Dropdown Menus with Portals
← Back to React Academy