Skip to content

List header

A muted section header for lists, with an optional widget at the end (usually an icon button).

ui.list_header · Category: Lists and menus · Full reference →

List headerList header
  • To split a list into groups (RECENT, PINNED) or to add an action to a list.
import pyzed as pz
from pyzed import ui
pz.column([
ui.list_header("RECENT", end=ui.icon_button("plus", on_new, size="xs")),
ui.list_item("main.py", on_open, icon="file-code", inset=True),
ui.list_item("app.py", on_open, icon="file-code", inset=True),
ui.list_header("PINNED"),
ui.list_item("README.md", on_open, icon="file-text", inset=True),
], width=300)
List header: TitleList header: Title
Title
Code
pz.container(ui.list_header("RECENT"), width=240)
List header: end=List header: end=
end=
Code
pz.container(ui.list_header("PINNED", end=ui.icon_button("plus", on_new, size="xs")), width=240)
List header: Counter at the endList header: Counter at the end
Counter at the end
Code
pz.container(ui.list_header("CHANGES", end=ui.count_badge(4)), width=240)

List header 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.

list_header(title, *, end=None, theme=None)

A section header for lists.

Property Default Description
title required Title.
end None Widgets at the end (right).
theme None Theme to use instead of the current one (pyzed.theme.current()).

Full reference →