Angular Signature Pad | ng-hub-ui-signature
Accessible Angular signature field that stores mouse, touch and pen input as scalable SVG form values, with undo, redo and PNG export.
API reference
Here's the full contract for signature: everything you can bind, listen to, project and theme, gathered in one place. Wire up what you need and style what you want — it's standalone and signal-friendly.
Inputs
Dial signature in with 9 inputs. Bind them like any Angular @Input.
| Name | Type | Default | Description |
|---|---|---|---|
label | string | '' | Visible field label. |
formText | string | '' | Helper text shown below the drawing surface. |
height | number | 160 | Logical canvas height in CSS pixels. |
strokeColor | string | 'currentColor' | Colour recorded in new SVG strokes. |
strokeWidth | number | 2 | Base width recorded in new SVG strokes. |
readonly | boolean | false | Prevents drawing while preserving the signature. |
controls | boolean | true | Shows clear, undo and redo actions. |
labels | Partial<HubSignatureLabels> | {} | Overrides the application-wide translated action labels for this field only. |
ariaLabel | string | 'Signature' | Accessible name for the drawing surface. |
Outputs
React to what signature does — 1 events to hook your logic onto.
| Name | Type | Description |
|---|---|---|
valueChange | EventEmitter<string> | Emits the SVG value after a user-originated change. |
Methods
Drive signature from code — 5 methods on its programmatic surface.
| Name | Signature | Returns | Description |
|---|---|---|---|
clear | clear(): void | — | Removes every stroke and emits the empty value. |
undo | undo(): void | — | Removes the most recently committed stroke. |
redo | redo(): void | — | Restores the most recently undone stroke. |
toSvg | toSvg(): string | — | Returns the scalable SVG form value. |
toDataUrl | toDataUrl(type?: string): string | — | Exports the rendered signature, PNG by default. |
Templates
No templates documented yet.