diff --git a/packages/react-core/src/components/Page/Page.tsx b/packages/react-core/src/components/Page/Page.tsx index aaa425dc600..1c7612d2a7f 100644 --- a/packages/react-core/src/components/Page/Page.tsx +++ b/packages/react-core/src/components/Page/Page.tsx @@ -81,6 +81,8 @@ export interface PageProps extends React.HTMLProps { isBreadcrumbGrouped?: boolean; /** Additional content of the group */ additionalGroupedContent?: React.ReactNode; + /** HTML component used as main component of the page. Defaults to 'main', only pass in 'div' if another 'main' element already exists. */ + mainComponent?: 'main' | 'div'; /** Additional props of the group */ groupProps?: PageGroupProps; /** Additional props of the breadcrumb */ @@ -104,6 +106,7 @@ export class Page extends React.Component { mainTabIndex: -1, isNotificationDrawerExpanded: false, onNotificationDrawerExpand: () => null, + mainComponent: 'main', getBreakpoint, getVerticalBreakpoint }; @@ -229,6 +232,7 @@ export class Page extends React.Component { getVerticalBreakpoint, mainAriaLabel, mainTabIndex, + mainComponent, tertiaryNav, isTertiaryNavGrouped, isBreadcrumbGrouped, @@ -288,8 +292,10 @@ export class Page extends React.Component { ) : null; + const Component: keyof JSX.IntrinsicElements = mainComponent; + const main = ( -
{ {!isTertiaryNavGrouped && nav} {!isBreadcrumbGrouped && crumb} {children} -
+ ); const panelContent = {notificationDrawer};