iced/examples
2024-05-13 17:56:02 +02:00
..
arc Restore canvas::Frame API 2024-03-22 01:35:14 +01:00
bezier_tool Use hover widget in bezier_tool example 2024-04-27 06:06:28 +02:00
checkbox Introduce center widget helper 2024-05-03 09:11:46 +02:00
clock Enable logging in clock example 2024-04-30 23:51:41 +02:00
color_palette Restore canvas::Frame API 2024-03-22 01:35:14 +01:00
combo_box Introduce center widget helper 2024-05-03 09:11:46 +02:00
component Introduce center widget helper 2024-05-03 09:11:46 +02:00
counter Introduce Program API 2024-03-16 05:33:47 +01:00
custom_quad Introduce center widget helper 2024-05-03 09:11:46 +02:00
custom_shader Introduce center widget helper 2024-05-03 09:11:46 +02:00
custom_widget Introduce center widget helper 2024-05-03 09:11:46 +02:00
download_progress Introduce center widget helper 2024-05-03 09:11:46 +02:00
editor Ask for explicit Length in center_* methods 2024-05-13 17:56:02 +02:00
events Introduce center widget helper 2024-05-03 09:11:46 +02:00
exit Introduce center widget helper 2024-05-03 09:11:46 +02:00
ferris Improve layout of ferris example 🦀 2024-05-03 13:32:51 +02:00
game_of_life Restore canvas::Frame API 2024-03-22 01:35:14 +01:00
geometry Ask for explicit Length in center_* methods 2024-05-13 17:56:02 +02:00
gradient Use Catalog approach for all widgets 2024-03-24 05:03:09 +01:00
integration Update winit to 0.30 2024-05-07 16:07:56 +02:00
layout Ask for explicit Length in center_* methods 2024-05-13 17:56:02 +02:00
lazy Specialize widget::text helper with custom IntoContent trait 2024-04-01 21:36:08 +02:00
loading_spinners Introduce center widget helper 2024-05-03 09:11:46 +02:00
loupe Introduce center widget helper 2024-05-03 09:11:46 +02:00
modal Introduce center widget helper 2024-05-03 09:11:46 +02:00
multi_window Ask for explicit Length in center_* methods 2024-05-13 17:56:02 +02:00
multitouch Move Program to application module 2024-03-17 14:19:12 +01:00
pane_grid Ask for explicit Length in center_* methods 2024-05-13 17:56:02 +02:00
pick_list Introduce Program API 2024-03-16 05:33:47 +01:00
pokedex Introduce center widget helper 2024-05-03 09:11:46 +02:00
progress_bar Introduce Program API 2024-03-16 05:33:47 +01:00
qr_code Introduce center widget helper 2024-05-03 09:11:46 +02:00
screenshot Ask for explicit Length in center_* methods 2024-05-13 17:56:02 +02:00
scrollable Introduce center widget helper 2024-05-03 09:11:46 +02:00
sierpinski_triangle Restore canvas::Frame API 2024-03-22 01:35:14 +01:00
slider Ask for explicit Length in center_* methods 2024-05-13 17:56:02 +02:00
solar_system Restore canvas::Frame API 2024-03-22 01:35:14 +01:00
stopwatch Introduce center widget helper 2024-05-03 09:11:46 +02:00
styling Introduce center widget helper 2024-05-03 09:11:46 +02:00
svg Ask for explicit Length in center_* methods 2024-05-13 17:56:02 +02:00
system_information Ask for explicit Length in center_* methods 2024-05-13 17:56:02 +02:00
the_matrix Invalidate text uploads after atlas trimming 2024-04-30 21:59:46 +02:00
toast Introduce center widget helper 2024-05-03 09:11:46 +02:00
todos Ask for explicit Length in center_* methods 2024-05-13 17:56:02 +02:00
tooltip Introduce center widget helper 2024-05-03 09:11:46 +02:00
tour Ask for explicit Length in center_* methods 2024-05-13 17:56:02 +02:00
url_handler Introduce center widget helper 2024-05-03 09:11:46 +02:00
vectorial_text Restore canvas::Frame API 2024-03-22 01:35:14 +01:00
visible_bounds Use Program API in visible_bounds example 2024-03-17 18:37:29 +01:00
websocket Auto-focus text_input in websocket example 2024-05-03 09:25:47 +02:00
README.md Host GIFs and video examples in iced.rs 2023-09-07 05:05:43 +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.