Dash AG Grid, currently at version 35.2.0, is a high-performance and highly customizable Dash component that wraps the AG Grid JavaScript library. It enables Python developers to create rich, interactive data tables within their Dash applications, offering features like sorting, filtering, and row selection. Actively maintained by Plotly, it receives frequent updates that often align with new releases of the underlying AG Grid component.
pip install dash-ag-gridVerified import paths — ran on the pinned version, not inferred.
This quickstart creates a basic Dash app displaying a Pandas DataFrame in an interactive AG Grid, demonstrating the minimal setup for displaying tabular data.
For versions `v33+`, use the new theme API. For example, pass `dashGridOptions={'theme': 'alpine'}` or custom CSS variables instead of `className` for theming. Refer to the official Dash AG Grid documentation on theming.When dynamically updating `columnDefs`, consider using the `resetColumnState()` method or carefully managing `columnState` as an input/output in callbacks. Prefer `flex` over `sizeToFit` for column sizing to reduce conflicts.
Be prepared to write and manage JavaScript for complex custom grid behaviors. Place JavaScript files in the `assets/` folder and ensure functions/components are registered in the correct `window.dashAgGrid*Functions` namespaces. Consult the 'JavaScript and Dash AG Grid' section of the official documentation.
If you need to render raw HTML or execute string-based JavaScript, set `dangerously_allow_code=True` on the `AgGrid` component. For custom components or trusted HTML, using Python functions for `cellRenderer` or defining custom JavaScript components is generally safer.
Install the package using pip: 'pip install dash-ag-grid'.
Pass 'rowSelection' inside 'dashGridOptions': 'dag.AgGrid(dashGridOptions={'rowSelection': 'multi'}, ...)'Pass 'sortable' inside 'defaultColDef' or 'columnDefs': 'dag.AgGrid(defaultColDef={'sortable': True}, ...)'Ensure 'dash_ag_grid' is installed and imported correctly: 'import dash_ag_grid as dag'.
Update the import path to the correct location: 'import 'ag-grid-community/styles/ag-grid.css''.