← All Components
<mth-signature-pad>
Form-associated pointer-capture signature pad with undo/clear controls and keyboard typed-signature fallback.
When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.
Live Interactive Preview
Ready · interact with <mth-signature-pad>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/signature-pad"></script>
<mth-signature-pad pen-width="2"></mth-signature-pad>import '@methane-ui/ui/signature-pad';
import '@methane-ui/react';
export function Example() {
return <mth-signature-pad pen-width="2"></mth-signature-pad>;
}<script setup lang="ts">
import '@methane-ui/ui/signature-pad';
</script>
<template>
<mth-signature-pad pen-width="2"></mth-signature-pad>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/signature-pad';
import { MthSignaturePadDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthSignaturePadDirective],
template: `<mth-signature-pad pen-width="2"></mth-signature-pad>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/signature-pad';
import MthSignaturePad from '@methane-ui/svelte/MthSignaturePad.svelte';
</script>
<MthSignaturePad pen-width="2"></MthSignaturePad>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
value | value | string | "" | Serialized signature payload (PNG data URL or typed signature string). |
name | name | string | "" | Form field name. |
label | label | string | "" | Accessible field label. |
penColor | pen-color | string | "" | Optional stroke CSS color (defaults to current text color). |
penWidth | pen-width | number | 2 | Stroke width in pixels. |
disabled | disabled | boolean | false | Disables drawing and controls. |
readonly | readonly | boolean | false | Prevents modifying the signature. |
required | required | boolean | false | Marks a signature as required. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-change | { value: string; isEmpty: boolean } | Fired when strokes change or signature is cleared. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| Enter | both | Signature canvas or typed signature input is focused | Records typed or drawn signature value |
| Space | both | Undo or Clear button is focused | Reverts last stroke or clears the signature pad |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | delegatesFocus: true with zero host internals.role (ADR-014). | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 2 APG keyboard transitions across LTR/RTL. | mth-signature-pad.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(disabled), :state(readonly), :state(dirty), :state(touched), :state(invalid). | Conformance suite |
| i18n | Routes 5 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |