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

<mth-schema-form>

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

Declarative JSON-Schema-subset form renderer emitting public <mth-field> and <mth-input> controls with schema constraint validation and FORM_CONTEXT propagation.

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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/schema-form"></script>
<mth-schema-form></mth-schema-form>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
schemaJsonschema-jsonstring""JSON-serialized form schema string for declarative HTML/SSR usage.
submitLabelsubmit-labelstring""Custom text for the submit button.
showResetshow-resetbooleanfalseRenders a form reset button.
disableddisabledbooleanfalseDisables all generated fields and submission via FORM_CONTEXT.
readonlyreadonlybooleanfalsePropagates read-only state via FORM_CONTEXT.

Events

EventDetail TypeDescription
mth-input{ values: Record<string, unknown>; valid: boolean }Fired synchronously when any generated field updates.
mth-change{ values: Record<string, unknown>; valid: boolean }Fired when a field commits a value change.
mth-submit{ values: Record<string, unknown>; valid: boolean }Cancelable event fired when schema validation succeeds on submit.
mth-invalid{ errors: Record<string, string> }Fired on submit when schema constraint validation fails.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
Enterbothfocused inside form controlvalidates schema and dispatches mth-submit or mth-invalid

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
keyboardImplements all 1 APG keyboard transitions across LTR/RTL.mth-schema-form.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(submitting), :state(invalid), :state(submitted).Conformance suite
i18nRoutes 10 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test