@empathyco/x-components
Version:
Empathy X Components
27 lines (15 loc) • 862 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [useEmitDisplayEvent](./x-components.useemitdisplayevent.md)
## useEmitDisplayEvent() function
Composable that emits a `TrackableElementDisplayed` event whenever the provided element appears in the viewport for the first time.
**Signature:**
```typescript
export declare function useEmitDisplayEvent({ element, taggingRequest, eventMetadata, }: UseEmitDisplayEventOptions): UseOnDisplayReturn;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| { element, taggingRequest, eventMetadata, } | UseEmitDisplayEventOptions | |
**Returns:**
UseOnDisplayReturn
If the element is currently visible in the viewport or not and the watcher stop handle.