Skip to content

SignaturePad

Canvas-based signature pad component wrapping the signature_pad library. Supports v-model binding, clear, and confirm operations.


Basic Usage

Draw a signature on the panel and click confirm to get the Base64 DataURL.

vue

<TSignaturePad v-model="signature" />

Custom Colors & Size

Customize pen color and canvas dimensions via pen-color, :width, and :height.

vue

<TSignaturePad pen-color="#0ca678" :width="300" :height="150" />
<TSignaturePad pen-color="#d63939" :width="300" :height="150" />

Disabled State

Set disabled to prevent drawing, useful for viewing signed signatures.

vue

<TSignaturePad disabled />

API

Props

PropTypeDefaultDescription
model-value / v-modelstring''Signature DataURL
widthnumber400Canvas width
heightnumber200Canvas height
pen-colorstring'#000000'Pen color
background-colorstring'#ffffff'Background color
min-widthnumber0.5Minimum line width
max-widthnumber2.5Maximum line width
throttlenumber16Throttle interval (ms)
disabledbooleanfalseDisable drawing
clear-textstring'Clear'Clear button text
confirm-textstring'Confirm'Confirm button text

Emits

EventParametersDescription
update:model-valuedataURL: string | nullv-model update
confirmdataURL: stringSignature confirmed
clearSignature cleared

Expose

MethodDescription
isEmpty()Whether signature is empty
toDataURL(type?, encoderOptions?)Get signature DataURL
fromDataURL(dataURL)Load signature from DataURL
clear()Clear signature

Slots

SlotDescription
footerCustom action buttons area