Baike.dev
All toolsTrendingOpen sourceNewsSubmit
Log in
< 返回工具列表
I

iced

> 编程语言
开源

A cross-platform GUI library for Rust, inspired by Elm

31.1K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

A cross-platform GUI library for Rust, inspired by Elm

Features

  • Simple, easy-to-use, batteries-included API
  • Type-safe, reactive programming model
  • Cross-platform support (Windows, macOS, Linux, and the Web)
  • Responsive layout
  • Built-in widgets (including text inputs, scrollables, and more!)
  • Custom widget support (create your own!)
  • Debug tooling with performance metrics and time traveling
  • First-class support for async actions (use futures!)
  • Modular ecosystem split into reusable parts:
    • A renderer-agnostic native runtime enabling integration with existing systems
    • Two built-in renderers leveraging wgpu and tiny-skia
      • iced_wgpu supporting Vulkan, Metal and DX12
      • iced_tiny_skia offering a software alternative as a fallback
    • A windowing shell

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:

…

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

核心特点

  • •Simple, easy-to-use, batteries-included API
  • •Type-safe, reactive programming model
  • •[Cross-platform support] (Windows, macOS, Linux, and the Web)
  • •Responsive layout
  • •Built-in widgets (including [text inputs], [scrollables], and more!)
  • •Custom widget support (create your own!)
  • •[Debug tooling with performance metrics and time traveling]
  • •First-class support for async actions (use futures!)
  • •Modular ecosystem split into reusable parts:
  • •A [renderer-agnostic native runtime] enabling integration with existing systems

> 标签

Rustelmgraphicsguiinterface

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月9日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言
Baike.dev

baike.dev helps you discover great languages, frameworks, databases, DevOps and cloud-native tools.

Quick links

  • Home
  • All tools
  • Trending
  • Open source

About

  • About us
  • Community
  • News

Contribute

Found a great developer tool? Share it with the community.

Submit a tool
© 2026 baike.dev Developer EncyclopediaUpdated daily · Discover great developer tools