react-pdf-highlighter-extended

The props type for AreaHighlight.

interface AreaHighlightProps {
    bounds?: string | Element;
    highlight: ViewportHighlight;
    isScrolledTo?: boolean;
    style?: CSSProperties;
    onChange?(rect): void;
    onContextMenu?(event): void;
    onEditStart?(): void;
}

Properties

bounds?: string | Element

react-rnd bounds on the highlight area. This is useful for preventing the user moving the highlight off the viewer/page. See react-rnd docs.

The highlight to be rendered as an AreaHighlight.

isScrolledTo?: boolean

Has the highlight been auto-scrolled into view? By default, this will render the highlight red.

style?: CSSProperties

Custom styling to be applied to the AreaHighlight component.

Methods

  • A callback triggered whenever the highlight area is either finished being moved or resized.

    Parameters

    • rect: LTWHP

      The updated highlight area.

    Returns void

  • A callback triggered whenever a context menu is opened on the highlight area.

    Parameters

    • event: MouseEvent<HTMLDivElement, MouseEvent>

      The mouse event associated with the context menu.

    Returns void