How to add title in code

In the material design theme, I can write code to add components to a main form’s content_panel or navbar_links slots but not the title.

In the IDE, I can drop a component into the “Drop Title Here” slot but it just appears as a direct child of the form itself.

Is there any way to manipulate the title slot in code?

(I’ve had a look at standard-page.html but I can’t spot any obvious difference between the title and navbar slots).

Bizarrely, I do see that the text in the navbar slot is “Drop Links Here” whereas in standard-page.html it looks like it should be “Drop a FlowPanel here”

1 Like

I think you just pass the kwarg slot='title'

self.add_component(Label(text='foo'), slot='title')
1 Like

Ah! Of course!

I was expecting to see it as an object in its own right like the other two but this works just as well.

Thanks again.

1 Like