Move header in template to the right?

I have a template app like the following where I want to move the header to the right, so it is next to the switch. Is there a way to do this?

import panel as pn

pn.template.FastListTemplate(
    title="Example",
    header="Can this be moved to the right?",
).servable()

Hi @Hoxbro . There is nothing built in. But here is what I would try.

  • remove the title. Append Spacer() and pn.pane.Markdown to the header or
  • keep title and try to use some css to fix this.

UPDATE: Disregard this comment. I thought it was the title you would like to move right. See post below instead.

Something like

import panel as pn
from panel.pane.markup import Markdown

pn.template.FastListTemplate(
    title="Example",
    header=[pn.Row(pn.pane.Markdown("Can this be moved to the right?"), pn.layout.HSpacer(), pn.pane.Markdown("Yes it can!"), sizing_mode="stretch_width")]
).servable()

1 Like

Marc you’re awesome this is exactly what I needed. Thank you!

1 Like

You’re not bad either @Hoxbro :+1:

1 Like