← All Components
<mth-address-input>
Form-associated structured postal address composite input with autocomplete tokens (street-address, address-level2, address-level1, postal-code, country).
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-address-input>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/address-input"></script>
<mth-address-input></mth-address-input>import '@methane-ui/ui/address-input';
import '@methane-ui/react';
export function Example() {
return <mth-address-input></mth-address-input>;
}<script setup lang="ts">
import '@methane-ui/ui/address-input';
</script>
<template>
<mth-address-input></mth-address-input>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/address-input';
import { MthAddressInputDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthAddressInputDirective],
template: `<mth-address-input></mth-address-input>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/address-input';
import MthAddressInput from '@methane-ui/svelte/MthAddressInput.svelte';
</script>
<MthAddressInput></MthAddressInput>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
value | value | string | "" | Serialized JSON string of structured address fields (empty string when all fields blank). |
name | name | string | "" | Form submission field name. |
label | label | string | "" | Accessible fieldset legend. |
hint | hint | string | "" | Helper text displayed below address grid. |
error | error | string | "" | Explicit validation error message. |
includeLine2 | include-line2 | boolean | false | Displays secondary address line 2 field. |
disabled | disabled | boolean | false | Disables all address inputs. |
required | required | boolean | false | Requires street, city, postal code, and country. |
readonly | readonly | boolean | false | Prevents edits while remaining focusable. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-input | { value: string; address: unknown } | Fired synchronously when any address subfield updates. |
mth-change | { value: string; address: unknown } | Fired when any address subfield commits. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| Tab | both | focused inside address grid | moves linearly through street, city, region, postal code, and country fields |
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-address-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 9 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |