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

<mth-password-input>

@methane-ui/ui~10.1 KB brotli (cold + Lit)~3.2 KB marginal

Form-associated password input with visibility toggle, optional password strength meter, minlength validation, and same-root ARIA.

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-password-input> (@methane-ui/ui)
Ready · interact with <mth-password-input>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/password-input"></script>
<mth-password-input autocomplete="current-password" toggleable></mth-password-input>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
valuevaluestring""Current password value.
namenamestring""Form submission field name.
labellabelstring""Accessible label rendered inside shadow root.
hinthintstring""Helper text displayed below input.
errorerrorstring""Explicit custom error message.
placeholderplaceholderstring""Hint displayed when empty.
autocompleteautocompletestring"current-password"HTML autocomplete token (defaults to current-password).
revealedrevealedbooleanfalseWhen true, shows plaintext (type="text").
toggleabletoggleablebooleantrueDisplays visibility toggle button.
showStrengthshow-strengthbooleanfalseDisplays live password strength indicator.
minlengthminlengthnumber0Minimum required length when non-empty.
disableddisabledbooleanfalseDisables interaction.
requiredrequiredbooleanfalseMarks control required.
readonlyreadonlybooleanfalsePrevents edits while remaining focusable.

Events

EventDetail TypeDescription
mth-input{ value: string }Fired synchronously on edits.
mth-change{ value: string }Fired when edited value commits.
mth-reveal-change{ revealed: boolean }Fired when plaintext visibility toggles.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
Enterbothinside a form and not composing IMErequests submission of owning form

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 1 APG keyboard transitions across LTR/RTL.mth-password-input.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(dirty), :state(touched), :state(user-invalid), :state(disabled), :state(required), :state(readonly).Conformance suite
i18nRoutes 11 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test