Skip to content

refactor(MobileNav): combine title and header into single header prop - #651

Merged
cixzhang merged 2 commits into
mainfrom
navi/feat/mobile-nav-api
Mar 17, 2026
Merged

cixzhang merged 2 commits into
mainfrom
navi/feat/mobile-nav-api

Conversation

@cixzhang

@cixzhang cixzhang commented Mar 17, 2026 •

Copy link
Copy Markdown
Contributor

What

Combines the separate title (string) and header (ReactNode) props on XDSMobileNav into a single header prop that accepts both.

Before

<XDSMobileNav title="Navigation">
<XDSMobileNav header={<XDSSideNavHeading heading="My App" />}>

After

// String — renders as XDSHeading
<XDSMobileNav header="Navigation">

// ReactNode — renders as-is
<XDSMobileNav header={<XDSSideNavHeading heading="My App" icon={<Logo />} />}>

// No header — just close button
<XDSMobileNav>

Details

  • header?: ReactNode — string renders as <XDSHeading level={2}>, ReactNode renders as-is, omit for close-button-only
  • aria-label falls back to header when it's a string, then 'Navigation'
  • Updated all tests, shell lab, and doc examples

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 17, 2026
header accepts both string (renders as XDSHeading) and ReactNode
(renders as-is). Replaces the separate title and header props.

aria-label falls back to header when it's a string, then 'Navigation'.

Co-authored-by: Navi <[email protected]>
@cixzhang
cixzhang force-pushed the navi/feat/mobile-nav-api branch from a1593bd to 92f5ccd Compare March 17, 2026 13:14
@github-actions

github-actions Bot commented Mar 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

Modified Components

AppShell · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 769B N/A
Lines of Code N/A 504 -
Complexity N/A Very High (73) -
MobileNav · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 615B N/A
Lines of Code N/A 308 -
Complexity N/A Very High (32) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@xds/core 9.9KB 15.8KB 2.5KB

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@cixzhang
cixzhang merged commit 8d54692 into main Mar 17, 2026
11 checks passed
@cixzhang
cixzhang deleted the navi/feat/mobile-nav-api branch March 20, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant