Effects
Visual effects are style properties: glow (a soft halo), bloom (a wide, bright spill of light), glass (a translucent, frosted panel), opacity, and translate and scale, which move or scale the drawing without changing the layout. Animations can change glow too.
pz.Style · Category: Content · Full reference →


pz.container(pz.row([ pz.container(ui.label("Glass"), width=150, height=70, padding=14).style(glass=True, radius=12), pz.container(ui.label("Glow"), width=150, height=70, padding=14).style( background="#0b1220", radius=12, glow=("#22d3ee", 18)), pz.container(ui.label("Bloom"), width=150, height=70, padding=14).style( background="#1a0b16", radius=12, bloom=("#f472b6", 0.8)), pz.container(ui.label("Opacity"), width=150, height=70, padding=14).style( background="#0b1220", radius=12, opacity=0.5),], spacing=24), padding=32).style( background=pz.Gradient(["#0f172a", "#312e81", "#0e7490"], angle=90), radius=14)When to use
Section titled “When to use”- To highlight the primary action or a live state (recording, connected).
- For floating panels over colorful backgrounds (glass).
import pyzed as pzfrom pyzed import ui
pz.container(pz.row([ pz.container(ui.label("Glass"), width=150, height=70, padding=14).style(glass=True, radius=12), pz.container(ui.label("Glow"), width=150, height=70, padding=14).style( background="#0b1220", radius=12, glow=("#22d3ee", 18)), pz.container(ui.label("Bloom"), width=150, height=70, padding=14).style( background="#1a0b16", radius=12, bloom=("#f472b6", 0.8)), pz.container(ui.label("Opacity"), width=150, height=70, padding=14).style( background="#0b1220", radius=12, opacity=0.5),], spacing=24), padding=32).style( background=pz.Gradient(["#0f172a", "#312e81", "#0e7490"], angle=90), radius=14)Variants
Section titled “Variants”Effects
Section titled “Effects”

glass=TrueCode
pz.container(pz.container(ui.label("Glass"), width=130, height=60, padding=12).style(glass=True, radius=12), padding=24).style(background=pz.Gradient(["#0f172a", "#312e81", "#0e7490"], angle=90), radius=12)

glow=Code
pz.container(pz.container(ui.label("Glow"), width=130, height=60, padding=12).style(background="#0b1220", radius=12, glow=("#22d3ee", 18)), padding=24).style(background=pz.Gradient(["#0f172a", "#312e81", "#0e7490"], angle=90), radius=12)

bloom=Code
pz.container(pz.container(ui.label("Bloom"), width=130, height=60, padding=12).style(background="#1a0b16", radius=12, bloom=("#f472b6", 0.8)), padding=24).style(background=pz.Gradient(["#0f172a", "#312e81", "#0e7490"], angle=90), radius=12)

opacity=0.5Code
pz.container(pz.container(ui.label("Opacity"), width=130, height=60, padding=12).style(background="#0b1220", radius=12, opacity=0.5), padding=24).style(background=pz.Gradient(["#0f172a", "#312e81", "#0e7490"], angle=90), radius=12)

scale=1.15Code
pz.container(pz.container(ui.label("Scale"), width=130, height=60, padding=12).style(background="#0b1220", radius=12, scale=1.15), padding=24).style(background=pz.Gradient(["#0f172a", "#312e81", "#0e7490"], angle=90), radius=12)

translate=Code
pz.container(pz.container(ui.label("Translate"), width=130, height=60, padding=12).style(background="#0b1220", radius=12, translate=(16, 8)), padding=24).style(background=pz.Gradient(["#0f172a", "#312e81", "#0e7490"], angle=90), radius=12)Events
Section titled “Events”Effects 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.
Properties and API
Section titled “Properties and API”pz.Style
Section titled “pz.Style”class StyleA reusable set of style properties for widget.style(...), a component’s style= or App.style. Combine styles with | (the right one wins). See Styles.
| Property | Default | Description |
|---|---|---|
*styles |
— | Styles, dicts or style names to start from. |
**props |
— | Properties: background, color, font, weight, italic, size, line_height, border_color, border_width, border ((width, color)), radius, shadow, padding, margin, width, height, max_width, max_height, min_width, min_height, align_x, align_y, clip. Effects: opacity, translate ((x, y), pixels or "50%"), scale, glow (a color, a size or (color, size)), bloom (a color or (color, intensity)) and glass (True, a tint or {"tint", "strength"}). States: hover, pressed (or active) and focus, each with the properties to show then. transition: milliseconds, True or {"duration", "easing", "delay"}. media: {query: style} applied when the window matches. Colors may be theme tokens. |