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

<mth-field>

@methane-ui/ui~7.9 KB brotli (cold + Lit)~2.0 KB marginal

Layout wrapper and Community Context Protocol provider for Methane form controls.

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-field> (@methane-ui/ui)
Ready · interact with <mth-field>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/field"></script>
<mth-field density="compact">Example</mth-field>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
labellabelstring""Field label text propagated to child controls via FieldContext.
hinthintstring""Helper description text propagated via FieldContext.
errorerrorstring""Validation error message propagated via FieldContext.
requiredrequiredbooleanfalseMarks the field required and propagates via FieldContext.
disableddisabledbooleanfalseDisables descendant Methane controls via FieldContext.
densitydensity'compact' | 'default' | 'comfortable'"default"Density scale override for layout spacing.

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="none".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(required), :state(disabled), :state(invalid).Conformance suite
i18nRoutes 1 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test