Replies: 5 comments 1 reply
-
Converting from the legacy (panelled) layout to the new EuiPageTemplateBe sure that the page component can fully stretch in height. If it is not, it is usually due to insufficient flex wrappers. Don't: Use blank element wrappers before the page template Convert to using the built-in
|
Beta Was this translation helpful? Give feedback.
-
Empty pagesWhen the whole page is emptyUse EuiPageTemplate prop Don't: Just replace page content with a simple sentence. Don't: Use an ambiguous empty state without any actions. Empty state due to insufficient permissionsProvide language that specifically points to permissions as the reason for the empty state. If possible, link to an admin contact. Don't: Use an ambiguous empty state without any actions because of permissions. Empty page content that still needs the page headerUse the EuiEmptyPrompt but inside of the page body with a subdued panel wrapper. Remove any UI that can’t be used due to the emptiness. Don't: Show an empty table with filters that won’t filter anything. |
Beta Was this translation helpful? Give feedback.
-
Centering contentWhether or not the page has side navigation, any empty/loading/error states that take up the whole page should be vertically and horizontally centered.Don't: Forget to use the Don't: Use Don't: Don’t duplicate content from page header to empty state contents. Do: Use |
Beta Was this translation helpful? Give feedback.
-
Error and loading statesRemove page header on full page errorsIt is usually unnecessary to display the page header if the whole page has an error. This just creates repetitive content. Don't: Display the page header if the page can’t be accessed or has an error. When loading contentIf, after loading, the entire page renders as an empty or error state, the loading state should also be an entire page. Don't: Show possibly temporary content like the page header when loading. Do: Use the Callouts versus empty promptsOnly use the EuiEmptyPrompt when the whole page is empty or an error and never use multiple empty prompts on the same page. Don't: Use multiple large empty prompts when there is still page content. Tabbed contentTreat 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. Do: If the error blocks all interactions of the tabbed content, a centered empty prompt may be warranted. |
Beta Was this translation helpful? Give feedback.
-
Closing as the conversion has been completed. These still stand as useful guidelines that could be captured in our patterns work. cc:/ @mdefazio @andreadelrio |
Beta Was this translation helpful? Give feedback.
-
As Elastic products convert existing pages to the new EuiPageTemplate component, here are some common guidelines to follow.
These can also be found in the (private) Figma file: Page layout guidelines
Beta Was this translation helpful? Give feedback.
All reactions