Coordinate Pair Input

Lat/lon pair capture component with a shared DD/DDM/DMS format toggle, inline N/S and E/W direction toggles per axis, smart paste parser that detects format automatically, and a normalized DD preview with copy to clipboard. DDM default is suited to maritime/field use.

core/coordinate-pair-input

Installation

1 · Add registry to components.json

2 · Install component

Examples

Default + Maritime SAR

General mode and maritime_sar mode side by side. SAR mode uses zero-padded DDM and shows a spoken radio readback line.

API Reference

PropTypeDescription
valuereq
CoordinateValueControlled { latitude, longitude } pair. Both can be null.
onChangereq
(value: CoordinateValue) => voidCalled on any change to either axis.
mode
"general" | "operational" | "maritime_sar"Display mode. "operational"/"maritime_sar" enables fixed-width zero-padded DDM and explicit hemispheres. "maritime_sar" additionally shows the radio readback line by default.
label
stringField group label.
defaultFormat
"DD" | "DDM" | "DMS"Initial format when uncontrolled.
format
"DD" | "DDM" | "DMS"Controlled format.
onFormatChange
(format: CoordinateFormat) => voidCalled on format changes, including after a successful paste auto-detect.
allowPasteParse
booleanShow the expandable paste-any-format panel.
showNormalizedPreview
booleanShow the normalized DD preview line in the footer.
showRadioReadback
booleanShow the spoken radio readback line. Defaults to true when mode is "maritime_sar".
description
stringHelper text below the label.
error
stringExternal error shown in the footer.
required
booleanAppends a red asterisk to the label.
disabled
booleanDisables all inputs and controls.
invalid
booleanForces destructive border state on all inputs.