# How to customize the text selection tooltip

**URL:** <https://pdfjs.community/t/how-to-customize-the-text-selection-tooltip/622>\
**Category:** Technical Support\
**Created:** [March 17, 2021, 2:54pm UTC](https://pdfjs.community/t/how-to-customize-the-text-selection-tooltip/622 "2021-03-17T14:54:26Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [March 18, 2021, 2:48pm UTC](https://pdfjs.community/t/how-to-customize-the-text-selection-tooltip/622/4 "2021-03-18T14:48:27Z")

</div>

Hi,

The instance comes from the promise returned by the initialization function.

```javascript
import WebViewer from '@pdftron/pdfjs-express'

WebViewer({
   ...options
}).then(instance => {

   instance.textPopup.add({
    type: 'actionButton',
    onClick: () => console.log('test'),
    img: '' // this can be a path to an image, or an SVG as a string
  })

})

```

You can just call that code as soon as WebViewer is done initializing.

---

_[View the full topic](https://pdfjs.community/t/how-to-customize-the-text-selection-tooltip/622)._
