Skip to content

Divider

A one-pixel line in the theme’s border color, horizontal by default (vertical=True for a vertical one). pz.rule is the base version with your own color and thickness.

ui.divider · Category: Display · Full reference →

DividerDivider
  • To separate groups in a column or items in a toolbar.
  • Prefer spacing first; add a divider when groups really need a visual break.
import pyzed as pz
from pyzed import ui
pz.column([
ui.label("Account"),
ui.divider(),
pz.row([ui.label("Edit"), ui.divider(vertical=True), ui.label("View"),
ui.divider(vertical=True), ui.label("Help")], spacing=12, height=20),
ui.divider(),
ui.muted("Sign out"),
], spacing=10, width=300)
Divider: HorizontalDivider: Horizontal
Horizontal
Code
pz.column([ui.label("Account"), ui.divider(), ui.label("Sign out")], spacing=8, width=220)
Divider: vertical=TrueDivider: vertical=True
vertical=True
Code
pz.row([ui.label("Edit"), ui.divider(vertical=True), ui.label("View")], spacing=10, height=18)
Divider: color="accent"Divider: color="accent"
color="accent"
Code
pz.container(ui.divider(color="accent"), width=220)
Divider: pz.rule(thickness=3)Divider: pz.rule(thickness=3)
pz.rule(thickness=3)
Code
pz.container(pz.rule(color="#e5c07b", thickness=3), width=220)
Divider: label="or"Divider: label="or"
label="or"
Code
pz.container(ui.divider(label="or"), width=300)
Divider: spacing=12Divider: spacing=12
spacing=12
Code
pz.column([ui.label("Above"), ui.divider(spacing=12), ui.label("Below")], width=300)

Divider 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.

divider(*, vertical=False, color=None, label=None, spacing=0, theme=None)

A divider line in the theme color.

Property Default Description
vertical False Vertical instead of horizontal.
color None Text or icon color.
label None Muted text in the middle of a horizontal line ("or", a date…).
spacing 0 Space on both sides of the line.
theme None Theme to use instead of the current one (pyzed.theme.current()).

Full reference →

rule(*, vertical=False, thickness=1.0, color=None)

A horizontal (or vertical) divider line.

Property Default Description
vertical False Vertical line instead of horizontal.
thickness 1.0 Thickness in pixels.
color None Text or icon color.

Full reference →