yew/examples
dependabot[bot] 960c4f22ed
Bump the cargo-deps group across 1 directory with 17 updates (#3807)
* Bump the cargo-deps group across 1 directory with 17 updates

Bumps the cargo-deps group with 16 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.69` | `2.0.11` |
| [serde](https://github.com/serde-rs/serde) | `1.0.217` | `1.0.218` |
| [tokise](https://github.com/yewstack/tokise) | `0.1.0` | `0.2.0` |
| [rand](https://github.com/rust-random/rand) | `0.8.5` | `0.9.0` |
| [tabled](https://github.com/zhiburt/tabled) | `0.16.0` | `0.18.0` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.138` | `1.0.139` |
| [clap](https://github.com/clap-rs/clap) | `4.5.29` | `4.5.30` |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.95` | `1.0.96` |
| [git2](https://github.com/rust-lang/git2-rs) | `0.19.0` | `0.20.0` |
| [strum](https://github.com/Peternator7/strum) | `0.26.3` | `0.27.1` |
| [derive_more](https://github.com/JelteF/derive_more) | `1.0.0` | `2.0.1` |
| [strum_macros](https://github.com/Peternator7/strum) | `0.26.4` | `0.27.1` |
| [pulldown-cmark](https://github.com/raphlinus/pulldown-cmark) | `0.12.2` | `0.13.0` |
| [fake](https://github.com/cksac/fake-rs) | `2.10.0` | `4.0.0` |
| [uuid](https://github.com/uuid-rs/uuid) | `1.13.1` | `1.14.0` |
| [axum](https://github.com/tokio-rs/axum) | `0.7.9` | `0.8.1` |



Updates `thiserror` from 1.0.69 to 2.0.11
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.69...2.0.11)

Updates `serde` from 1.0.217 to 1.0.218
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.217...v1.0.218)

Updates `tokise` from 0.1.0 to 0.2.0
- [Release notes](https://github.com/yewstack/tokise/releases)
- [Commits](https://github.com/yewstack/tokise/compare/v0.1.0...v0.2.0)

Updates `rand` from 0.8.5 to 0.9.0
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand/compare/0.8.5...0.9.0)

Updates `tabled` from 0.16.0 to 0.18.0
- [Changelog](https://github.com/zhiburt/tabled/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zhiburt/tabled/commits)

Updates `serde_json` from 1.0.138 to 1.0.139
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.138...v1.0.139)

Updates `clap` from 4.5.29 to 4.5.30
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.29...clap_complete-v4.5.30)

Updates `anyhow` from 1.0.95 to 1.0.96
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.95...1.0.96)

Updates `git2` from 0.19.0 to 0.20.0
- [Changelog](https://github.com/rust-lang/git2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/git2-rs/compare/git2-0.19.0...git2-0.20.0)

Updates `strum` from 0.26.3 to 0.27.1
- [Release notes](https://github.com/Peternator7/strum/releases)
- [Changelog](https://github.com/Peternator7/strum/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Peternator7/strum/compare/v0.26.3...v0.27.1)

Updates `derive_more` from 1.0.0 to 2.0.1
- [Release notes](https://github.com/JelteF/derive_more/releases)
- [Changelog](https://github.com/JelteF/derive_more/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JelteF/derive_more/compare/v1.0.0...v2.0.1)

Updates `strum_macros` from 0.26.4 to 0.27.1
- [Release notes](https://github.com/Peternator7/strum/releases)
- [Changelog](https://github.com/Peternator7/strum/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Peternator7/strum/commits/v0.27.1)

Updates `pulldown-cmark` from 0.12.2 to 0.13.0
- [Release notes](https://github.com/raphlinus/pulldown-cmark/releases)
- [Commits](https://github.com/raphlinus/pulldown-cmark/compare/v0.12.2...v0.13.0)

Updates `fake` from 2.10.0 to 4.0.0
- [Release notes](https://github.com/cksac/fake-rs/releases)
- [Changelog](https://github.com/cksac/fake-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/cksac/fake-rs/commits)

Updates `uuid` from 1.13.1 to 1.14.0
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/1.13.1...v1.14.0)

Updates `axum` from 0.7.9 to 0.8.1
- [Release notes](https://github.com/tokio-rs/axum/releases)
- [Changelog](https://github.com/tokio-rs/axum/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/axum/commits)

Updates `serde_derive` from 1.0.217 to 1.0.218
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.217...v1.0.218)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: cargo-deps
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: tokise
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-deps
- dependency-name: rand
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-deps
- dependency-name: tabled
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-deps
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: git2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-deps
- dependency-name: strum
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-deps
- dependency-name: derive_more
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: cargo-deps
- dependency-name: strum_macros
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-deps
- dependency-name: pulldown-cmark
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-deps
- dependency-name: fake
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: cargo-deps
- dependency-name: uuid
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-deps
- dependency-name: axum
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-deps
- dependency-name: serde_derive
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: revert rand0.9 upgrade for now

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matt Yan <syan4@ualberta.ca>
2025-02-21 15:03:39 +09:00
..
2023-09-23 14:56:06 +02:00
2023-10-28 16:11:28 +05:00

Yew Examples

How to Run

The examples are built with trunk. Once you have the development environment fully set up (see documentation), running an example is as easy as running a single command:

# move into the directory of the example you want to run
# In this case it's the todomvc example
cd examples/todomvc

# build and serve the example
trunk serve --open

Some examples may perform better using the release profile. If something is slow, you can try running it with the --release argument.

We're also publicly hosting the examples at https://examples.yew.rs/<EXAMPLE>. As an example, check out the TodoMVC example here: https://examples.yew.rs/todomvc

List of Examples

Example CT Description
async_clock S Demonstrates the use of asynchronous tasks in a yew component.
boids S Yew port of Boids
communication_child_to_parent S Communication from child to parent components.
communication_grandchild_with_grandparent S Communication from grandchildren to grandparent components.
communication_grandparent_to_grandchild S Communication from grandparent to grandchild components.
communication_parent_to_child S Communication from parent to child components.
contexts F A technical demonstration of the Context API.
counter S Simple counter which can be incremented and decremented.
counter_functional F Simple counter which can be incremented and decremented made using function components.
dyn_create_destroy_apps S Uses the function Renderer::with_root_and_props and the AppHandle struct to dynamically create and delete Yew apps.
file_upload S Uses gloo::file to read the content of user uploaded files.
function_memory_game F Implementation of Memory Game.
function_router F Identical to router but using function components.
function_todomvc F Implementation of TodoMVC using function components and hooks.
futures S Demonstrates how you can use futures and async code with Yew. Features a Markdown renderer.
game_of_life S Implementation of Conway's Game of Life.
immutable SF Using immutable types in components.
inner_html S Embeds an external document as raw HTML by manually managing the element.
js_callback F Interacts with JavaScript code.
keyed_list S Demonstrates how to use keys to improve the performance of lists.
mount_point S Shows how to mount the root component to a custom element.
nested_list S Renders a styled list which tracks hover events.
node_refs S Uses a NodeRef to focus the input element under the cursor.
password_strength SF A password strength estimator implemented in Yew.
portals S Renders elements into out-of-tree nodes with the help of portals.
router S The best yew blog built with yew-router.
simple_ssr F Demonstrates server-side rendering.
ssr_router F Demonstrates server-side rendering with routing.
suspense F This is an example that demonstrates <Suspense /> support.
timer S Demonstrates the use of the interval and timeout services.
timer_functional F Demonstrates the use of the interval and timeout services using function components
todomvc S Implementation of TodoMVC.
two_apps S Runs two separate Yew apps which can communicate with each other.
web_worker_fib F Calculate Fibonacci numbers in a web worker thread using yew-agent.
web_worker_prime F Calculate Prime numbers in a web worker thread using yew-agent.
webgl S Controls a WebGL canvas from Yew.
wasi_ssr_module F Demonstrates server-side rendering using WASI.

Next Steps

Have a look at Yew's starter templates when starting a project using Yew they can significantly simplify things.

Helping Out

If one of the examples catches your interest, look for the "improvements" section in its README.md file. Most examples list a few ideas for how to improve them. Consider starting with those but don't hesitate to improve an example in other ways either.

One problem that currently plagues most examples is the lack of styling. Please help us make the examples look as flashy as possible!