Customizing RangeSlider doesn't work in a template

RangeSlider doesn’t seem customizable when used in a template.

Here is my code:

import panel as pn
from panel.template import DefaultTheme

pn.extension()

slider = pn.Column(
    pn.widgets.RangeSlider(
        value=(0, 1000000),
        start=0,
        end=1000000,
        step=1000,
        name="Slider",
        bar_color="#5f9ed1",
        width=400
    )
)

template = pn.template.FastListTemplate(
    title="Slider",
    theme_toggle = False,
    theme=DefaultTheme.find_theme(pn.template.FastListTemplate),
    header_background="#5f9ed1",
    main=[slider]
).servable()

And when I use panel serve script.py I get the following
image

However, when I use .show() instead of .servable(), it works as expected.

image

What can I do to make it work also with servable?

1 Like

Hi @sorin

The Fast template currently does not use/ support the bar_color. You can

  • Create a Feature Request for this or
  • Use css to set the bar color when using the Fast templates.

Hi @Marc!

Do you know if there is a template alternative which supports bar_color?

1 Like

Nope. But I would guess the others do. Its easy to try it out. Just change FastListTemplate to for example MaterialTemplate.

MaterialTemplate did the trick (funny thing is that other elements were also updated to a better layout).

Thanks!