Skip to content

feat(AppShell): add navBackground prop for nav/content color contrast #346

Closed

Description

@cixzhang

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

Activity

  1. added
    enhancement
    on Feb 25, 2026
  2. added
    component
    on Feb 25, 2026
  3. cixzhang commented on Mar 12, 2026

    @cixzhang
    ContributorAuthor

    Merged into #565 (Shell & Navigation deep review). The navBackground prop and Ernest's feedback about defaulting to grey/deemphasized nav are both tracked there.

  4. added 2 commits that reference this issue on Mar 13, 2026
    b11237b
    bbbc432
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    componentenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions