
React components and hooks for Google Maps JavaScript API
Version 3.x and later of @react-google-maps/api is commercial software. For licensing information and pricing, visit our documentation:
For open-source use, please see our GitHub repository for community-supported versions.
@react-google-maps/api provides declarative React components for the Google Maps JavaScript API. Build interactive maps with markers, overlays, directions, and more using familiar React patterns.
useJsApiLoader, useGoogleMap, and more# npm
npm install @react-google-maps/api
# yarn
yarn add @react-google-maps/api
# bun
bun add @react-google-maps/api
import { GoogleMap, useJsApiLoader } from '@react-google-maps/api';
import { useMemo, useCallback, useState, type JSX } from 'react';
function Map(): JSX.Element {
const { isLoaded } = useJsApiLoader({
googleMapsApiKey: 'YOUR_API_KEY',
});
const center = useMemo(() => ({ lat: 40.7128, lng: -74.006 }), []);
const containerStyle = useMemo(() => ({ width: '100%', height: '400px' }), []);
if (!isLoaded) return <div>Loading...</div>;
return (
<GoogleMap
mapContainerStyle={containerStyle}
center={center}
zoom={12}
/>
);
}
For full API documentation and examples, see:
We welcome contributions! See our contributing guide to get started.
# Clone the repository
git clone https://github.com/JustFly1984/react-google-maps-api.git
cd react-google-maps-api
# Install dependencies
bun install
# Set up workspace
bun run bootstrap
If you find this library useful, consider sponsoring the project.
Overall
Maintained
Code review
Latest release
Releases this year
3,571 followers · starred Aug 2020
515 followers · starred May 2023
359 followers · starred Jul 2019
1,648 followers · starred Mar 2024

React components and hooks for Google Maps JavaScript API
Version 3.x and later of @react-google-maps/api is commercial software. For licensing information and pricing, visit our documentation:
For open-source use, please see our GitHub repository for community-supported versions.
@react-google-maps/api provides declarative React components for the Google Maps JavaScript API. Build interactive maps with markers, overlays, directions, and more using familiar React patterns.
useJsApiLoader, useGoogleMap, and more# npm
npm install @react-google-maps/api
# yarn
yarn add @react-google-maps/api
# bun
bun add @react-google-maps/api
import { GoogleMap, useJsApiLoader } from '@react-google-maps/api';
import { useMemo, useCallback, useState, type JSX } from 'react';
function Map(): JSX.Element {
const { isLoaded } = useJsApiLoader({
googleMapsApiKey: 'YOUR_API_KEY',
});
const center = useMemo(() => ({ lat: 40.7128, lng: -74.006 }), []);
const containerStyle = useMemo(() => ({ width: '100%', height: '400px' }), []);
if (!isLoaded) return <div>Loading...</div>;
return (
<GoogleMap
mapContainerStyle={containerStyle}
center={center}
zoom={12}
/>
);
}
For full API documentation and examples, see:
We welcome contributions! See our contributing guide to get started.
# Clone the repository
git clone https://github.com/JustFly1984/react-google-maps-api.git
cd react-google-maps-api
# Install dependencies
bun install
# Set up workspace
bun run bootstrap
If you find this library useful, consider sponsoring the project.
Overall
Maintained
Code review
Latest release
Releases this year
3,571 followers · starred Aug 2020
515 followers · starred May 2023
359 followers · starred Jul 2019
1,648 followers · starred Mar 2024