Coordinate Input

Single-axis coordinate input supporting DD, DDM, and DMS formats. Use CoordinatePairInput when capturing both lat and lon together.

core/coordinate-input

Installation

1 · Add registry to components.json

2 · Install component

Examples

Single axis

Standalone latitude field with an externally controlled format.

API Reference

PropTypeDescription
valuereq
number | nullControlled decimal value. Pass null to represent an empty/unset coordinate.
onChangereq
(value: number | null) => voidCalled with the parsed decimal value on every valid change, or null when the input is empty or invalid.
typereq
"lat" | "lon"Coordinate axis. Controls direction labels (N/S for lat, E/W for lon) and degree bounds (±90 / ±180).
label
stringField label rendered above the input.
defaultFormat
"DD" | "DDM" | "DMS"Initial display format. The user can switch formats via the toggle.
description
stringHelper text shown below the label.
error
stringExternal error message. Overrides any locally derived parse error.
required
booleanAppends a red asterisk to the label.
disabled
booleanDisables all inputs and the format toggle.
invalid
booleanForces the destructive border state regardless of parse validity.