overflow
The CSS property that decides what happens to content that does not fit in its box: show it, clip it or scroll it.
In more detail
overflow: hidden on an ancestor clips any overlay rendered inside it. The same property on document.body is used to stop the page scrolling while a modal is open.
Related terms
- scroll locking — Stopping the page behind an overlay from scrolling, usually by setting overflow: hidden on the body while the overlay is open.
- portal — A React feature, createPortal, that renders a component's children into a different place in the DOM, usually document.body.
- stacking context — A group of elements that the browser layers together, so their z-index values only compete with each other and not with the rest of the page.
- list virtualization — Rendering only the rows of a long list that are currently visible, plus a few extra, instead of creating DOM nodes for every item.
Taught in
- Overlay Architecture: Portals, Stacking Contexts & Backdrops — Design Systems & Component Engineering
- Visual Regression Testing: Playwright & Snapshot Differencing — Design Systems & Component Engineering
- React Portals: Escaping Stacking Contexts for Modals — React 19 & Modern Component Architecture
- Virtualization: Rendering Infinite Datasets Efficiently — React 19 & Modern Component Architecture