Configure canvas responsiveness
masterThe SignaturePad component handles canvas sizing in two ways:
- Fixed Size: Pass explicit
widthandheightprops (in pixels). - Responsive: Omit the
widthandheightprops. The component will automatically update the canvas size on window resize using a debounced handler.
Note: Changing canvas dimensions normally erases existing content. To prevent this, use the redrawOnResize prop.
// Fixed size
<SignaturePad width={500} height={500} />
// Responsive (omitting width/height)
<SignaturePad />
// Responsive with content preservation
<SignaturePad redrawOnResize />