Click Outside
Primitives[atlasClickOutside]Examples
Close on outside click
(atlasClickOutside) emits when a click lands outside the host element — the building block for custom panels. Selecting text that starts in the panel and ends outside does not close it. Pair it with Escape and aria-expanded so keyboard users can close the panel too.
Exclude the trigger
When the trigger sits outside the panel, pass it to [atlasClickOutsideExclude] . Otherwise a click on the trigger counts as "outside": the panel closes and the same click reopens it.
Toolbar
API
Generated from the library source, so it always matches the code.
AtlasClickOutsideDirective [atlasClickOutside]
| Input | Type | Default | Description |
|---|---|---|---|
| atlasClickOutsideExclude | HTMLElement | HTMLElement[] | null | null |
| Output | Payload | Description |
|---|---|---|
| atlasClickOutside | MouseEvent |