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

<mth-location-picker>

@methane-ui/maps~7.9 KB brotli shell + lazy engine~2.0 KB shell · lazy engine chunk

Form-associated geographic coordinate picker (lat,lng) with keyboard nudging and validation.

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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/maps/location-picker"></script>
<mth-location-picker step="0.01"></mth-location-picker>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
namenamestring""Form field name.
valuevaluestring""Selected lat,lng string value.
defaultValuedefault-valuestring""Default reset lat,lng string value.
labellabelstring""Accessible field label.
stepstepnumber0.01Keyboard and button coordinate nudge step in degrees.
requiredrequiredbooleanfalseMarks a coordinate selection as required.
disableddisabledbooleanfalseDisables interaction and form submission.
readOnlyreadonlybooleanfalsePrevents changing the coordinate value.

Events

EventDetail TypeDescription
inputundefinedNative composed event fired when coordinate changes.
changeundefinedNative composed event fired when coordinate commits.
mth-location-select{ lat: number; lng: number; value: string }Fired with parsed lat, lng, and formatted value.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowLeftltrpin target focusedNudges longitude west
ArrowRightrtlpin target focusedNudges longitude west in RTL
ArrowUpbothpin target focusedNudges latitude north
ArrowDownbothpin target focusedNudges latitude south
Deletebothpin target focusedClears the selected coordinate

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
keyboardImplements all 5 APG keyboard transitions across LTR/RTL.mth-location-picker.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(disabled), :state(readonly), :state(invalid), :state(dirty), :state(touched).Conformance suite
i18nRoutes 11 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test