diff --git a/packages/react-core/src/components/Page/PageContext.tsx b/packages/react-core/src/components/Page/PageContext.tsx index ad2dcf5658c..d97ca3f2794 100644 --- a/packages/react-core/src/components/Page/PageContext.tsx +++ b/packages/react-core/src/components/Page/PageContext.tsx @@ -3,13 +3,21 @@ import { createContext } from 'react'; import { getBreakpoint, getVerticalBreakpoint } from '../../helpers/util'; export interface PageContextProps { + /** Flag indicating if the Page component is managing the sidebar open/close state */ isManagedSidebar: boolean; + /** Callback to toggle the managed sidebar open/close state */ onSidebarToggle: () => void; + /** Flag indicating if the sidebar is currently open */ isSidebarOpen: boolean; + /** Flag indicating if the page is being viewed at a mobile viewport */ isMobile: boolean; + /** Width of the page, used to determine the applied horizontal breakpoint modifier. Defaults to null until the page resize observer has measured the page. */ width: number; + /** Height of the page, used to determine the applied vertical breakpoint modifier. Defaults to null until the page resize observer has measured the page. */ height: number; + /** Function used to determine the horizontal breakpoint to apply based on the page width */ getBreakpoint: (width: number | null) => 'default' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'; + /** Function used to determine the vertical breakpoint to apply based on the page height */ getVerticalBreakpoint: (height: number | null) => 'default' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'; } diff --git a/packages/react-core/src/components/Page/examples/Page.md b/packages/react-core/src/components/Page/examples/Page.md index 7c697d7f5dc..f097ac9a31e 100644 --- a/packages/react-core/src/components/Page/examples/Page.md +++ b/packages/react-core/src/components/Page/examples/Page.md @@ -11,7 +11,8 @@ propComponents: 'PageSection', 'PageGroup', 'PageBreadcrumb', - 'PageToggleButton' + 'PageToggleButton', + 'PageContextProps' ] ---