diff --git a/packages/react-core/src/components/Page/examples/Page.md b/packages/react-core/src/components/Page/examples/Page.md index 4685d7a01d3..af320ac36f1 100644 --- a/packages/react-core/src/components/Page/examples/Page.md +++ b/packages/react-core/src/components/Page/examples/Page.md @@ -106,6 +106,14 @@ To remove padding at specific breakpoints, pass in 'noPadding' at those breakpoi ``` +### Main section variations + +This example shows all types of page sections. + +```ts file="./PageMainSectionVariations.tsx" + +``` + ### Group section To group page content sections, add 1 or more `` components to a ``. diff --git a/packages/react-core/src/components/Page/examples/PageMainSectionVariations.tsx b/packages/react-core/src/components/Page/examples/PageMainSectionVariations.tsx new file mode 100644 index 00000000000..56b640ada72 --- /dev/null +++ b/packages/react-core/src/components/Page/examples/PageMainSectionVariations.tsx @@ -0,0 +1,84 @@ +import React from 'react'; +import { + Page, + Masthead, + MastheadToggle, + MastheadMain, + MastheadBrand, + MastheadContent, + PageSidebar, + PageSidebarBody, + PageSection, + PageToggleButton, + Toolbar, + ToolbarContent, + ToolbarItem +} from '@patternfly/react-core'; +import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon'; + +export const PageMainSectionPadding: React.FunctionComponent = () => { + const [isSidebarOpen, setIsSidebarOpen] = React.useState(true); + + const onSidebarToggle = () => { + setIsSidebarOpen(!isSidebarOpen); + }; + + const headerToolbar = ( + + + header-tools + + + ); + + const header = ( + + + + + + + + + Logo + + + {headerToolbar} + + ); + + const sidebar = ( + + Navigation + + ); + + return ( + + + Section with type="subnav" for horizontal subnav navigation + + + Section with type="nav" for tertiary navigation + + + Section with type="tabs" for tabs + + + Section with type="breadcrumb" for breadcrumbs + + + Section without type prop or type="default" for main sections + + + Section with type="wizard" for wizards + + + ); +}; diff --git a/packages/react-core/src/components/Page/examples/page.css b/packages/react-core/src/components/Page/examples/page.css index f2c0ff57695..d4d4bd9131a 100644 --- a/packages/react-core/src/components/Page/examples/page.css +++ b/packages/react-core/src/components/Page/examples/page.css @@ -1,3 +1,4 @@ -.pf-v5-c-page__sidebar-body { +.pf-v5-c-page__sidebar-body, +.pf-v5-c-page__main-subnav { color: var(--pf-v5-global--Color--light-100); }