Azul - Desktop GUI framework for Rust
admin last edited by
Azul is a library for creating graphical user interfaces or GUIs in Rust. It mixes paradigms from functional, immediate mode GUI programming commonly found in games and game engines with an API suitable for developing desktop applications. Instead of focusing on an object-oriented approach to GUI programming ("a button is an object"), it focuses on combining objects by composition ("a button is a function") and achieves complex layouts by composing widgets into a larger DOM tree.
Azul separates the concerns of business logic / callbacks, data model and UI rendering / styling by not letting the UI / rendering logic have mutable access to the application data. Widgets of your user interface are seen as a "view" into your applications data, they are not "objects that manage their own state", like in so many other toolkits. Widgets are simply functions that render a certain state, more complex widgets combine buttons by calling a function multiple times.
The generated DOM itself is immutable and gets re-generated every frame. This makes testing and debugging very easy, since the UI is a pure function, mapping from a specific application state into a visual interface. For layouting, Azul features a custom CSS-like layout engine, which closely follows the CSS flexbox model.