Forms Form-associated
Signature <pm-signature>
Signature pad: sign with a finger, pen or mouse. Form-associated; submits a PNG data URL.
States
Each state is one attribute.
DisabledRead-onlyRequiredErrorOverview
The ink follows the theme's text colour on screen and is exported dark on a transparent background. Keyboard users cannot draw, so offer a typed-name alternative next to it when a signature is required.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
label | string | Signature | Visible label (use hide-label to hide it visually). |
name | string | — | Form field name: the PNG data URL is submitted under it. |
hint | string | — | Help text under the pad. |
error | string | — | Custom error message. Setting it marks the field invalid. |
required | boolean | false | The form cannot be submitted until something is drawn. |
disabled | boolean | false | Not interactive and not submitted. |
height | string | — | Height of the drawing area: any CSS length (default 10rem). |
line-widthprop: lineWidth | number | 2 | Stroke thickness in pixels (default 2). |
clear-labelprop: clearLabel | string | Clear | Text of the clear button. |
hide-labelprop: hideLabel | boolean | false | Hide the label visually; it stays the accessible name. |
readonly | boolean | false | Focusable and submitted, but the user cannot change the value. |
Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.
Events
| Event | React / Svelte prop | Description |
|---|---|---|
pm-change | onPmChange | A stroke was finished or the pad was cleared. |
Methods
clear(), toDataURL(), checkValidity(), reportValidity(), validate()