iced-mobile/examples
Olivier 'reivilibre' 343e6332d7 Format code 2021-06-26 20:19:55 +01:00
..
bezier_tool Implement event capturing for `Canvas` 2020-11-12 01:24:59 +01:00
clock Add `clipboard` argument to `Application::update` 2021-03-11 03:38:20 +01:00
color_palette Require `Clone` for `Message` early when needed 2020-10-17 08:10:30 +02:00
counter Make `Application` and `Sandbox` return a `Result` 2020-09-08 00:44:59 +02:00
custom_widget Use `f32` for `border_width` and `border_radius` 2020-11-23 00:31:50 +01:00
download_progress Add `clipboard` argument to `Application::update` 2021-03-11 03:38:20 +01:00
events Showcase graceful exiting in `events` example 2021-03-30 21:45:49 +02:00
game_of_life Add `clipboard` argument to `Application::update` 2021-03-11 03:38:20 +01:00
geometry Introduce `viewport` to `Widget::draw` 2020-10-28 06:21:07 +01:00
integration Upgrade wgpu 2021-04-11 18:55:57 -07:00
pane_grid Example: Add Pin button to prevent closing a pane 2021-05-24 15:53:20 -05:00
pick_list Make `Application` and `Sandbox` return a `Result` 2020-09-08 00:44:59 +02:00
pokedex Run cargo fmt 2021-04-12 23:23:47 -07:00
progress_bar Make `Application` and `Sandbox` return a `Result` 2020-09-08 00:44:59 +02:00
qr_code Implement `qr_code` example 2020-11-20 10:29:40 +01:00
scrollable Add scrolling progress indicators to `scrollable` example 2021-06-04 20:46:47 +07:00
solar_system Add `clipboard` argument to `Application::update` 2021-03-11 03:38:20 +01:00
stopwatch Add `clipboard` argument to `Application::update` 2021-03-11 03:38:20 +01:00
styling Add `Toggler` to styling example 2021-06-03 20:21:55 +07:00
svg Make `Application` and `Sandbox` return a `Result` 2020-09-08 00:44:59 +02:00
todos Add `clipboard` argument to `Application::update` 2021-03-11 03:38:20 +01:00
tooltip Hide `Text` as an implementation detail of `Tooltip` 2021-02-24 00:59:29 +01:00
tour Add some horizontal padding to `toggler` section in `tour` example 2021-06-03 20:35:26 +07:00
tour_glow Format code 2021-06-26 20:19:55 +01:00
url_handler Use new enum variant and new winit repo 2021-06-25 14:14:03 +02:00
README.md Mention birth year in `README`s 2020-12-17 05:26:28 +01:00

README.md

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!

Game of Life

An interactive version of the Game of Life, invented by John Horton Conway.

It runs a simulation in a background thread while allowing interaction with a Canvas that displays an infinite grid with zooming, panning, and drawing support.

The relevant code is located in the main file.

You can run it with cargo run:

cargo run --package game_of_life

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 Bézier curves using the Canvas widget.
  • clock, an application that uses the Canvas widget to draw a clock and its hands to display the current time.
  • color_palette, a color palette generator based on a user-defined root color.
  • counter, the classic counter example explained in the README.
  • custom_widget, a demonstration of how to build a custom widget that draws a circle.
  • download_progress, a basic application that asynchronously downloads a dummy file of 100 MB and tracks the download progress.
  • events, a log of native events displayed using a conditional Subscription.
  • geometry, a custom widget showcasing how to draw geometry with the Mesh2D primitive in iced_wgpu.
  • integration, a demonstration of how to integrate Iced in an existing graphical application.
  • pane_grid, a grid of panes that can be split, resized, and reorganized.
  • pick_list, a dropdown list of selectable options.
  • pokedex, an application that displays a random Pokédex entry (sprite included!) by using the PokéAPI.
  • progress_bar, a simple progress bar that can be filled by using a slider.
  • scrollable, a showcase of the various scrollbar width options.
  • solar_system, an animated solar system drawn using the Canvas widget and showcasing how to compose different transforms.
  • 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 the Svg widget.

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 2019, it has been powering the user interfaces in Coffee, an experimental 2D game engine.