Signature
Container Properties
The first layer of all component configurations supports Container Properties.
Component Properties (componentsProps)
| Name | Type | Default | 是否支持 Variable Pattern | Description |
|---|---|---|---|---|
| className | string | ✔️ | The className of the component. | |
| style | object | The style of the component. | ||
| penColor | string | 'black' | Pen stroke color. | |
| minWidth | number | 0.5 | Minimum width of the pen stroke. | |
| maxWidth | number | 2.5 | Maximum width of the pen stroke. | |
| backgroundColor | string | 'rgba(0,0,0,0)' | Canvas background color. | |
| outputType | 'image/png' | 'image/jpeg' | 'image/svg+xml' | 'image/png' | Output image format of the signature. | |
| canvasWidth | number | Canvas width. Defaults to the container width if not specified. | ||
| canvasHeight | number | 200 | Canvas height. | |
| hideToolbar | bool | false | Whether to hide the bottom toolbar (hint text and clear button). |
All other componentsProps will be passed to the canvas wrapper element (div).
JS API
The interface obtained through formApi.getFieldApi() is as follows. The signaturePad property is the underlying signature_pad instance — refer to its official API documentation for more advanced operations.
| Name | Type | Description |
|---|---|---|
| node | HTML Element | The root DOM element of the component. |
| signaturePad | SignaturePad | The underlying SignaturePad instance. |
| clear | () => void | Clear the signature on the canvas. |