linebender /druid

A data-first Rust-native UI design toolkit.

★ 9,694⑂ 563👁 96⑃ 1,605● 820▤ 4
RustApache-2.0Created 2018-11-01linebender.org/druid/
More from this author
Download: 0.8.30.8.3 ↓0.8.32023-02-28
-1
Daily
9,694
stars
563
forks
96
watchers
1,605
prs
820
issues
4
releases

README

!druid banner

 A data-first Rust-native UI toolkit.






Druid was an experimental Rust-native UI toolkit. Its main goal was to offer a
polished user experience. There were many factors to this goal, including
performance, a rich palette of interactions (hence a widget library to support
them), and playing well with the native platform.
See the goals section for more details.

We did periodic releases of Druid on crates.io. All changes were documented
in the changelog.

For an overview of some key concepts, see the incomplete [Druid book].

 Project status

UNMAINTAINED

The Druid project has been discontinued.

New development effort moved on to [Xilem], which has a lot of fundamental changes to allow for
a wider variety of applications with better performance, but it also heavily inherits from Druid.
We see [Xilem] as the future of Druid.

Druid is reasonably usable for some subset of applications
and has a significant testing history, which ensures some stability and correctness.
However, there will not be any new features or bug fixes coming to Druid. As such we don't recommend
using Druid for brand new applications. If you insist, then at least make sure your application
doesn't require a feature that Druid doesn't have, e.g. accessibility or 3D support.

 Contributions

As the Druid project has been discontinued, we will not be accepting any more contributions.

Please take a look at some of our other projects instead, especially the Druid successor [Xilem].

 Example

Here's a simple counter example app:

rust
use druid::widget::{Button, Flex, Label};
use druid::{AppLauncher, LocalizedString, PlatformError, Widget, WidgetExt, WindowDesc};

fn main() - Result {
    let main_window = WindowDesc::new(ui_builder());
    let data = 0_u32;
    AppLauncher::with_window(main_window)
        .log_to_console()
        .launch(data)
}

fn ui_builder() - impl Widget {
    // The label text will be computed dynamically based on the current locale and count
    let text =
        LocalizedString::new("hello-counter").with_arg("count", |data: &u32, _env| (data).into());
    let label = Label::new(text).padding(5.0).center();
    let button = Button::new("increment")
        .on_click(|_ctx, data, _env| data += 1)
        .padding(5.0);

    Flex::column().with_child(label).with_child(button)
}


Check out the [the examples folder] for a more comprehensive demonstration of
Druid's existing functionality and widgets. Check druid_widget_nursery for more widgets.

 Screenshots





 Using Druid

An explicit goal of Druid was to be easy to build.
Druid is available on [crates.io] and should work as a lone dependency
(it re-exports all the parts of druid-shell, piet, and kurbo that you'll need):

toml
druid = "0.8.3"


 Platform notes

 Linux

On Linux, Druid requires gtk+3; see [GTK installation page].
(On ubuntu-based distro, running sudo apt-get install libgtk-3-dev from the terminal will do the job.)

 OpenBSD

On OpenBSD, Druid requires gtk+3;  install 

Top issues

Latest release

0.8.3 v0.8.3 2023-02-28
This is a minor release that fixes an incompatibility issue with image and also adds a few new features. For more details check out the changelog.

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON