iced/examples
Bingus d53ccc857d
refactored window storage;
new helper window events (Destroyed, Created);
clippy + fmt;
2023-07-21 13:53:38 -07:00
..
arc Implement basic cursor availability 2023-06-08 20:11:59 +02:00
bezier_tool Take Rectangle by value in Cursor API 2023-06-08 20:16:46 +02:00
checkbox Use as_slice instead of as_ref in checkbox example 2023-05-25 23:48:42 +02:00
clock Implement basic cursor availability 2023-06-08 20:11:59 +02:00
color_palette Implement basic cursor availability 2023-06-08 20:11:59 +02:00
component Merge branch 'master' into advanced-text 2023-04-17 23:41:12 +02:00
counter Use ToString for Text::new instead of Into<String> 2022-07-27 06:56:09 +02:00
custom_quad Implement basic cursor availability 2023-06-08 20:11:59 +02:00
custom_widget Implement basic cursor availability 2023-06-08 20:11:59 +02:00
download_progress Merge branch 'master' into advanced-text 2023-04-17 23:41:12 +02:00
events refactored window storage; 2023-07-21 13:53:38 -07:00
exit refactored window storage; 2023-07-21 13:53:38 -07:00
game_of_life Take Rectangle by value in Cursor API 2023-06-08 20:16:46 +02:00
geometry Decouple Mesh primitives from main Primitive type 2023-06-29 07:48:03 +02:00
integration refactored window storage; 2023-07-21 13:53:38 -07:00
lazy Merge branch 'master' into advanced-text 2023-04-17 23:41:12 +02:00
loading_spinners refactored window storage; 2023-07-21 13:53:38 -07:00
modal Add nested picklist to modal example 2023-06-14 09:27:28 +02:00
multi_window refactored window storage; 2023-07-21 13:53:38 -07:00
multitouch Implement basic cursor availability 2023-06-08 20:11:59 +02:00
pane_grid Introduce drop helper to pane_grid::State 2023-07-06 07:57:24 +02:00
pick_list Fix clippy lints for Rust 1.68 2023-03-14 11:11:17 +01:00
pokedex image: Allow any kind of data that implements AsRef<[u8]> for the image data 2023-02-17 14:23:13 +01:00
progress_bar Replace stateful widgets with new iced_pure API 2022-07-27 06:49:20 +02:00
qr_code Rename on_change to on_input for TextInput 2023-04-12 04:19:45 +02:00
screenshot refactored window storage; 2023-07-21 13:53:38 -07:00
scrollable Add scrollable alignment option 2023-07-04 10:43:12 -07:00
sierpinski_triangle Take Rectangle by value in Cursor API 2023-06-08 20:16:46 +02:00
slider Use f32 in Length::Units and rename it to Fixed 2023-02-17 15:40:17 +01:00
solar_system Implement basic cursor availability 2023-06-08 20:11:59 +02:00
stopwatch Use f32 in Length::Units and rename it to Fixed 2023-02-17 15:40:17 +01:00
styling Center Submit button vertically in styling example 2023-06-21 18:07:26 +02:00
svg Showcase color filtering in existing svg example 2022-12-06 04:36:00 +01:00
system_information Fix: Clippy lint 'uninlined_format_args' 2023-01-27 14:02:48 -07:00
toast refactored window storage; 2023-07-21 13:53:38 -07:00
todos refactored window storage; 2023-07-21 13:53:38 -07:00
tooltip Replace stateful widgets with new iced_pure API 2022-07-27 06:49:20 +02:00
tour Keep tour buttons solid 2023-05-19 03:48:25 +02:00
url_handler Create iced_widget subcrate and re-organize the whole codebase 2023-03-04 05:37:11 +01:00
websocket Merge branch 'master' into advanced-text 2023-04-17 23:41:12 +02:00
README.md Remove OpenGL mentions in READMEs 2023-05-11 16:05:36 +02:00

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

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

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 wgpu 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 various scrollable content configurations.
  • sierpinski_triangle, a sierpiński triangle Emulator, use Canvas and Slider.
  • 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.