A cross-platform GUI library for Rust, inspired by Elm https://iced.rs
  • Rust 99.2%
  • WGSL 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
SakulFlee be3a5b003b
Some checks failed
Check / check (push) Failing after 2m40s
Migrate beacon to the bincode 2 API
bincode 2 replaces the free functions `serialize`/`deserialize` with
`serde::encode_to_vec`/`serde::decode_from_slice`, which take an explicit
`Config`, and its `ErrorKind` is gone.

Encode and decode with `config::legacy()`, which is the configuration
bincode 1.x used by default, so messages keep the exact same wire format.
Verified by encoding the message types of the protocol with both versions
and comparing the bytes.

`DecodeError` does not implement `std::error::Error`, so it cannot be
converted with `thiserror`'s `#[from]`; the conversion is implemented by
hand instead.

Decoding now reads exactly `size` bytes instead of the whole receive
buffer. The buffer is reused across messages and only ever grows, and
`decode_from_slice` ignores trailing bytes, so it needs the explicit slice.
2026-09-30 05:36:55 +02:00
.cargo Update wayland-scanner dependency 2026-07-23 18:58:34 +08:00
.forgejo/workflows ci: add cargo check workflow (shadows upstream .github workflows) 2026-09-24 20:50:44 +02:00
.github Fix new clippy lints for Rust 1.98 2026-08-27 14:27:15 +02:00
beacon Migrate beacon to the bincode 2 API 2026-09-30 05:36:55 +02:00
benches feat: upgrade to wgpu v30 2026-09-13 20:49:03 +02:00
core feat: upgrade to wgpu v30 2026-09-13 20:49:03 +02:00
debug Reduce the size of the app frames in backtraces 2026-09-06 18:19:06 +02:00
devtools Update comet revision 2026-09-13 03:03:28 +02:00
docs Rename iced_sentinel to iced_beacon and refactor its API 2024-05-10 20:08:09 +02:00
examples feat: upgrade to wgpu v30 2026-09-13 20:49:03 +02:00
futures implement Default for Subscription 2026-09-06 21:08:47 +01:00
graphics Remove leftover comment in text::Paragraph 2026-09-12 18:25:15 +02:00
highlighter Move Code enum to root of core crate 2026-09-04 05:22:13 +02:00
program Merge pull request #3453 from iced-rs/reduce-backtrace-frames 2026-09-06 21:35:59 +02:00
renderer Drop the Font generic in favor of the concrete Font type 2026-09-06 03:54:06 +02:00
runtime Simplify overlay element wrapping 2026-09-10 18:03:26 +02:00
selector Unify text editing logic under core::text::editor 2026-07-26 18:37:55 +08:00
src Merge pull request #3454 from iced-rs/add-line-height-setting 2026-09-07 03:11:27 +02:00
test fix: hex encode SHA-256 digest for sha2 0.11 2026-09-30 05:19:25 +02:00
tester Simplify overlay element wrapping 2026-09-10 18:03:26 +02:00
tests Move component test to the widget crate 2026-09-10 18:16:46 +02:00
tiny_skia Drop the Font generic in favor of the concrete Font type 2026-09-06 03:54:06 +02:00
wgpu Clippy fix: remove redundant ::default() 2026-09-20 22:23:23 +02:00
widget Fix incorrect commits in markdown::code::Parser 2026-09-13 00:42:45 +02:00
winit fix: gate modifier_supplement out on iOS 2026-09-24 18:23:56 +02:00
.gitignore Track Cargo.lock for reproducible builds and tests 2024-12-17 03:09:52 +01:00
Cargo.lock feat: upgrade to wgpu v30 2026-09-13 20:49:03 +02:00
Cargo.toml chore: remove workspace section, merge into Orbital root workspace 2026-09-16 01:00:51 +02:00
CHANGELOG.md Schedule 0.14 release date 2025-12-07 20:02:39 +01: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
FORK.md docs: add FORK.md explaining why we forked and how to un-fork 2026-09-24 22:36:13 +02:00
LICENSE Add LICENSE 2019-08-01 15:43:19 +02:00
README.md Fix missing lifetime in README 2026-03-11 19:09:06 +01:00
renovate.json Add renovate.json 2026-09-29 03:04:37 +00: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, Column};

impl Counter {
    pub fn view(&self) -> Column<'_, 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