← All Components
<mth-input>
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
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>import '@methane-ui/ui/input';
import '@methane-ui/react';
export function Example() {
return <mth-input type="text"></mth-input>;
}<script setup lang="ts">
import '@methane-ui/ui/input';
</script>
<template>
<mth-input type="text"></mth-input>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/input';
import { MthInputDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthInputDirective],
template: `<mth-input type="text"></mth-input>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/input';
import MthInput from '@methane-ui/svelte/MthInput.svelte';
</script>
<MthInput type="text"></MthInput>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
value | value | string | "" | Current string value. |
name | name | string | "" | Form submission field name. |
type | type | 'text' | 'email' | 'url' | 'search' | 'tel' | 'password' | "text" | Semantic input type (text | email | url | search | tel). |
label | label | string | "" | Accessible label rendered inside shadow root. |
hint | hint | string | "" | Helper text displayed and linked via aria-describedby inside shadow root. |
error | error | string | "" | Explicit custom error message displayed inside shadow root. |
placeholder | placeholder | string | "" | Hint displayed when empty. |
autocomplete | autocomplete | string | "" | HTML autocomplete token passed through to the underlying <input>. |
inputmode | inputmode | string | "" | Virtual keyboard hint passed through to the underlying <input>. |
disabled | disabled | boolean | false | Disables user interaction. |
required | required | boolean | false | Marks input required for constraint validation. |
readonly | readonly | boolean | false | Prevents edits while remaining focusable and submittable. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-input | { value: string } | Fired synchronously on user input edits. |
mth-change | { value: string } | Fired when edited value commits. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| Enter | both | inside a form and not composing IME | requests submission of owning form |
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 1 APG keyboard transitions across LTR/RTL. | mth-input.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(dirty), :state(touched), :state(user-invalid), :state(disabled), :state(required), :state(readonly). | Conformance suite |
| i18n | Routes 6 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |