AG Grid is available for download from NPM. Once installed, you need to import the package and register the modules you want to use.
Installation Copy Link
Install the ag-grid-react package, which also installs ag-grid-community:
npm install ag-grid-react
To use AG Grid Enterprise features, install the ag-grid-enterprise package:
npm install ag-grid-enterprise
You can test AG Grid Enterprise locally without a licence. To test in production, access support, and remove the watermark and console warnings, request a trial licence.
ag-grid-react and ag-grid-enterprise versions must be identical to ensure that all features work correctly.
Registering Modules Copy Link
Use AgGridProvider to provide modules and a license key (enterprise only) to all grid instances. Provide AllCommunityModule to access all Community features or AllEnterpriseModule to access all Community and Enterprise features:
import { AllCommunityModule } from 'ag-grid-community';
// import { AllEnterpriseModule } from 'ag-grid-enterprise';
import { AgGridProvider, AgGridReact } from 'ag-grid-react';
const modules = [AllCommunityModule];
function App() {
return (
<AgGridProvider modules={modules} licenseKey="YOUR_LICENSE_KEY">
<AgGridReact /* ... props */ />
</AgGridProvider>
);
}
To minimize bundle size, only register the modules you want to use. See the Selecting Modules docs for more information.
Importing Copy Link
Import AgGridProvider and AgGridReact from the ag-grid-react package:
import { AgGridProvider, AgGridReact } from 'ag-grid-react';