About this project
Druid was an experimental Rust-native UI toolkit developed by Linebender, designed with a data-first approach to building polished desktop applications. The project aimed to provide a smooth user experience across all common platforms, emphasizing performance, rich interactions, and native platform integration.
The toolkit is now officially discontinued and unmaintained. New development effort has moved to Xilem, which inherits heavily from Druid but introduces fundamental changes for better performance and broader application support. While Druid remains reasonably usable for some applications and has a significant testing history, no new features or bug fixes are planned.
Key architectural components include:
- druid-shell: A platform-abstracting application shell responsible for starting native platform runloops, listening to events, and converting them into platform-agnostic representations.
- Piet: A 2D graphics abstraction library with multiple backends (Direct2D for Windows, CoreGraphics for macOS, Cairo for Linux, and Web for web targets) used for drawing and text layout.
- Widget system: Widgets implement the Widget trait parametrized by a data type, with methods for event handling, lifecycle management, updates, layout, and painting. Each method receives a corresponding context object and an environment containing theme parameters.
- Layout: Inspired by Flutter's box layout model, widgets receive BoxConstraints providing minimum and maximum sizes.
- Data trait: Represents value types that are cheap to compare and clone, typically derived for application state structures.
- Lens: Provides access to parts of larger data structures, enabling widgets to work with specific fields of application state.
Druid was available on crates.io and supported macOS, Linux (requiring GTK+3), Windows, and OpenBSD. The project provided basic utility and layout widgets, with the ability to compose custom widgets. The toolkit aimed for easy building and packaging, platform convention respect, reliable display scaling, internationalization support, accessibility, small and fast binaries, and a small dependency tree.
Non-goals included using platform-native widgets, embedding into custom render pipelines, adhering to specific architectural styles like Elm, and supporting HTML rendering for web targets. Alternatives for these use cases included Relm, Slint, Conrod, Iced, and Moxie.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.