← All Components
<mth-newsletter-form>
Form-associated (ElementInternals) newsletter signup widget composing FormControlController and InputController with email constraint validation and mth-submit event.
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-newsletter-form>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/newsletter-form"></script>
<mth-newsletter-form name="email" required>Example</mth-newsletter-form>import '@methane-ui/ui/newsletter-form';
import '@methane-ui/react';
export function Example() {
return <mth-newsletter-form name="email" required>Example</mth-newsletter-form>;
}<script setup lang="ts">
import '@methane-ui/ui/newsletter-form';
</script>
<template>
<mth-newsletter-form name="email" required>Example</mth-newsletter-form>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/newsletter-form';
import { MthNewsletterFormDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthNewsletterFormDirective],
template: `<mth-newsletter-form name="email" required>Example</mth-newsletter-form>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/newsletter-form';
import MthNewsletterForm from '@methane-ui/svelte/MthNewsletterForm.svelte';
</script>
<MthNewsletterForm name="email" required>Example</MthNewsletterForm>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
value | value | string | "" | Current email input value synchronized with the host form. |
name | name | string | "email" | Form field name submitted to parent <form>. |
heading | heading | string | "" | Optional heading overriding the default localized title. |
placeholder | placeholder | string | "" | Placeholder text for the email input. |
submitLabel | submit-label | string | "" | Custom submit button label. |
required | required | boolean | true | Marks the email field as required. |
disabled | disabled | boolean | false | Disables the email input and submit button. |
submitted | submitted | boolean | false | Displays the confirmation status banner after submission. |
Events
| Event | Detail Type | Description |
|---|---|---|
input | undefined | Fired when the email value changes during typing. |
change | undefined | Fired when the email value commits. |
mth-submit | { email: string } | Cancelable event fired with { email } when valid email submission occurs. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| Enter | both | email input focused | Validates and submits the newsletter subscription. |
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-newsletter-form.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(submitted), :state(invalid), :state(disabled). | Conformance suite |
| i18n | Routes 9 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |