iced/examples
Héctor Ramón Jiménez ecd0997576
Center contents with Container in exit example
... also add some `padding` to buttons!
2022-01-03 12:09:07 +07:00
..
bezier_tool Refactor alignment types into an alignment module 2021-09-20 15:14:08 +07:00
clock Make Command implementations platform-specific 2021-09-02 13:29:34 +07:00
color_palette Refactor alignment types into an alignment module 2021-09-20 15:14:08 +07:00
component Hide Box allocation in component::view 2021-11-29 15:04:13 +07:00
counter Refactor alignment types into an alignment module 2021-09-20 15:14:08 +07:00
custom_widget Rename fill_rectangle to fill_quad in Renderer 2021-11-04 19:24:11 +07:00
download_progress Refactor alignment types into an alignment module 2021-09-20 15:14:08 +07:00
events Refactor alignment types into an alignment module 2021-09-20 15:14:08 +07:00
exit Center contents with Container in exit example 2022-01-03 12:09:07 +07:00
game_of_life Refactor alignment types into an alignment module 2021-09-20 15:14:08 +07:00
geometry Migrate geometry example to new Renderer API 2021-10-30 20:42:09 +07:00
integration_opengl Rename Renderer::present to with_primitives 2021-11-05 15:38:27 +07:00
integration_wgpu Rename Renderer::present to with_primitives 2021-11-05 15:38:27 +07:00
pane_grid Reintroduce Box for style_sheet in Container 2021-10-31 17:02:59 +07:00
pick_list Refactor alignment types into an alignment module 2021-09-20 15:14:08 +07:00
pokedex Remove unused fields in pokedex example 2021-12-07 16:13:53 +07:00
progress_bar Make Application and Sandbox return a Result 2020-09-08 00:44:59 +02:00
qr_code Refactor alignment types into an alignment module 2021-09-20 15:14:08 +07:00
scrollable Merge pull request #1106 from RamType0/RemoveUnnecessaryStringAllocationInExample 2021-11-10 23:59:35 +07:00
solar_system Remove unused field in solar_system example 2021-12-07 16:12:34 +07:00
stopwatch Reintroduce Box for style_sheet in Button 2021-10-31 16:53:18 +07:00
styling Add checkbox text_color styling 2021-11-14 11:35:12 +01:00
svg Make Application and Sandbox return a Result 2020-09-08 00:44:59 +02:00
todos Merge pull request #1106 from RamType0/RemoveUnnecessaryStringAllocationInExample 2021-11-10 23:59:35 +07:00
tooltip Reintroduce Box for style_sheet in Container 2021-10-31 17:02:59 +07:00
tour Fix path to ferris.png 2021-12-11 16:51:54 -07:00
url_handler Make Command implementations platform-specific 2021-09-02 13:29:34 +07:00
README.md Update README in examples directory 2021-08-13 21:00:22 +07: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

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_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 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.