FullPageLayout
CustomerDashboardFullPageLayout is a full-page shell for focused flows — typically multi-step
forms such as adding a dependent or onboarding a company. It renders an opinionated header (title,
subtitle and a close button) and an optional fixed footer, with your flow content in between.
It builds on Murray's FullPageLayout and is the
customer-dashboard equivalent of a full-width modal.
- Import:
import { CustomerDashboardFullPageLayout } from "@alan-eu/global-customer-dashboard/shared-layout/FullPageModalLayout"; - Source:
frontend/shared/global-customer-dashboard/shared-layout/FullPageModalLayout.tsx - Storybook: browse the stories
Basic usage
<CustomerDashboardFullPageLayout
title="Add a dependent"
subtitle="Step 1 of 3"
onClose={() => navigate("..")}
>
<DependentForm />
</CustomerDashboardFullPageLayout>
Props
| Prop | Type | Description |
|---|---|---|
title | string | (() => string) | Header title. Pass a function only when it must be evaluated at render time. |
subtitle | string | (() => string) | Optional subtitle shown under the title (e.g. a step indicator). |
onClose | () => void | Called when the header close button is clicked. |
closeLabel | string | (() => string) | Close button label. Defaults to a generic "Close". |
variant | "fluid" | "fixed" | Forwarded to the content area. Use "fixed" for a narrower layout. Defaults to fluid. |
span | 8 | 12 | Constrains the inner column width. Pass 8 for an 8/12 column; defaults to 12 (full width). |
Footer
Render footer actions (e.g. a "Continue" button) with the footer slot:
<CustomerDashboardFullPageLayout title="Add a dependent" subtitle="Step 3 of 3">
<DependentForm />
<CustomerDashboardFullPageLayout.SlotContent name="footer">
<Button>Continue</Button>
</CustomerDashboardFullPageLayout.SlotContent>
</CustomerDashboardFullPageLayout>
Handling close from a descendant
When the close handler lives deeper than the component declaring the layout, register it with the
useOnClose hook instead of passing onClose:
const StepContent = () => {
useOnClose(() => confirmDiscardChanges());
return <DependentForm />;
};
Both onClose and any handler registered via useOnClose run when the close button is clicked.