Campo de firma para Angular | ng-hub-ui-signature
Campo de firma Angular accesible que guarda trazos de ratón, táctil y lápiz como SVG escalable para formularios, con deshacer, rehacer y exportación PNG.
Referencia API
Aquí tienes el contrato completo de signature: todo lo que puedes enlazar, escuchar, proyectar y personalizar, reunido en un solo sitio. Enlaza lo que necesites y dale el estilo que quieras — es standalone y reactivo con signals.
Inputs
Ajusta signature a tu gusto con 9 inputs. Se enlazan como cualquier @Input de Angular.
| Nombre | Tipo | Por defecto | Descripción |
|---|---|---|---|
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
Reacciona a lo que hace signature: 1 eventos a los que enganchar tu lógica.
| Nombre | Tipo | Descripción |
|---|---|---|
valueChange | EventEmitter<string> | Emits the SVG value after a user-originated change. |
Métodos
Controla signature desde el código — 5 métodos en su superficie programática.
| Nombre | Firma | Devuelve | Descripción |
|---|---|---|---|
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
Todavía no hay templates documentados.