[Feature] EuiPage and EuiPageTemplate Updates#5768
Conversation
…5625) * [Docs] Create new section for “Templates” - Moves Page Template, SuperDatePicker, and Searchable Sitewide Template - Stubs in placeholder page for in lower level page components - Fixes routes
# Conflicts: # scripts/a11y-testing.js # src-docs/src/views/page/page_example.js
* Added `exampleToggles` to GuideSectionExample for easily passing through custom controls
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
…uiPageBody padding defaults (#5769) * Removed nested page header styles when within EuiPageBody (improved way of doing this coming later) * [NEW] EuiPageSection to replace EuiPageContent & EuiPageContentBody * Added `exampleToggles` to GuideSectionExample for easily passing through custom controls * Added `euiPaddingStyles` and `euiBackgroundColorStyles` global styling functions * Added deprecation comments to EuiPageContent and EuiPageContentBody
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
This gets the className output to render the key name. Same with `useEuiBackgroundColorCSS`. Also fixed usage in `EuiPageSection`. Also fixed docs `exampleToggles` pass through from GuideSection to example
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
…gm as EuiPageSection (#5857) * [EuiPageHeader] Refactoring to support same `bottomBorder`, `restrictWidth` and `paddingSize` props as EuiPageSection * Converted EuiPageHeaderContent to Emotion * Consolidate more styles including ensuring max-width is applied as `style` tag
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |

Justification for new template structure
While implementing the original EuiPageTemplate in Kibana, we realized that it is very rigid and doesn't allow for certain configurations like:
This new template is based on React context to pass through unified props like
paddingSizeandrestrictWidthwhile still be configurable at every level. It also removes the necessity to provide page header contents through props. It is also built as a namespaced component and therefore the context will only be passed to those that are namespaced in case of complete custom layouts.The best way to justify is to showcase the new capabilities. Take the following layout which couldn't be achieved by the previous version of EuiPageTemplate and would need to be completely custom contents that would then no longer be tied to cascading props:
Now you can easily achieve this with the following setup:
Based solely on the presence of a fixed EuiHeader, the template will also ensure the layout affords for this offset without needing to apply custom styles and use of a Sass mixin.
More example conversions to the new EuiPageTemplate
`template = default` with sidebar and a bottom bar
`template = centeredBody`
`template = centeredContent` with sidebar
`template = empty` (no content panelling)
PR Summaries:
exampleTogglesto GuideSectionExample for easily passing through custom controlseuiPaddingStylesandeuiBackgroundColorStylesglobal styling functionsbottomBorder,restrictWidthandpaddingSizeprops as EuiPageSectionstyletag/pageand exportrestrictWidthstyles of EuiPageContentBodyheightas optional prop to alleuiYScrollmixinsstylemainupdatemainPropsto EuiPageTemplate for allowing customization of things likeid(for skip link)Checklist