A cross-platform GUI library for Rust, inspired by Elm
  • Rust 99.2%
  • WGSL 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-16 15:56:42 +01:00
.cargo Update wayland-scanner dependency 2026-07-23 18:58:34 +08:00
.github Disable web_sys_unstable_apis in check workflow 2026-10-03 15:53:23 +02:00
beacon Rename palette::Extended to Palette 2026-03-11 21:02:57 +01:00
benches Update wgpu to 0.30 2026-10-03 15:26:16 +02:00
core Remove superfluous Renderer: core::Renderer bounds 2026-10-07 11:33:26 +02:00
debug Limit debug message length with a custom Write impl 2026-11-16 15:02:35 +01:00
devtools Rename map and boxed in core::Widget trait 2026-09-28 23:07:15 +02:00
docs Rename iced_sentinel to iced_beacon and refactor its API 2024-05-10 20:08:09 +02:00
examples Merge branch 'master' into popover-widget 2026-11-01 00:36:37 +01:00
futures implement Default for Subscription 2026-09-06 21:08:47 +01:00
graphics Fix text selection while scrolling 2026-11-16 15:56:42 +01:00
highlighter Move Code enum to root of core crate 2026-09-04 05:22:13 +02:00
program Draft generic column widget 2026-09-27 20:43:34 +02:00
renderer Draft FrameClock for frame time quantization 2026-10-18 00:09:33 +02:00
runtime Fix text selection while scrolling 2026-11-16 15:56:42 +01:00
selector Draft text selection support for text and rich_text 2026-09-30 15:16:36 +02:00
src Migrate font and fonts methods in Daemon 2026-11-13 13:16:37 +01:00
test Port tester and devtools to impl Widget 2026-09-28 14:37:40 +02:00
tester Remove superfluous Renderer: core::Renderer bounds 2026-10-07 11:33:26 +02:00
tiny_skia Draft FrameClock for frame time quantization 2026-10-18 00:09:33 +02:00
wgpu Revert desired_maximum_frame_latency back to 1 2026-11-01 00:17:02 +01:00
widget Fix diff logic in popover 2026-11-13 12:16:18 +01:00
winit Round up when quantizing the frame clock 2026-11-11 05:11:50 +01:00
.gitignore Track Cargo.lock for reproducible builds and tests 2024-12-17 03:09:52 +01:00
Cargo.lock Merge pull request #3544 from iced-rs/popover-widget 2026-11-12 13:23:06 +01:00
Cargo.toml Merge branch 'master' into popover-widget 2026-11-01 00:36:37 +01:00
CHANGELOG.md Link unreleased changes in the changelog to the compare view 2026-09-13 15:09:29 +02:00
clippy.toml Increase threshold of enum-variant-names lint 2023-09-07 07:50:59 +02:00
CONTRIBUTING.md Replace Discourse with Zulip 2026-02-11 20:30:07 +01:00
Cross.toml Rely on GHCR instead of Docker Hub in Cross.toml 2022-01-26 21:22:54 +07:00
DEPENDENCIES.md clean up devShell templates 2025-11-21 02:30:38 +01:00
LICENSE Add LICENSE 2019-08-01 15:43:19 +02:00
README.md Update overview example in README 2026-09-29 18:21:33 +02:00
ROADMAP.md Remove broken links to ECOSYSTEM.md 2024-09-21 21:20:20 +02:00

Iced

Documentation Crates.io License Downloads Test Status Zulip Chat Discord Server

A cross-platform GUI library for Rust focused on simplicity and type-safety. Inspired by Elm.

Features

Iced is currently experimental software. Take a look at the roadmap and check out the issues.

Overview

Inspired by The Elm Architecture, Iced expects you to split user interfaces into four different concepts:

  • State — the state of your application
  • Messages — user interactions or meaningful events that you care about
  • View logic — a way to display your state as widgets that may produce messages on user interaction
  • Update logic — a way to react to messages and update your state

We can build something to see how this works! Let's say we want a simple counter that can be incremented and decremented using two buttons.

We start by modelling the state of our application:

#[derive(Default)]
struct Counter {
    value: i32,
}

Next, we need to define the possible user interactions of our counter: the button presses. These interactions are our messages:

#[derive(Debug, Clone, Copy)]
pub enum Message {
    Increment,
    Decrement,
}

Now, let's show the actual counter by putting it all together in our view logic:

use iced::widget::{button, column, text, Widget};

impl Counter {
    pub fn view(&self) -> impl Widget<Message> {
        // We use a column: a simple vertical layout
        column![
            // The increment button. We tell it to produce an
            // `Increment` message when pressed
            button("+").on_press(Message::Increment),

            // We show the value of the counter here
            text(self.value).size(50),

            // The decrement button. We tell it to produce a
            // `Decrement` message when pressed
            button("-").on_press(Message::Decrement),
        ]
    }
}

Finally, we need to be able to react to any produced messages and change our state accordingly in our update logic:

impl Counter {
    // ...

    pub fn update(&mut self, message: Message) {
        match message {
            Message::Increment => {
                self.value += 1;
            }
            Message::Decrement => {
                self.value -= 1;
            }
        }
    }
}

And that's everything! We just wrote a whole user interface. Let's run it:

fn main() -> iced::Result {
    iced::run(Counter::update, Counter::view)
}

Iced will automatically:

  1. Take the result of our view logic and layout its widgets.
  2. Process events from our system and produce messages for our update logic.
  3. Draw the resulting user interface.

Read the book, the documentation, and the examples to learn more!

Implementation details

Iced was originally born as an attempt at bringing the simplicity of Elm and The Elm Architecture into Coffee, a 2D game library I am working on.

The core of the library was implemented during May 2019 in this pull request. The first alpha version was eventually released as a renderer-agnostic GUI library. The library did not provide a renderer and implemented the current tour example on top of ggez, a game library.

Since then, the focus has shifted towards providing a batteries-included, end-user-oriented GUI library, while keeping the ecosystem modular.

Contributing / Feedback

If you want to contribute, please read our contributing guidelines for more details.

Feedback is also welcome! You can create a new topic in our Zulip forum or come chat to our Discord server.

Sponsors

The development of Iced is sponsored by the Cryptowatch team at Kraken.com