Quickstart Guide
This quickstart guide will help you create your first AG Grid in under 5 minutes. We’ll build a simple data grid with sorting, filtering, and pagination.This guide uses React for examples, but AG Grid works identically with Angular, Vue, and vanilla JavaScript. Check the tabs for framework-specific code.
Prerequisites
Before you begin, ensure you have:- Node.js 18+ installed
- A package manager (npm, yarn, or pnpm)
- Basic knowledge of your chosen framework (React, Angular, or Vue)
Step 1: Create a New Project
Step 2: Create Your First Grid
Let’s create a simple grid displaying car data with three columns.Step 3: Add Sorting and Filtering
Enable sorting and filtering by addingdefaultColDef:
Click column headers to sort. Click the menu icon (≡) in the header to access filters.
Step 4: Add Pagination
Enable pagination to handle large datasets:Step 5: Customize Columns
Add custom formatting and column-specific settings:Step 6: Load Data from API
Fetch data from an external API:Step 7: Access Grid API
Use the Grid API to interact with the grid programmatically:The Grid API provides 100+ methods for controlling the grid programmatically. See the API Reference for the complete list.
Complete Example
Here’s a complete example with all features:What’s Next?
Now that you have a working grid, explore these features:Column Definitions
Learn about advanced column configuration and types
Row Selection
Enable row and cell selection in your grid
Cell Editing
Make your grid editable with inline cell editors
Custom Components
Create custom cell renderers and editors
Themes
Customize the appearance with themes and CSS
Grid API
Explore all Grid API methods and events
Common Next Steps
Enable Cell Editing
Make cells editable:Add Row Selection
Enable row selection:Implement Server-Side Sorting and Filtering
For large datasets, implement server-side operations:Troubleshooting
Grid not showing
Ensure:- Both CSS files are imported
- Container has a defined height
- Theme class is applied to container
Columns not sizing correctly
Useflex for responsive columns or set explicit width:
TypeScript errors
Ensure your row data interface matches your column definitions:Get Help
Stack Overflow
Ask questions with the ag-grid tag
GitHub Issues
Report bugs or request features
Documentation
Browse the complete documentation
Examples
Explore interactive examples