<!-- GENERATED by scripts/build-llms.mjs from llms/utility.md — do not edit this file. -->

# `lr-intersection-observer`

- **Import** `import '@aceshooting/lyra-ui/components/lr-intersection-observer.js';` (stable tag alias; registers the tag)
- **Class** `LyraIntersectionObserver`, also available unregistered from `@aceshooting/lyra-ui/components/utility/intersection-observer/intersection-observer.class.js`
- **Family** `components/utility/` — see `llms/index.md` for its siblings
- **Status** `stable` since `4.0.0` — see the maturity and deprecation policy in `llms/shared.md`
- **Release history** [CHANGELOG.md](../../CHANGELOG.md); family-wide breaking-change summaries: [llms-full.txt](../../llms-full.txt)
- **Deprecations** none
- **Optional peers** none
- **Themeable via** 1 part, 0 custom properties — see this component's own `@csspart`/`@cssprop` list below
- **Library-wide behavior** (events, form association, `locale`/`strings`, tokens, TS types): `llms/shared.md`

---

## `lr-intersection-observer`

Lifecycle-managed wrapper around the native `IntersectionObserver`. It observes all element children
in the default slot and emits a composed event, while adding no layout of its own.

**Properties:** `disabled: boolean = false` (reflected), `rootMargin: string = '0px'` (attribute
`root-margin`), `threshold: number | number[] | string = '0'` (the mapped attribute form accepts
space-separated values), `root: Element | string | null = null` (an element or mapped element ID),
`intersectClass: string = ''` (attribute `intersect-class`, toggled on each target), and `once:
boolean = false` (reflected; unobserves a target after its first intersection). A once-consumed
target stays consumed across option-driven observer rebuilds and disconnect/reconnect cycles;
setting `once` to false is the explicit reset boundary.

The browser capability is optional. A missing or throwing owner-window lookup or unavailable
constructor leaves that rebuild inert rather than leaking an exception; an initial construction
failure retries once with safe default options. Individual `observe`, `unobserve`, and `disconnect`
failures are contained, so later valid targets and later rebuilds can still observe. Callbacks are
tied to the current owner document, so a detached or adopted wrapper cannot emit a stale batch.
Threshold collections inspect at most their first 10,000 direct data entries. Malformed or
accessor-backed entries are skipped; a valid prefix remains active, while an entirely unusable value
falls back to threshold `0`.

**Events:** mapped `lr-intersect` once per entry with `{ entry }`, plus the existing batch alias
`lr-intersection` with a frozen
`Readonly<{ entries: readonly IntersectionObserverEntry[] }>` detail. The batch sequence is
detached and bounded while each native observer entry retains identity.

**Slots:** default observed elements. **CSS parts:** `base`.

---
