Repository navigation
Description
Summary
Add a navBackground prop to XDSAppShell that controls the background color of the navigation areas (topNav + sideNav). Combined with the existing background prop (content area), this enables four visual configurations:
background |
navBackground |
Content | Nav | Example |
|---|---|---|---|---|
surface |
wash |
white | gray | ✨ Most common — nav recedes, content pops |
wash |
wash |
gray | gray | Uniform, subdued |
surface |
surface |
white | white | Uniform, bright |
wash |
surface |
gray | white | Nav pops, content recedes |
Derived behaviors
When navBackground differs from background, the shell should automatically adjust visual details:
1. Divider suppression
When navs use wash background, the dividers between nav and content become redundant (the color contrast already separates them). The shell should suppress hasDivider on XDSLayoutHeader and XDSLayoutPanel in this case.
2. Content border radius
When both topNav and sideNav are present, and navs are wash while content is surface, the main content area should get a ~20px border radius on the top-left corner. This creates the "inset panel" look where content feels like a card sitting inside the nav frame.
This only applies when both navs are present — if only one nav exists, the radius would look odd on the exposed edge.
Proposed API
interface XDSAppShellProps {
/**
* Background color of the shell / content area.
* @default 'surface'
*/
background?: 'wash' | 'surface';
/**
* Background color of navigation areas (topNav + sideNav).
* When different from `background`, dividers between nav and content
* are suppressed (color contrast provides separation).
* When 'wash' with `background="surface"` and both navs present,
* content gets a top-left border radius for an inset panel effect.
* @default 'surface'
*/
navBackground?: 'wash' | 'surface';
}Design notes
- The border radius value (~20px) should use a token if one exists, or establish one
- The border radius should only apply to the top-inline-start corner (respects RTL via logical properties)
- When sideNav collapses (mobile overlay), the border radius should be removed
- Divider suppression should be automatic — consumers shouldn't need to think about it
Related
- fix(AppShell): add wash background color to root container #328 — adds
backgroundprop (prerequisite)
Activity
cixzhang commentedon Mar 12, 2026
Merged into #565 (Shell & Navigation deep review). The navBackground prop and Ernest's feedback about defaulting to grey/deemphasized nav are both tracked there.
feat(AppShell): add variant prop for nav/content background styles (#565
feat(AppShell): add variant prop for nav/content background styles