Formify Docs

Latitude

Validate latitude coordinates in decimal degrees.

Latitude

Validates that a value is a latitude coordinate in decimal degrees, in the range -90 to 90.

Configuration

Config flagTypeDescription
latitudebooleanWhen true, requires the value to be a valid latitude.

With useForm

const form = useForm({
  initialValues: { lat: '' },
  validationSchema: {
    lat: { latitude: true },
  },
});

With the V builder

import { V } from 'formify-js';

V.latitude();

Default message

ScenarioMessage
Value is not a valid latitudeMust be a valid latitude

Examples

ValueResult
'51.5074'✅ Valid
'-33.8688'✅ Valid
'90'✅ Valid (pole)
'91'❌ Invalid (out of range)
'12.3N'❌ Invalid (direction suffix not accepted)

Notes

  • Values outside -90 … 90 fail.
  • Direction suffixes (N/S) and degree symbols are not accepted — use plain decimal degrees.
  • Combine with latitude and longitude to validate coordinate pairs on separate fields.

On this page