Skip to content

dash-ag-grid v33 doesn't support withPart for theming updates #427

Closed

Description

@LiamConnors

dash-ag-grid v33 doesn't support withPart for theming updates

This means some examples in AG Grid docs do not work and require using legacy theming.

For example, this one that switches out the icons https://www.ag-grid.com/archive/33.3.2/react-data-grid/custom-icons/#swapping-the-provided-icon-set

And this one here that configures the color scheme https://www.ag-grid.com/archive/33.3.2/react-data-grid/theming-parts/#configuring-theme-parts

Activity

  1. self-assigned this
    on Dec 30, 2025
  2. AnnMarieW commented on Dec 31, 2025

    @AnnMarieW
    Collaborator

    To use legacy themes (by setting the className), it looks like you need to import the old css stylesheets, and set theme to "legacy" Here's an example of setting a dark theme:

    from dash import Dash, html
    import dash_ag_grid as dag
    import plotly.express as px
    
    
    app = Dash(external_stylesheets=[dag.themes.BASE, dag.themes.ALPINE])
    
    df = px.data.gapminder()
    df = df[['country', 'continent', 'year', 'pop']]
    
    app.layout = html.Div(
        [
            dag.AgGrid(
                id="getting-started-themes-example",
                columnDefs= [{"field": x, } for x in df.columns],
                rowData= df.to_dict('records'),
                className="ag-theme-alpine-dark",
                columnSize="sizeToFit",
               dashGridOptions={"theme": "legacy"}
            ),
        ]
    )
    
    if __name__ == "__main__":
        app.run(debug=True)
  3. AnnMarieW commented on Dec 31, 2025

    @AnnMarieW
    Collaborator

    Here's an example using the solution in PR #428

    from dash import Dash, html
    import dash_ag_grid as dag
    import plotly.express as px
    
    
    app = Dash(
        external_scripts=[
                f'https://cdn.jsdelivr.net/npm/ag-grid-community@{dag.grid_version}/dist/ag-grid-community.min.js'
        ]
    )
    
    
    df = px.data.gapminder()
    df = df[['country', 'continent', 'year', 'pop']]
    
    app.layout = html.Div(
        [
            dag.AgGrid(
                id="getting-started-themes-example",
                columnDefs= [{"field": x, } for x in df.columns],
                rowData= df.to_dict('records'),
                columnSize="sizeToFit",
                dashGridOptions={'theme': {'function': 'customTheme(themeAlpine, createPart)'}},
            ),
        ]
    )
    
    if __name__ == "__main__":
        app.run(debug=True)
    
    var dagfuncs = (window.dashAgGridFunctions = window.dashAgGridFunctions || {});
    
    dagfuncs.customTheme = (theme, createPart) => {
        return theme.withPart(createPart(agGrid.colorSchemeDarkBlue))
    }
  4. nhoover commented on Jan 22, 2026

    @nhoover

    Thanks @AnnMarieW - adding

    app = Dash(external_stylesheets=[dag.themes.BASE, dag.themes.ALPINE])

    and

    dashGridOptions={"theme": "legacy"}

    I was able to get my dark mode grids working with 33.3.3 (community).

    Is this the preferred method going forward?

  5. BSd3v commented on Jan 22, 2026

    @BSd3v
    Collaborator

    Hello @nhoover,

    It is an option of how to render. The legacy means that you can config without breaking your app immediately. The docs should be updated soon, if not already.

    The newer api allows for a easy way to mix and match styles without needing to get into the css necessarily. AG Grid also has a theme builder that can construct things for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions