FullPageLayout
Page scaffold for a flow, with slots for header, footer, main and aside. Use for one step or a whole multi-step journey. Replaces `FullWidthModal`.
compliant
- Overview
- Props
FullPageLayout is a component that setup reserved places for a header, footer, main and aside areas. The main section rely on the LayoutGrid component.
Since it is meant to replace the FullWidthModal component, it provided an aditional FullPageLayout.OpinionatedHeader component that can be used to display a title and/or a close button and/or a back button.
Each sub-component brings the right HTML semantics to be fully accessible.
Accessibility
Be sure to use sub-components like FullPageLayout.Header, FullPageLayout.Footer,
FullPageLayout.Content, FullPageLayout.Main and FullPageLayout.Aside to ensure the right HTML
semantics.
Building a page
This component is meant to be used at the root of a page.
Left section
Header's children
Right section
Main
Main, MainAlone, RightAside and LeftAside
Those sub-components aim at 2 things:
- Providing the right HTML semantics
- Positionning the children in the right place and the right spacing according to the grid layout
Fluid variant
Pass variant="fluid" to FullPageLayout.Content to let the content expand within its parent container instead of the default fixed sizing.
Left section
Header's children
Right section
Main (fluid)
As replacement for a FullWidthModal
To replace a deprecated FullWidthModal component, you can use the FullPageLayout.OpinionatedHeader.
Then just map the page component to the usual react-router-dom Route component to map a URL to a page.
Before
<FullWidthModal name="modal-name" closeButtonLabel="Close">
<FullWidthModal.Title title="Title" description="Subtitle" />
<ItemBox sx={{ height: 200 }}>Main</ItemBox>
<ItemBox>Aside</ItemBox>
</FullWidthModal>
After
<Switch>
<Route path="/my-custom-route-to-the-flow">
{/* Your page component */}
<FullPageLayout>
<FullPageLayout.OpinionatedHeader
title="Title"
subtitle="Subtitle"
backButtonHref="#back"
backButtonLabel="Optional Back button"
closeButtonHref="#close"
closeButtonLabel="Optional Close button"
/>
<FullPageLayout.Content>
<FullPageLayout.Main>
<ItemBox sx={{ height: 200 }}>Main</ItemBox>
</FullPageLayout.Main>
<FullPageLayout.RightAside>
<ItemBox>Aside</ItemBox>
</FullPageLayout.RightAside>
</FullPageLayout.Content>
</FullPageLayout>
</Route>
</Switch>
We provided an opinionated header that can be used to display a title, a subtitle, a back button and a close button to ease former modals migration
Title
Subtitle
Main
Playground
FullPageLayout props
| Name | Type | Default Value | Description | Usage count |
|---|---|---|---|---|
| children* | ReactNode |