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

<mth-input>

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

Form-associated textual input supporting FACE validation, same-root ARIA, FieldContext, and progressive Light-DOM autofill slot.

When NOT to use: Do not use <mth-input> for multi-line editorial copy; use <mth-textarea> or @methane-ui/editor.

Live Interactive Preview

Interactive StageLive Custom Element · <mth-input> (@methane-ui/ui)
Ready · interact with <mth-input>, or toggle Theme, Direction (LTR/RTL), or props above.

Live Variants & States Showcase

default + hint
error state
readonly & disabled

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/input"></script>
<mth-input type="text"></mth-input>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
valuevaluestring""Current string value.
namenamestring""Form submission field name.
typetype'text' | 'email' | 'url' | 'search' | 'tel' | 'password'"text"Semantic input type (text | email | url | search | tel).
labellabelstring""Accessible label rendered inside shadow root.
hinthintstring""Helper text displayed and linked via aria-describedby inside shadow root.
errorerrorstring""Explicit custom error message displayed inside shadow root.
placeholderplaceholderstring""Hint displayed when empty.
autocompleteautocompletestring""HTML autocomplete token passed through to the underlying <input>.
inputmodeinputmodestring""Virtual keyboard hint passed through to the underlying <input>.
disableddisabledbooleanfalseDisables user interaction.
requiredrequiredbooleanfalseMarks input required for constraint validation.
readonlyreadonlybooleanfalsePrevents edits while remaining focusable and submittable.

Events

EventDetail TypeDescription
mth-input{ value: string }Fired synchronously on user input edits.
mth-change{ value: string }Fired when edited value commits.

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