import { useState } from 'react'; import { Page, Masthead, MastheadMain, MastheadToggle, MastheadBrand, MastheadLogo, MastheadContent, PageSidebar, PageSidebarBody, PageSection, PageToggleButton, Toolbar, ToolbarContent, ToolbarItem, Card, CardBody } from '@patternfly/react-core'; import pageSectionWidthLimitMaxWidth from '@patternfly/react-tokens/dist/esm/c_page_section_m_limit_width_MaxWidth'; export const PageCenteredSection: React.FunctionComponent = () => { const [isSidebarOpen, setIsSidebarOpen] = useState(true); const onSidebarToggle = () => { setIsSidebarOpen(!isSidebarOpen); }; const headerToolbar = ( header-tools ); const masthead = ( Logo {headerToolbar} ); const sidebar = ( Navigation ); return ( When a width limited page section is wider than the value of {pageSectionWidthLimitMaxWidth.name}, the section will be centered in the main section.

The content in this example is placed in a card to better illustrate how the section behaves when it is centered. A card is not required to center a page section.
); };