MultiChoice Color for Options

Is there a way to change the default color of the options for the MultiChoice widget?
I tried using the style parameter, but was only able to change the title of the MultiChoice.

For reference, I am using the example from the gallery:

from import show
from bokeh.models import CustomJS, MultiChoice

OPTIONS = ["foo", "bar", "baz", "quux"]

multi_choice = MultiChoice(value=["foo", "baz"], options=OPTIONS)
multi_choice.js_on_change("value", CustomJS(code="""
    console.log('multi_choice: value=' + this.value, this.toString())


I want to change the chosen options (by default foo and baz) to not be the default blue background with white font but instead something like black with yellow font.

Bokeh does not provide any API for directly manipulating this. You would need to target CSS to make these changes. Recent versions of Boke provide simpler mechanisms for adding your own CSS:

I don’t happen to know what the relevant CSS classes to target are. Your best and quickest bet is to look at a rendered multi-select widget with your favorite bowser’s DOM inspector.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.