ThemeManager in Jetpack Compose: Inspired by Mantine

Dwiki Riyadi
3 min readDec 2, 2024
Photo by charlesdeluvio on Unsplash

Jetpack Compose has revolutionized how we build Android UIs by making it declarative and intuitive. One of the most powerful features of Compose is the ability to define and manage themes. In the previous article, we explored how to create a ThemeData system in Jetpack Compose to provide per-component theming and customizations.

Now, we’re taking it a step further by introducing a ThemeManager. Inspired by Mantine, a React-based UI framework, our ThemeManager will enable dynamic theme switching and centralized theme control in Compose apps.

A Quick Note About This Article

While the idea for this article is mine, I used AI assistance to refine the code and structure. This approach allowed me to focus on sharing the concept clearly while generating code snippets more efficiently. If you’re here for inspiration or a starting point for your project, feel free to build on the ideas shared below!

Why ThemeManager?

The ThemeData system we built earlier is great for defining component-specific themes. However, managing multiple themes and dynamically switching between them across an app requires an additional layer of abstraction.

Enter ThemeManager:

--

--

Dwiki Riyadi
Dwiki Riyadi

Written by Dwiki Riyadi

Mobile Developer | Kotlin | Flutter I enjoy learning new things

No responses yet