Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/react-core/src/components/Page/PageContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

Expand Down
3 changes: 2 additions & 1 deletion packages/react-core/src/components/Page/examples/Page.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ propComponents:
'PageSection',
'PageGroup',
'PageBreadcrumb',
'PageToggleButton'
'PageToggleButton',
'PageContextProps'
]
---

Expand Down