Coordinate Input
Single-axis coordinate input supporting DD, DDM, and DMS formats. Use CoordinatePairInput when capturing both lat and lon together.
core/coordinate-inputInstallation
1 · Add registry to components.json
2 · Install component
Examples
Single axis
Standalone latitude field with an externally controlled format.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
valuereq | number | null | — | Controlled decimal value. Pass null to represent an empty/unset coordinate. |
onChangereq | (value: number | null) => void | — | Called 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 | string | — | Field label rendered above the input. |
defaultFormat | "DD" | "DDM" | "DMS" | "DD" | Initial display format. The user can switch formats via the toggle. |
description | string | — | Helper text shown below the label. |
error | string | — | External error message. Overrides any locally derived parse error. |
required | boolean | — | Appends a red asterisk to the label. |
disabled | boolean | — | Disables all inputs and the format toggle. |
invalid | boolean | — | Forces the destructive border state regardless of parse validity. |