Embedded MFE widgets automatically resize their container to match content height. Dynamic forms, tables, and expandable sections render at their natural height without layout workarounds.
Where: This change applies to Lightning Experience, Experience Builder sites, and Experience Cloud LWR sites in all editions.
How: Auto-resizing is active by default. The framework observes content height changes inside the iframe and adjusts the container automatically. Auto-resize affects height only — width is always 100% of the parent container.
External widgets must import @salesforce/experimental-mfe-bridge for auto-resizing to work. The bridge handles height calculation and communication with the host.
Keep these considerations in mind:
- To cap maximum height, wrap the shell in a container with
max-heightandoverflow: auto. - To disable auto-resize, listen for the
resizeevent on<lwc-shell>and callevent.preventDefault(). - Avoid
min-height: 100vhorheight: 100vhon the widget's root container — viewport units cause an infinite resize loop. - Reset body margins in your widget (
margin: 0; padding: 0) to prevent unnecessary scrollbars.
Supported browsers: Chrome 64+, Firefox 69+, Safari 13.1+, Edge 79+.