Label
Text that takes its color from the theme. color is a theme token ("text", "accent", "error"…) or a hex color, and size is a named step ("xs" to "2xl") or a number. ui.muted(...) is a label with the "text_muted" color, for secondary text.
ui.label · Category: Display · Full reference →


pz.column([ ui.label("Pyzed draws native UIs with Iced."), ui.muted("Secondary text uses the muted color."), ui.label("Accent and semibold", color="accent", weight="semibold"), ui.label("def mono(): ...", mono=True, size="sm"),], spacing=8)When to use
Section titled “When to use”- For any text in a themed UI: it follows theme changes, unlike a hard-coded
pz.text. - Use
ui.mutedfor descriptions, hints and metadata. - For titles use Heading.
import pyzed as pzfrom pyzed import ui
pz.column([ ui.label("Pyzed draws native UIs with Iced."), ui.muted("Secondary text uses the muted color."), ui.label("Accent and semibold", color="accent", weight="semibold"), ui.label("def mono(): ...", mono=True, size="sm"),], spacing=8)Variants
Section titled “Variants”Named sizes follow the theme’s font size; a number is a size in pixels.


size="xs"Code
ui.label("Extra small", size="xs")

size="sm"Code
ui.label("Small", size="sm")

size="md"Code
ui.label("Medium", size="md")

size="lg"Code
ui.label("Large", size="lg")

size="xl"Code
ui.label("Extra large", size="xl")

size="2xl"Code
ui.label("Huge", size="2xl")

color="text"Code
ui.label("Text")

ui.mutedCode
ui.muted("Muted text")

color="accent"Code
ui.label("Accent", color="accent")

color="success"Code
ui.label("Success", color="success")

color="warning"Code
ui.label("Warning", color="warning")

color="error"Code
ui.label("Error", color="error")

color="#c678dd"Code
ui.label("Any hex color", color="#c678dd")Weight and style
Section titled “Weight and style”

weight="normal"Code
ui.label("Normal", weight="normal", size="lg")

weight="medium"Code
ui.label("Medium", weight="medium", size="lg")

weight="semibold"Code
ui.label("Semibold", weight="semibold", size="lg")

weight="bold"Code
ui.label("Bold", weight="bold", size="lg")

italic=TrueCode
ui.label("Italic", italic=True, size="lg")

mono=TrueCode
ui.label("def mono(): ...", mono=True)Events
Section titled “Events”Label 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”ui.label
Section titled “ui.label”label( content, *, color='text', size='md', weight=None, mono=False, italic=False, wrap=True, theme=None, **kwargs,)Text with a theme color.
| Property | Default | Description |
|---|---|---|
content |
required | Content: a Widget, a string or a number (converted to text). |
color |
"text" |
Theme token or hex color. Defaults to "text". |
size |
"md" |
"xs" (11), "sm" (12), "md" (13.5), "lg" (16), "xl" (20), "2xl" (26) or a number. |
weight |
None |
Weight: "medium", "semibold", "bold"… |
mono |
False |
Uses the monospace font (IBM Plex Mono). |
italic |
False |
Italic. |
wrap |
True |
Line wrapping. |
theme |
None |
Theme to use instead of the current one (pyzed.theme.current()). |
**kwargs |
— | Passed to pyzed.text. |
ui.muted
Section titled “ui.muted”muted(content, **kwargs)A label with the "text_muted" color.
| Property | Default | Description |
|---|---|---|
content |
required | Content: a Widget, a string or a number (converted to text). |
**kwargs |
— | Same as label. |