Guide
Overlays
Layered components, teleport, placement, and outside click behavior.
Layering
Overlay-based components should not be trapped by parent stacking contexts. `NmorphOverlay` and `NmorphDropdown` render through Teleport to `body`, which lets dropdowns, dialogs, tooltips, and previews escape isolated or overflow-hidden containers.
Placement
`usePlacement` calculates coordinates from the trigger element and content size. It supports side placement and alignments such as `bottom-end`, recalculates after mount/open, reacts to resize and scroll, and flips when there is not enough viewport space.
Outside click
Outside click should close an overlay even when the trigger is inside isolated containers. Keep the trigger reference stable and prefer explicit `relativeElement` refs over late DOM lookups.