Control the Appearance of the Delete Button with CSS

To control the appearance of the delete button with CSS so that it only displays when an ink annotation is selected, first load a custom stylesheet to provide your custom CSS:

const instance = await PSPDFKit.load({
  ...configuration,
  styleSheets: ["https://example.com/my-stylesheet.css"]
});

Then, add a display: none CSS rule to all delete buttons that aren’t the ink annotation one:

.PSPDFKit-Rectangle-Annotation-Toolbar-Button-Delete,
  .PSPDFKit-Ellipse-Annotation-Toolbar-Button-Delete,
  .PSPDFKit-Image-Annotation-Toolbar-Button-Delete,
  .PSPDFKit-Line-Annotation-Toolbar-Button-Delete,
  .PSPDFKit-Note-Annotation-Toolbar-Button-Delete,
  .PSPDFKit-Polygon-Annotation-Toolbar-Button-Delete,
  .PSPDFKit-Polyline-Annotation-Toolbar-Button-Delete,
  .PSPDFKit-Rectangle-Annotation-Toolbar-Button-Delete,
  .PSPDFKit-Stamp-Annotation-Toolbar-Button-Delete,
  .PSPDFKit-Text-Annotation-Toolbar-Button-Delete,
  .PSPDFKit-Text-Markup-Annotation-Toolbar-Button-Delete {
    display: none;
  }