iced/examples
2023-04-13 06:03:44 +02:00
..
arc Derive Copy for Theme 2022-11-03 03:23:36 +01:00
bezier_tool Replace stateful widgets with new iced_pure API 2022-07-27 06:49:20 +02:00
checkbox Use correct package name in checkbox example docs 2023-03-08 12:55:52 -05:00
clock Run cargo fmt 2022-11-03 04:35:16 +01:00
color_palette Use f32 in Length::Units and rename it to Fixed 2023-02-17 15:40:17 +01:00
component Rename on_change to on_input for TextInput 2023-04-12 04:19:45 +02:00
counter Use ToString for Text::new instead of Into<String> 2022-07-27 06:56:09 +02:00
custom_quad Ask clippy to behave 2022-12-02 19:13:04 +01:00
custom_widget non uniform border radius for quads 2022-11-03 22:48:26 +01:00
download_progress Implement subscription::channel and simplify unfold 2023-04-11 07:46:54 +02:00
events Use f32 in Length::Units and rename it to Fixed 2023-02-17 15:40:17 +01:00
exit Draft Shell:request_redraw API 2023-01-12 02:59:08 +01:00
game_of_life Fix: Clippy lint 'uninlined_format_args' 2023-01-27 14:02:48 -07:00
geometry Derive Default for Rainbow in geometry example 2022-11-28 19:49:23 +01:00
integration_opengl Use f32 in Length::Units and rename it to Fixed 2023-02-17 15:40:17 +01:00
integration_wgpu Fix Wasm target for integration_wgpu 2023-04-13 06:03:44 +02:00
lazy Rename on_change to on_input for TextInput 2023-04-12 04:19:45 +02:00
modal Rename on_change to on_input for TextInput 2023-04-12 04:19:45 +02:00
modern_art Fixed issues with old GL versions ( <= 2.1 ) 2022-11-08 13:41:44 -08:00
multitouch Fix multitouch example 2022-11-03 04:42:46 +01:00
pane_grid Update pane_grid example w/ maximize / restore 2022-11-02 17:05:58 -07: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
scrollable Merge pull request #1669 from GyulyVGC/master 2023-03-27 16:17:02 +02:00
sierpinski_triangle Implement sierpinski-triangle example 2022-09-23 17:41:34 +02:00
slider Use f32 in Length::Units and rename it to Fixed 2023-02-17 15:40:17 +01:00
solar_system Implement window::frames subscription 2023-01-12 04:35:41 +01:00
stopwatch Use f32 in Length::Units and rename it to Fixed 2023-02-17 15:40:17 +01:00
styling Rename on_change to on_input for TextInput 2023-04-12 04:19:45 +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 Rename on_change to on_input for TextInput 2023-04-12 04:19:45 +02:00
todos Rename on_change to on_input for TextInput 2023-04-12 04:19:45 +02:00
tooltip Replace stateful widgets with new iced_pure API 2022-07-27 06:49:20 +02:00
tour Rename on_change to on_input for TextInput 2023-04-12 04:19:45 +02:00
url_handler Replace stateful widgets with new iced_pure API 2022-07-27 06:49:20 +02:00
websocket Rename on_change to on_input for TextInput 2023-04-12 04:19:45 +02:00
README.md Add multidirectional scrolling capabilities to the existing Scrollable. 2022-12-29 10:21:23 -08: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_opengl, a demonstration of how to integrate Iced in an existing OpenGL application.
  • integration_wgpu, 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.