Skip to content

ui.aggrid Unable to adapt to dark themes #3611

Closed Answered by falkoschindler
mxiaonian asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @mxiaonian,

You can update the theme of ui.aggrid by adding and removing classes like this:

aggrid = ui.aggrid({})

def handle_theme_change(e: events.ValueChangeEventArguments):
    aggrid.classes(add='ag-theme-balham-dark' if e.value else 'ag-theme-balham',
                   remove='ag-theme-balham' if e.value else 'ag-theme-balham-dark')

ui.switch(on_change=handle_theme_change).bind_value(ui.dark_mode())

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@mxiaonian
Comment options

@falkoschindler
Comment options

Answer selected by mxiaonian
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #3610 on August 27, 2024 15:25.