react-pdf-highlighter-plus

The props type for ShapeCanvas.

interface ShapeCanvasProps {
    isActive: boolean;
    onCancel: (() => void);
    onComplete: ((position, shape) => void);
    shapeType: ShapeType;
    strokeColor?: string;
    strokeWidth?: number;
    viewer: PDFViewer;
}

Properties

isActive: boolean

Whether shape mode is active.

onCancel: (() => void)

Callback when shape creation is cancelled.

Type declaration

    • (): void
    • Returns void

onComplete: ((position, shape) => void)

Callback when shape creation is complete.

Type declaration

    • (position, shape): void
    • Parameters

      Returns void

shapeType: ShapeType

The type of shape to create.

strokeColor?: string

Stroke color for the shape.

Default

"#000000"
strokeWidth?: number

Stroke width for the shape.

Default

2
viewer: PDFViewer

The PDF viewer instance.