Declarative UI: The Future of Modern UI Design

Alparslan Selçuk Develioğlu
Become Better
Published in
5 min readMay 15, 2024

--

If you don’t have a Medium Partner account, you can read the article here.

Photo by Author

Here’s the first part of my article about SwiftUI and Jetpack Compose, where I talk about their features and differences.

Declarative UI is a programming paradigm that defines the desired end state of the user interface without detailing the control flow. In simpler terms, this approach allows developers to specify what the UI should look like, and a framework takes care of creating and managing transitions. This makes coding more intuitive and requires less code.

When we think of Declarative UI, React and Flutter usually come to mind. Here’s an image used in a presentation at Google I/O:

Image created for presentation in Google I/O Extended 2019, by Na Yoon Ho

Let’s briefly compare Declarative UI with the classic Imperative UI:

  • Both paradigms are used to create UIs, but they have significant differences.
  • In Declarative UI, you simply describe what an object should look like. For example, you specify that you want a button, but you don’t need to detail its exact position (x, y). The framework handles the creation of objects and the process.

--

--

Alparslan Selçuk Develioğlu
Become Better

8+ years experienced Android Dev. Colorful, confident personality, a fan of science fiction and fantasy works. An Ultratrail runner who runs in races 60+ kms