Skip to content

Description list

The details of something, one property per row: names on the left (or above with vertical) and their values, which can be text or any widget such as a badge. Text values can be selected and copied.

ui.description_list · Category: Data · Full reference →

Description listDescription list
  • For the properties of a file, an order, a user or a device.
  • For many rows of the same columns, use a Table.
import pyzed as pz
from pyzed import ui
pz.container(ui.description_list({
"Name": "report.pdf",
"Size": "2.4 MB",
"Modified": "Today, 10:42",
"Status": ui.badge("Synced", tint="success"),
}), width=360)
Description list: Text valuesDescription list: Text values
Text values
Code
pz.container(ui.description_list({"Owner": "Ada", "Plan": "Pro", "Seats": 12}), width=320)
Description list: vertical=TrueDescription list: vertical=True
vertical=True
Code
pz.container(ui.description_list({"Email": "ada@example.com", "Phone": "+44 20 7946 0000"}, vertical=True), width=320)
Description list: mono_values=TrueDescription list: mono_values=True
mono_values=True
Code
pz.container(ui.description_list([("Commit", "26a7ccf"), ("Branch", "main")], mono_values=True, label_width=90), width=320)
Description list: dividers=FalseDescription list: dividers=False
dividers=False
Code
pz.container(ui.description_list({"Width": "1280", "Height": "720"}, dividers=False, label_width=90), width=280)

Description list 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.

description_list(
items,
*,
label_width=140,
vertical=False,
dividers=True,
mono_values=False,
selectable=True,
theme=None,
)

Name and value pairs, one per row: the details of a file, an order or a device. A value can be text or any widget.

Property Default Description
items required A dict or (name, value) pairs.
label_width 140 Width of the names column.
vertical False Puts each name above its value.
dividers True Lines between rows.
mono_values False Text values in the monospace font (ids, hashes).
selectable True Text values can be selected and copied.
theme None Theme to use instead of the current one (pyzed.theme.current()).

Full reference →