Skip to content

Toolbar

The bar below the tabs of a code editor: widgets at the start (usually breadcrumbs) and at the end (buffer actions).

ui.toolbar · Category: Navigation · Full reference →

ToolbarToolbar
  • Between the tab bar and the editor, or at the top of any content view.
from pyzed import ui
ui.toolbar(
[ui.breadcrumbs([("file-code", "src"), "main.rs", "fn main"])],
[ui.icon_button("search", on_search, size="sm"), ui.icon_button("sparkles", on_assist, size="sm")],
)
Toolbar: Start onlyToolbar: Start only
Start only
Code
pz.container(ui.toolbar([ui.breadcrumbs(["src", "main.rs"])]), width=400)
Toolbar: End onlyToolbar: End only
End only
Code
pz.container(ui.toolbar([], [ui.icon_button("search", on_search, size="sm"),
ui.icon_button("sparkles", on_assist, size="sm")]), width=400)
Toolbar: height=40Toolbar: height=40
height=40
Code
pz.container(ui.toolbar([ui.label("Preview")], [ui.button("Publish", on_publish, size="sm", variant="solid")],
height=40), width=400)
Toolbar: center=Toolbar: center=
center=
Code
pz.container(ui.toolbar([ui.breadcrumbs(["src", "app.py"])], [ui.icon_button("play", on_press)],
center=ui.muted("Running…", size="sm")), width=440)

Toolbar has no events of its own: it shows what you give it. Like every widget it also has the 18 common events (click, double_click, right_click, mouse_enter, drag, key_down, resize…), attached with .on(...): see Events and Events of every component.

toolbar(start=(), end=(), *, center=None, height=32, theme=None)

The bar below the tabs: breadcrumbs on the left and buffer actions on the right.

Property Default Description
start () Widgets at the start (left).
end () Widgets at the end (right).
center None Kept in the middle of the bar whatever the widths of both sides.
height 32 Height.
theme None Theme to use instead of the current one (pyzed.theme.current()).

Full reference →