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

<mth-textarea>

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

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

Interactive StageLive Custom Element · <mth-textarea> (@methane-ui/ui)
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>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
valuevaluestring""Current string value.
namenamestring""Form submission field name.
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""Placeholder text displayed when empty.
rowsrowsnumber3Visible number of text lines.
autoResizeauto-resizebooleanfalseAutomatically grows block-size to fit content using an adopted stylesheet.
maxlengthmaxlengthnumber | nullnullMaximum allowed character length and counter limit.
minlengthminlengthnumber | nullnullMinimum required character length for validation.
resizeresize'none' | 'vertical' | 'both'"vertical"Resize handle behavior when autoResize is false.
disableddisabledbooleanfalseDisables user interaction.
requiredrequiredbooleanfalseMarks textarea 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.

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
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