Page template guidelines
Converting from legacy layouts
Try to use as much of the namespaced (e.g.
<EuiPageTemplate.Header />
) as much as possible. This will ensure that top level props are propogated through and alignment is kept through the stacking order. You can use the non-namespaced versions (e.g. <EuiPageSection>
) if you deliberately don't want the props to inherit.When to center content
Whether or not the page has side navigation, any empty/loading/error states that take up the whole page should be vertically and horizontally centered using alignment="center"
on the individual page section.
Most empty states can utilize the <EuiPageTemplate.EmptyState>
which will automatically center the content for you.
Empty pages
When the whole page is empty
Use the EuiPageTemplate.EmptyPrompt
component to replace the whole page.
Empty state due to insufficient permissions
Provide language that specifically points to permissions as the reason for the empty state. If possible, link to an admin contact.
Empty page content that still needs the page header
If necessary, the EuiPageTemplate.EmptyPrompt
can be still be used alongside EuiPageTemplate.Header
. Remove any UI that can't be used due to the emptiness.
Error and loading states
When loading the content
If, after loading, the entire page renders as an empty or error state, the loading state should also be an entire page.
Callouts versus empty prompts
Typically there should only be one EuiPageTemplate.EmptyPrompt when the whole page is empty or an error. They should never be used to stack multiple errors on the same page.
Tabbed content
Treat the page contents under tabs as “full page” content, using empty prompts for empty/loading/error states if it is the only content that is rendered as the tab content. However, the context of the state should dictate whether an empty prompt or simple callout is appropriate.