Skip to main content
Elastic UI
Elastic UI
Getting startedComponentsPatternsContentData visualization
EUI ChangelogGitHubFigma
  • Setup
  • Theming
  • Accessibility
  • Testing
  • Utilities
    • Accessibility
    • Auto sizer
    • Color palettes
    • 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
  • EUI
  • Utilities
  • Mutation observer

Mutation observer

EuiMutationObserver is a wrapper around the Mutation Observer API which allows watching for DOM changes to elements and their children. EuiMutationObserver takes the same configuration object as the browser API to describe what to watch for, and fires the callback when that mutation happens.

This is a render prop component, EuiMutationObserver will pass a

ref callback which you must put on the element you wish to observe the mutations.

Loading...

Props

EuiMutationObserver

๐˜‚๐˜‚
โœ„๐˜—โœ„๐˜—
Prop
โ†ฆ
Description and type
โ†ฆ
Default value
โ†ต
Prop
children#
โ†ฆ
Description and type

ReactNode to render as this component's content

Type: (ref: (e: HTMLElement) => void) => ReactNode
โ†ฆ
Default value
Required
โ†ต
Prop
onMutation#
โ†ฆ
Description and type
Type: MutationCallback
โ†ฆ
Default value
Required
โ†ต
Prop
observerOptions#
โ†ฆ
Description and type
Type: MutationObserverInit
โ†ฆ
Default value
โ†ต
๐˜‚๐˜‚
Edit this page

Previous
Inner text
Next
Outside click detector
  • Props
EUI is dual-licensed under Elastic License 2.0 and Server Side Public License, v 1 | Crafted with โค by Elastic