Customize the Text Selection Tooltip in Our Viewer

PSPDFKit for Web comes with a built-in toolbar that shows whenever text is selected on a document.

These are the toolbar’s default button types:

  • highlight

  • strikeout

  • underline

  • squiggle

  • comment

If you purchased our Redaction component, the redact-text-highlighter button type will also show up.

Text selection tooltip

As with any other aspect of our SDK, this toolbar is customizable. So, for example, if you want to hide the strikeout, underline, and squiggle buttons, you can do so using CSS:

.PSPDFKit-Text-Markup-Inline-Toolbar-Strike-Out,
.PSPDFKit-Text-Markup-Inline-Toolbar-Underline,
.PSPDFKit-Text-Markup-Inline-Toolbar-Squiggle {
  display: none;
}

If you’d like more advanced customizability, such as adding custom buttons or a custom node, add a new inline text selection tool using our customization API.