Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-signature-pad>

@methane-ui/ui~7.9 KB brotli (cold + Lit)~2.0 KB marginal

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

Interactive StageLive Custom Element · <mth-signature-pad> (@methane-ui/ui)
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>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
valuevaluestring""Serialized signature payload (PNG data URL or typed signature string).
namenamestring""Form field name.
labellabelstring""Accessible field label.
penColorpen-colorstring""Optional stroke CSS color (defaults to current text color).
penWidthpen-widthnumber2Stroke width in pixels.
disableddisabledbooleanfalseDisables drawing and controls.
readonlyreadonlybooleanfalsePrevents modifying the signature.
requiredrequiredbooleanfalseMarks a signature as required.

Events

EventDetail TypeDescription
mth-change{ value: string; isEmpty: boolean }Fired when strokes change or signature is cleared.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
EnterbothSignature canvas or typed signature input is focusedRecords typed or drawn signature value
SpacebothUndo or Clear button is focusedReverts last stroke or clears the signature pad

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusdelegatesFocus: true with zero host internals.role (ADR-014).lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 2 APG keyboard transitions across LTR/RTL.mth-signature-pad.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(disabled), :state(readonly), :state(dirty), :state(touched), :state(invalid).Conformance suite
i18nRoutes 5 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test