Monal Gupta
Blogs

2015 · 3 min read

Pure UI

On describing user interfaces as a pure function of application state, and what that unlocks for design and engineering collaboration.

I want to describe a design and implementation approach in which the user interface is a pure function of application state. It’s a simple idea, but it has deep implications for how teams build software together.

The moment a view can be derived entirely from state, the entire class of bugs that comes from partial DOM mutation disappears. You no longer patch the screen; you declare it.

This is also a collaboration primitive. Designers can enumerate states — loading, empty, error, populated — and engineers can render each of them in isolation, without walking through a flow to reproduce them.

The end state is a shared vocabulary: a finite list of states, each with an agreed visual treatment, and a single function that maps between them.