☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

How to create space between two sliders

Community Support
carolyn
carolyn

Hi @Li_Shen!

You’d want to add a margin to each Slider. Here’s an example:

from bokeh.layouts import row
from bokeh.models import Slider
from bokeh.plotting import show

slider_margin = (0, 10, 0, 10)

s1 = Slider(start=0, end=10, value=0, step=1, title="First", margin=slider_margin)
s2 = Slider(start=10, end=20, value=10, step=1, title="Second", margin=slider_margin)
s3 = Slider(start=20, end=30, value=20, step=1, title="Third", margin=slider_margin)

r = row(s1, s2, s3)

show(r)

The margin tuple is (top, right, bottom, left). Reference is here.

⌁   Link to post
mateusz
mateusz

A better solution is to use item spacing, e.g.:

from bokeh.layouts import row
from bokeh.models import Slider
from bokeh.plotting import show

s1 = Slider(start=0, end=10, value=0, step=1, title="First")
s2 = Slider(start=10, end=20, value=10, step=1, title="Second")
s3 = Slider(start=20, end=30, value=20, step=1, title="Third")

r = row(s1, s2, s3, spacing=10)

show(r)
⌁   Link to post

End of archived discussion · Replies are disabled