Skip to main content
Elastic UI
Elastic UI
Getting startedComponentsPatternsContentData visualization
EUI ChangelogGitHubFigma
  • Overview
  • Layout
  • Containers
  • Navigation
  • Display
  • Forms
  • Tabular content
  • Templates
    • Page template
      • Guidelines
    • Sitewide search
  • Editors and syntax
  • EUI
  • Templates
  • Page template
  • Guidelines

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 propagated 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.

Loading...

Good example of Canvas using template components

Do: Use EuiPageTemplate with incorporated EuiPageTemplate.Header and EuiPageTemplate.Section

Bad example of Canvas using old components

Don't: Using plain EuiPage components for wrapping entire page layouts is very manual and no longer matches the template.

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.

Good example of CCR showing centered content in a panel

Do: Use fully centered alignment for empty states even when using tabs.

Bad example of CCR showing only horizontally centered content

Don't: Horizontally centered only content will mismatch the basic template.

Good example of Dashboards showing just centered content in a panel

Do: Utilize the empty prompt component for fully empty pages and hide the page header.

Bad example of Dashboards showing centered content with duplicate information from the page header

Don't: Duplicate content between page header and empty state contents isn't helpful.

Empty pages

When the whole page is empty

Use the EuiPageTemplate.EmptyPrompt component to replace the whole page.

Good example of Dashboards showing just centered content in a panel

Do: Utilize the empty state component which automatically adds panelling and centering.

Bad example of Dashboards showing basic empty state sentence

Don't: Just replacing page content with a simple sentence creates incorrect hierarchy.

Good example of Dashboards showing just centered content in a panel

Do: Utilize the empty state component with a specific call to action.

Bad example of Dashboards showing centered content but with only a sentence and no actions

Don't: Ambiguous empty state messages without any actions are not helpful.

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.

Good example of read-only Dashboards showing empty state with insufficient permissions explanations and action

Do: Provide more explanation within the empty state.

Bad example of read-only Dashboards showing basic empty state sentence

Don't: Ambiguous empty states without any actions can feel like an error.

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.

Good example of Canvas listing page with default contents replaced with single empty prompt and call to action

Do: Hide unusable elements and utilize the empty state with one or more specific calls to action.

Bad example of Canvas listing page with empty table and visible controls

Don't: Empty tables with filters that won't find any results and duplicate actions are not necessary.

Good example of Categories using just a simple empty state

Do: Use only the empty prompt with explanations and a call to action.

Bad example of Categories duplicating the category labelling in page header and empty state

Don't: Page headers are not as necessary when the same labelling is used throughout other parts of the page.

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.

Good example of loading state ending in an error state using centered empty prompt for both

Do: Use the empty prompt as a loading state followed by an empty prompt styled as a error/empty state (or loaded content).

Bad example of loading state not using empty prompt ending in an error state changes the whole page contents

Don't: Temporarily showing content like the page headers when loading then removing those elements on error is jarring.

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.

Good example of Edit page with errors and warnings as callouts

Do: Use the EuiCallOut components for stacking error messages alongside content.

Bad example of Edit page with stacked empty prompts and hardly any content visible

Don't: Multiple large empty prompts pushes the main content out of view and, without actions, harms UX.

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.

Good example of Index management with empty prompt showing privileges error

Do: If the error blocks all interactions of the tabbed content, a centered empty prompt may be warranted.

Good example of Index management with callout showing simple API error

Do: If the error is not detrimental or blocking lots of user interaction, a simple callout may suffice. Though this example could also be an empty prompt.

Edit this page

Previous
Page template
Next
Sitewide search
  • Converting from legacy layouts
  • When to center content
  • Empty pages
    • When the whole page is empty
    • Empty state due to insufficient permissions
    • Empty page content that still needs the page header
  • Error and loading states
    • When loading the content
    • Callouts versus empty prompts
    • Tabbed content
EUI is dual-licensed under Elastic License 2.0 and Server Side Public License, v 1 | Crafted with ❤ by Elastic