iced

Iced Docs

Source-verified docs generated from /src/content.

Reference

Enum - Theme

Enum reference for iced::Theme.

Version: latest | Last updated: 2026-02-19

Enum - Theme

Authoritative source: ref/doc/iced/enum.Theme.html.

# Rustdoc summary

A built-in theme.

# Verified declaration

rust
pub enum Theme {
Show 23 variants    Light,
    Dark,
    Dracula,
    Nord,
    SolarizedLight,
    SolarizedDark,
    GruvboxLight,
    GruvboxDark,
    CatppuccinLatte,
    CatppuccinFrappe,
    CatppuccinMacchiato,
    CatppuccinMocha,
    TokyoNight,
    TokyoNightStorm,
    TokyoNightLight,
    KanagawaWave,
    KanagawaDragon,
    KanagawaLotus,
    Moonfly,
    Nightfly,
    Oxocarbon,
    Ferra,
    Custom(Arc<Custom>),
}

# When to use

Use this enum when modeling or configuring the set of discrete variants represented by iced::....

# Why to use

It provides explicit, typed variant semantics that match runtime and widget APIs documented in rustdoc.

# Example References

  • ref/examples/clock/src/main.rs
  • ref/examples/sierpinski_triangle/src/main.rs
  • ref/examples/table/src/main.rs
  • ref/examples/editor/src/main.rs
  • ref/examples/styling/src/main.rs
  • ref/examples/arc/src/main.rs

# Use this when...

  • You need a typed set of variants for layout/style/runtime behavior.
  • You want pattern matching instead of ad-hoc booleans.
  • You are configuring widget behavior with explicit choices.

# Minimal example

rust
// Choose an enum variant and pass it into widget/runtime configuration.

# How it works

Enums model constrained strategy choices in Iced APIs. They keep configuration readable and make invalid combinations easier to catch at compile time.

# Common patterns

rust
// Use match expressions for app-driven variant selection.

# Gotchas / tips

  • Similar variant names may have different effects across APIs.
  • Keep variant selection close to widget config for clarity.
  • Confirm semantics in rustdoc for edge cases.