iced/examples
2024-09-10 19:25:20 +02:00
..
arc Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
bezier_tool Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
checkbox Introduce daemon API and unify shell runtimes 2024-06-19 01:53:40 +02:00
clock Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
color_palette Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
combo_box Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
counter Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
custom_quad Improve Border ergonomics 2024-07-12 19:10:52 +02:00
custom_shader Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
custom_widget Remove out of date comment from custom-widget example 2024-08-14 08:40:22 +02:00
download_progress Add index.html to download_progress example 2024-09-10 19:25:20 +02:00
editor Use key_binding in editor example 2024-09-10 16:26:15 +02:00
events Revert window::close producing a window::Id 2024-08-12 05:50:22 +02:00
exit Revert window::close producing a window::Id 2024-08-12 05:50:22 +02:00
ferris Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
game_of_life Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
geometry Ask for explicit Length in center_* methods 2024-05-13 17:56:02 +02:00
gradient Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
integration Fix integration example 2024-08-12 03:10:46 +02:00
layout Implement row::Wrapping widget 2024-08-06 03:22:44 +02:00
lazy Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
loading_spinners Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
loupe Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
markdown Make RichText generic over data structure 2024-08-22 02:24:06 +02:00
modal Fix cursor passthrough in Stack during draw 2024-08-14 18:02:33 +02:00
multi_window Return window::Id in window::open 2024-07-30 22:26:55 +02:00
multitouch Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
pane_grid Add compact variant for pane grid controls 2024-08-22 12:43:48 -04:00
pick_list Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
pokedex Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
progress_bar Introduce Program API 2024-03-16 05:33:47 +01:00
qr_code Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
screenshot Implement From<&Handle> for image::Handle 2024-08-03 16:20:12 +02:00
scrollable Fix Scrollable::spacing not embedding the Scrollbar 2024-07-16 19:05:46 +02:00
sierpinski_triangle Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
slider Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
solar_system Invert Earth's rotation in solar_system example 2024-08-04 14:38:42 +02:00
stopwatch Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
styling Add text::Wrapping support 2024-09-04 21:26:47 +02:00
svg Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
system_information Introduce daemon API and unify shell runtimes 2024-06-19 01:53:40 +02:00
the_matrix Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
toast Introduce black_box and chain in widget::operation 2024-08-08 01:25:00 +02:00
todos Implement align_x for TextInput 2024-08-24 02:36:18 +02:00
tooltip Introduce center widget helper 2024-05-03 09:11:46 +02:00
tour Add text::Wrapping support 2024-09-04 21:26:47 +02:00
url_handler Introduce daemon API and unify shell runtimes 2024-06-19 01:53:40 +02:00
vectorial_text Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
visible_bounds Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
websocket Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
README.md Link to the latest branch in examples' README 2024-05-27 21:44:44 +02:00

Examples

Iced moves fast and the master branch can contain breaking changes! If you want to browse examples that are compatible with the latest release, then switch to the latest branch.

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.