Overview
Import ScrollExpand from the scroll-expand entry and pass an image or video src. title renders as a real heading (level 2 by default) that labels the section, hint is a small aria-hidden cue, and children are the overlay revealed at full bleed. The defaults are scroller window, startWidth 42, startHeight 58, zoom 1.35, distance 1.2, hold 0.35, smoothing 100 ms, and appearance default.
With scroller window, the section follows the page or any scrolling ancestor, and its stage is one small-viewport height tall. Pinning uses position: sticky, so no ancestor between the section and its scroller may set overflow hidden, auto, or scroll; use overflow-clip to round or clip a wrapper. With scroller self, the component is its own focusable scroll container; give it a height with className. The current phase is exposed as data-state (resting, expanding, expanded) for styling.
Consumers using Tailwind v4 must include the package in their @source scan so both light and dark token classes are generated.
Common use cases
- Product and campaign heroes that open onto a photo or film.
- Chapter breaks in long-form and editorial pages.
- Portfolio and case-study showcases inside a fixed-height frame.
FAQ
Does it hijack scrolling?
No. It never intercepts wheel or touch input. A tall track and a sticky stage pin the section while the page, or the component itself, scrolls normally.
Can keyboard users reach the overlay content?
Yes, once it is visible. Overlay content stays inert until it is mostly revealed, so focus never lands on invisible links. A self-scrolling section is focusable and scrolls with the arrow and Page Down keys.
What happens with reduced motion?
The section shows its expanded composition at its normal height, without pinning or scroll-linked movement, and video never plays.


