Skip to content

Theming

Theming

Make the app yours. Pick a theme or create one, style any widget like CSS, and choose its icons and fonts, in code or in the designer.

Pyzed separates what your interface shows from how it looks. Every component reads its colors from the current theme, a set of named colors called tokens (background, text, border, accent…). Change the theme and the whole app follows; change one widget with style() and only that widget changes.

One app, six bundled themes: every component follows the theme, with no change to its code.
import pyzed as pz
from pyzed import ui
class Notes(pz.App):
theme = "Gruvbox Dark" # any name from pz.themes.names()
def view(self):
card = pz.Style(background="elevated", border=(1, "border"), radius=10, padding=16)
return pz.column([
ui.heading("Notes"),
pz.container(ui.label("Styled like CSS, colored by the theme.")).style(card),
])
flowchart LR
    T["Theme<br/>named colors (tokens)"] --> C["Components<br/>variants · tints · sizes"]
    C --> S["style()<br/>one widget, like CSS"]
    G["Global style<br/>App.style"] --> S
  • Theme: the palette of the whole app. Pick a bundled one, follow the system’s light or dark mode, or create your own from three colors.
  • Components take their colors from the theme. Their variants and tints (variant="outline", tint="error") choose which of those colors they use.
  • style() changes one widget, like CSS; named styles reuse a look; App.style sets the font and colors of the whole window.

The visual designer is a Pyzed app, so it has themes as well: pick one in Settings → Appearance → Theme and the whole editor changes at once. Each form keeps its own theme, set in its Look properties (see Styling forms), so the editor and the app you design can look different.

Pyzed Design changing its look as different themes are picked in Settings
Pyzed Design switching themes from Settings.
Pyzed Design in the Ayu theme with the sign-in form open