Watches its slotted content for DOM changes via MutationObserver and emits nana-mutation with the records. Useful for reacting to attribute, child-list, subtree or character-data changes without wiring observers by hand.
Show code Copy < nana-mutation-observer >
< div >Observed content</ div >
</ nana-mutation-observer >
npm install @nana-tec/ui-components
import " @nana-tec/ui-components/mutation-observer " ;
< div > Observed content </ div >
</ nana-mutation-observer >
Properties Property Attribute Type Default Description attr— string | undefined—Attribute names to watch (space-separated), or `*` for all attrOldValueattr-old-valuebooleanfalseInclude attribute old values in the records charDatachar-databooleanfalseWatch text content changes charDataOldValuechar-data-old-valuebooleanfalseInclude character-data old values childListchild-listbooleanfalseWatch additions/removals of children disabled— booleanfalseStop observing
Events Event Description nana-mutationFired on change (`detail.mutationList`)
Slots Slot Description (default)The content to observe
Event Type Description nana-mutationCustomEventFired on change (detail.mutationList)
Slot Description (default)The content to observe
Explore Mutation Observer interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook