You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
router-outlet should not affect layout (option to render as non-box/anchor) #64553
Which @angular/* package(s) are relevant/related to the feature request?
router
Description
is a marker element that does not contain the routed component’s DOM; the actual component root is rendered as a sibling after the outlet.
However, the outlet element itself still participates in layout (inline/box). This can interfere with CSS Grid/Flexbox flows, gaps, and alignment, forcing developers to add a global stylesheet rule like:
Officially document and ship a built-in global style (or recommend it prominently in the Router docs) so apps don’t need to rediscover it:
router-outlet{display: none /* or display: contents */;}
Alternatives considered
Keep relying on app-level CSS (router-outlet { display:none }).
Works, but it’s non-obvious, duplicated across apps, and easy to miss (especially inside Shadow DOM).
Reacted by hyperlife1119, Patryk Szafran and Alex Inkin
Every option seems just about as discoverable and forgettable as the css {display: none}. Everything requires a specific opt-in/out that you always have to remember in each instance if you need it.
Activity
feat(router): allow router outlet to be set on ng-container
crisbeto commentedon Oct 21, 2025
Something like #64562 should work for this case.
feat(router): allow router outlet to be set on ng-container (angular#…
atscott commentedon Oct 22, 2025
Every option seems just about as discoverable and forgettable as the css {display: none}. Everything requires a specific opt-in/out that you always have to remember in each instance if you need it.
RouterOutletlocation (makelocationaccessible/overridable) #65654 as a duplicate of this issuefeat(router): allow router outlet to be set on ng-container (angular#…