Skip to main content
Elastic UI
Elastic UI
Getting startedComponentsUtilitiesPatternsContentData visualization
EUI ChangelogGitHub
  • Accessibility
  • Auto sizer
  • Color palettes
  • Container queries
  • Copy
  • CSS utility classes
  • Delay
  • Error boundary
  • Focus trap
  • Highlight and mark
  • HTML ID generator
  • I18n
  • Inner text
  • Mutation observer
  • Outside click detector
  • Overlay mask
  • Portal
  • Pretty duration
  • Provider
  • Resize observer
  • Scroll
  • Text diff
  • Text truncation
  • Window events
  • Elastic UI Framework
  • Overlay mask

Overlay mask

EuiOverlayMask is simply a display component used to obscure the main content to bring attention to its children or other content. It is best used in conjunction with hyper-focus content areas like modals and flyouts.

There are many considerations to make before choosing to use an overlay. At the very least, you must provide a visible button to close the overlay. You can also nest an EuiFocusTrap to handle closing the overlay.

Loading...

Masks with header

Managing z-index levels of multiple portal-positioned components and their different contexts is complicated from within the library. EuiOverlayMask gives you control over whether it should appear below or above an EuiHeader by providing the headerZindexLocation prop. By default this is set to "above" for common cases like with EuiModal where the header should be obscured. However, a component like EuiFlyout which utilizes the overlay mask but should keep the header visible should use "below" (which is its default value).

Props

EuiOverlayMask

𐘂𐘂
✄𐘗✄𐘗
Prop
↦
Description and type
↦
Default value
↵
Prop
children#
↦
Description and type

ReactNode to render as this component's content

Type: ReactNode
↦
Default value
↵
Prop
headerZindexLocation#
↦
Description and type

Should the mask visually sit above or below the EuiHeader (controlled by z-index)

Type: "above" | "below"
↦
Default value
above
↵
Prop
maskRef#
↦
Description and type

React ref to be passed to the wrapping container

Type: Ref<HTMLDivElement> | MutableRefObject<HTMLDivElement>
↦
Default value
↵
Prop
hasAnimation#
↦
Description and type

If enabled, the mask will have a fade in animation.

Type: boolean
↦
Default value
true
↵
𐘂𐘂
Edit this page

Previous
Outside click detector
Next
Portal
  • Masks with header
  • Props
EUI is dual-licensed under Elastic License 2.0 and Server Side Public License, v1 | Crafted with ❤️ by Elastic