← All Components
<mth-textarea>
Form-associated multi-line textarea with auto-resize, character counter, FACE validation, same-root ARIA, and FieldContext integration.
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-textarea>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/textarea"></script>
<mth-textarea rows="3" maxlength="null"></mth-textarea>import '@methane-ui/ui/textarea';
import '@methane-ui/react';
export function Example() {
return <mth-textarea rows="3" maxlength="null"></mth-textarea>;
}<script setup lang="ts">
import '@methane-ui/ui/textarea';
</script>
<template>
<mth-textarea rows="3" maxlength="null"></mth-textarea>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/textarea';
import { MthTextareaDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthTextareaDirective],
template: `<mth-textarea rows="3" maxlength="null"></mth-textarea>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/textarea';
import MthTextarea from '@methane-ui/svelte/MthTextarea.svelte';
</script>
<MthTextarea rows="3" maxlength="null"></MthTextarea>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
value | value | string | "" | Current string value. |
name | name | string | "" | Form submission field name. |
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 | "" | Placeholder text displayed when empty. |
rows | rows | number | 3 | Visible number of text lines. |
autoResize | auto-resize | boolean | false | Automatically grows block-size to fit content using an adopted stylesheet. |
maxlength | maxlength | number | null | null | Maximum allowed character length and counter limit. |
minlength | minlength | number | null | null | Minimum required character length for validation. |
resize | resize | 'none' | 'vertical' | 'both' | "vertical" | Resize handle behavior when autoResize is false. |
disabled | disabled | boolean | false | Disables user interaction. |
required | required | boolean | false | Marks textarea 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. |
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 |
| 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 |