Dev Helpers
← Back

Latitude band classifier

Import and render <LatitudeBandClassifier /> in a React project.

Open this example in the interactive library

Live preview

Source code

// components/LatitudeBandClassifier.tsx

export default function LatitudeBandClassifier({ lat = 43.65 }: { lat?: number } = {}) {
  const a = Math.abs(lat);
  return (
    <p>{a <= 23.436 ? "Tropics" : a >= 66.564 ? "Polar circle" : "Temperate zone"}</p>
  );
}