Skip to content

Settings group

A titled block of ui.field rows separated by lines, with an optional description, like a settings screen.

ui.settings_group · Category: Data · Full reference →

Settings groupSettings group
  • To organize a preferences screen into sections (Editor, Files, Git…).
import pyzed as pz
from pyzed import ui
pz.container(ui.settings_group("Editor", [
ui.field("Font size", ui.number_field(14, on_change, suffix="px")),
ui.field("Soft wrap", ui.switch(True, on_toggle)),
ui.field("Theme", ui.select(["One Dark", "One Light"], "One Dark", on_select, width=150)),
], description="Editor preferences."), width=460)
Settings group: Without descriptionSettings group: Without description
Without description
Code
pz.container(ui.settings_group("Files", [
ui.field("Autosave", ui.switch(True, on_toggle)),
ui.field("Trim whitespace", ui.checkbox(False, on_toggle)),
]), width=380)
Settings group: description=Settings group: description=
description=
Code
pz.container(ui.settings_group("Git", [
ui.field("Inline blame", ui.switch(False, on_toggle)),
], description="Shown in the editor gutter."), width=380)
Settings group: end=Settings group: end=
end=
Code
pz.container(ui.settings_group("Editor", [ui.field("Wrap lines", ui.switch(True, on_toggle))],
end=ui.button("Reset", on_press, size="sm", variant="ghost")), width=420)

Settings group 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.

settings_group(title, rows, *, description=None, end=None, theme=None)

A titled block of ui.field rows separated by lines, like a settings screen.

Property Default Description
title required Group title.
rows required The rows (usually ui.field).
description None Secondary text.
end None Widget at the right of the title (a Reset button…).
theme None Theme to use instead of the current one (pyzed.theme.current()).

Full reference →