- {usaBanner &&
}
+ {usaBanner && !collapseHeader &&
}
{msgBanner && msgBannerPosition === "top" ? msgBanner : null}
{msgBanner && msgBannerPosition === "bottom" ? msgBanner : null}
diff --git a/lib/composite/site-wrapper/index.test.jsx b/lib/composite/site-wrapper/index.test.jsx
new file mode 100644
index 00000000..b558c948
--- /dev/null
+++ b/lib/composite/site-wrapper/index.test.jsx
@@ -0,0 +1,38 @@
+import { renderToStaticMarkup } from "react-dom/server";
+import { describe, expect, it } from "vitest";
+import SiteWrapper from ".";
+
+const renderSiteWrapper = (props = {}) =>
+ renderToStaticMarkup(
+
Account}
+ showFooter={false}
+ {...props}
+ >
+ Page content
+ ,
+ );
+
+describe("SiteWrapper collapseHeader", () => {
+ it("renders the complete header by default", () => {
+ const markup = renderSiteWrapper();
+
+ expect(markup).toContain("header_banner_container");
+ expect(markup).toContain("Test site title");
+ expect(markup).toContain("Test site subtitle");
+ });
+
+ it("keeps navigation controls while hiding the expanded header content", () => {
+ const markup = renderSiteWrapper({ collapseHeader: true });
+
+ expect(markup).not.toContain("header_banner_container");
+ expect(markup).not.toContain("Test site title");
+ expect(markup).not.toContain("Test site subtitle");
+ expect(markup).toContain("Account");
+ expect(markup).toContain("Visit the homepage of this site");
+ expect(markup).toContain("Page content");
+ });
+});
diff --git a/src/app-pages/documentation/app-shell/site-wrapper.jsx b/src/app-pages/documentation/app-shell/site-wrapper.jsx
index ad3d9a19..099336a4 100644
--- a/src/app-pages/documentation/app-shell/site-wrapper.jsx
+++ b/src/app-pages/documentation/app-shell/site-wrapper.jsx
@@ -33,6 +33,12 @@ const siteWrapperProps = [
default: "null",
desc: "A custom component that will render to the right of the header links.",
},
+ {
+ name: "collapseHeader",
+ type: "boolean",
+ default: "false",
+ desc: "If true, displays only the compact black navigation bar. The government website banner and the title and subtitle section are hidden.",
+ },
{
name: "usaBanner",
type: "boolean",
@@ -237,6 +243,16 @@ function App() {
export default App;
`}
+ />
+
+ Set collapseHeader when a page needs more vertical space.
+ The compact state keeps the home link, navigation, custom controls,
+ and mobile menu available.
+
+
+
+`}
/>
Component API - {``}