Icon
pz.icon(name) draws one of the 1,500+ Lucide icons; color defaults to the surrounding text color. pz.svg(source) draws any SVG from a path or bytes, tinted with color if you want.
pz.icon · Category: Content · Full reference →


pz.row([ pz.icon("sparkles", size=28, color="#e5c07b"), pz.icon("git-branch", size=28, color="#a1c181"), pz.icon("folder-open", size=28, color="#74ade8"), pz.icon("bug", size=28, color="#d07277"), pz.icon("terminal", size=28, color="#c678dd"), pz.svg("logo.svg", width=40, height=40),], spacing=20, align="center")When to use
Section titled “When to use”- Inside buttons, list rows and headers. Run
pyzed iconsto search the names.
import pyzed as pz
pz.row([ pz.icon("sparkles", size=28, color="#e5c07b"), pz.icon("git-branch", size=28, color="#a1c181"), pz.icon("folder-open", size=28, color="#74ade8"), pz.icon("bug", size=28, color="#d07277"), pz.icon("terminal", size=28, color="#c678dd"), pz.svg("logo.svg", width=40, height=40),], spacing=20, align="center")Variants
Section titled “Variants”

size=12Code
pz.icon("sparkles", size=12)

size=16Code
pz.icon("sparkles", size=16)

size=24Code
pz.icon("sparkles", size=24)

size=40Code
pz.icon("sparkles", size=40)

color="#a1c181"Code
pz.icon("git-branch", size=24, color="#a1c181")

color="#d07277"Code
pz.icon("bug", size=24, color="#d07277")

color="#74ade8"Code
pz.icon("folder-open", size=24, color="#74ade8")color paints every visible pixel of the SVG in one color and keeps the transparent ones, like an icon tint. An SVG with a filled background, such as logo.svg, becomes a plain tile.


pz.svg("logo.svg")Code
pz.svg("logo.svg", width=48, height=48)

color="#e5c07b"Code
shapes = ('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">' '<circle cx="7" cy="7" r="5"/><rect x="12" y="12" width="10" height="10" rx="2"/></svg>')pz.svg(shapes, width=48, height=48, color="#e5c07b")Events
Section titled “Events”Icon 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.icon
Section titled “pz.icon”icon(name, *, size=16, color=None)A Lucide icon. color defaults to the surrounding text color.
| Property | Default | Description |
|---|---|---|
name |
required | Icon name (pyzed icons lists them). |
size |
16 |
Size in pixels. |
color |
None |
Color. |
pz.svg
Section titled “pz.svg”svg( source, *, width=None, height=None, color=None, content_fit=None, opacity=1.0, rotation=0.0,)An SVG image.
| Property | Default | Description |
|---|---|---|
source |
required | Path to an .svg, the SVG code as a string (starting with <) or bytes. |
width |
None |
Width: pixels, "fill", "shrink" or "fill:N" (proportion). |
height |
None |
Height: pixels, "fill", "shrink" or "fill:N" (proportion). |
color |
None |
If given, tints the whole SVG with that color (useful for monochrome icons). |
content_fit |
None |
"contain", "cover", "fill", "none" or "scale-down". |
opacity |
1.0 |
Opacity from 0 to 1. |
rotation |
0.0 |
Rotation in degrees. |
Related
Section titled “Related”Icon buttonA square button with just an icon and an optional tooltip.
ImageBitmaps with fit, opacity, radius; a pan-and-zoom viewer.