4.5 KiB
Examples
Iced moves fast and the master branch can contain breaking changes! If
you want to learn about a specific release, check out the release list.
Tour
A simple UI tour that can run both on native platforms and the web! It showcases different widgets that can be built using Iced.
The main file contains all the code of the example! All the cross-platform GUI is defined in terms of state, messages, update logic and view logic.
You can run the native version with cargo run:
cargo run --package tour
The web version can be run by following the usage instructions of iced_web or by accessing iced.rs!
Todos
A todos tracker inspired by TodoMVC. It showcases dynamic layout, text input, checkboxes, scrollables, icons, and async actions! It automatically saves your tasks in the background, even if you did not finish typing them.
The example code is located in the main file.
You can run the native version with cargo run:
cargo run --package todos
We have not yet implemented a LocalStorage version of the auto-save feature. Therefore, it does not work on web yet!
Pokédex
An application that helps you learn about Pokémon! It performs an asynchronous HTTP request to the PokéAPI in order to load and display a random Pokédex entry (sprite included!).
The example code can be found in the main file.
You can run it on native platforms with cargo run:
cargo run --package pokedex
Styling
An example showcasing custom styling with a light and dark theme.
The example code is located in the main file.
You can run it with cargo run:
cargo run --package styling
Extras
A bunch of simpler examples exist:
bezier_tool, a Paint-like tool for drawing Bezier curves usinglyon.counter, the classic counter example explained in theREADME.custom_widget, a demonstration of how to build a custom widget that draws a circle.events, a log of native events displayed using a conditionalSubscription.geometry, a custom widget showcasing how to draw geometry with theMesh2Dprimitive iniced_wgpu.progress_bar, a simple progress bar that can be filled by using a slider.stopwatch, a watch with start/stop and reset buttons showcasing how to listen to time.svg, an application that renders the Ghostscript Tiger by leveraging theSvgwidget.
All of them are packaged in their own crate and, therefore, can be run using cargo:
cargo run --package <example>
Coffee
Since Iced was born in May, it has been powering the user interfaces in Coffee, an experimental 2D game engine.