Skip to content

Status bar

The bottom bar with items at the start and end. ui.status_item shows an icon and/or text, can be pressed, selected (a dock that is open) and carry a tooltip with keys.

ui.status_bar · Category: Workspace · Full reference →

Status barStatus bar
  • For always-visible state: errors and warnings, cursor position, language, git branch.
from pyzed import ui
ui.status_bar(
[ui.status_item(icon="panel-left", on_press=on_toggle, selected=True, tooltip="Project panel", keys="ctrl-b"),
ui.status_item("0", icon="circle-x"), ui.status_item("2", icon="triangle-alert", icon_color="warning")],
[ui.status_item("Ln 12, Col 8"), ui.status_item("UTF-8"), ui.status_item("Python", icon="file-code")],
)
Status bar: TextStatus bar: Text
Text
Code
ui.status_item("Ln 12, Col 8")
Status bar: icon=Status bar: icon=
icon=
Code
ui.status_item("Python", icon="file-code")
Status bar: icon_color="warning"Status bar: icon_color="warning"
icon_color="warning"
Code
ui.status_item("2", icon="triangle-alert", icon_color="warning")
Status bar: selected=TrueStatus bar: selected=True
selected=True
Code
ui.status_item(icon="panel-left", on_press=on_toggle, selected=True)
Status bar: color="accent"Status bar: color="accent"
color="accent"
Code
ui.status_item("main", icon="git-branch", color="accent")
Status bar: start=, end=Status bar: start=, end=
start=, end=
Code
pz.container(ui.status_bar([ui.status_item("0", icon="circle-x")],
[ui.status_item("UTF-8"), ui.status_item("Python")]), width=420)

Status bar has 1 event of its own, listed below. 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.

Event Handler gets When
on_press () Message or callable sent on press. None disables the control.

Handler gets is what Pyzed passes to your callable: () means nothing. Any handler can also be a message (a value that is not callable), which goes to update().

The same events written three ways. Imperative: methods of the app change self. Declarative: the handlers produce messages and one update() decides. Functional: a pure function draws an immutable state and asks for changes with set_state(...). See Imperative, declarative and functional.

class Ide(pz.App):
def __init__(self):
self.show_left = True
def view(self):
return ui.status_bar(
[ui.status_item(icon="panel-left", selected=self.show_left, tooltip="Project panel",
on_press=lambda: setattr(self, "show_left", not self.show_left))],
[ui.status_item("Python", icon="file-code")],
)
status_bar(start=(), end=(), *, height=28, theme=None)

The bottom status bar.

Property Default Description
start () Widgets at the start (left).
end () Widgets at the end (right).
height 28 Height.
theme None Theme to use instead of the current one (pyzed.theme.current()).

Full reference →

status_item(
content=None,
on_press=None,
*,
icon=None,
color=None,
icon_color=None,
selected=False,
tooltip=None,
keys=None,
theme=None,
)

An icon and/or text in the status bar (diagnostics, cursor position, language…).

Property Default Description
content None Text.
icon None Name of a Lucide icon (pyzed icons lists them).
color None Text or icon color.
icon_color None Icon color: a theme token or a hex color.
selected False Marks it as selected.
tooltip None Tooltip text.
keys None Shortcut shown at the end, written as a string: "ctrl-s", "cmd-k cmd-s".
theme None Theme to use instead of the current one (pyzed.theme.current()).

Events: on_press (events).

Full reference →