yew/examples
dependabot[bot] 8d64ce0e00
Bump tokio from 1.43.0 to 1.43.1 (#3840)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.43.0 to 1.43.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.43.0...tokio-1.43.1)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.43.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-09 17:54:03 +09:00
..
async_clock use latest wasm-opt 2025-03-02 23:56:22 +09:00
boids docs: rand 0.9 RUSTFLAGS instruction 2025-03-03 04:53:22 +09:00
communication_child_to_parent use latest wasm-opt 2025-03-02 23:56:22 +09:00
communication_grandchild_with_grandparent use latest wasm-opt 2025-03-02 23:56:22 +09:00
communication_grandparent_to_grandchild use latest wasm-opt 2025-03-02 23:56:22 +09:00
communication_parent_to_child use latest wasm-opt 2025-03-02 23:56:22 +09:00
contexts use latest wasm-opt 2025-03-02 23:56:22 +09:00
counter use latest wasm-opt 2025-03-02 23:56:22 +09:00
counter_functional use latest wasm-opt 2025-03-02 23:56:22 +09:00
dyn_create_destroy_apps use latest wasm-opt 2025-03-02 23:56:22 +09:00
file_upload use latest wasm-opt 2025-03-02 23:56:22 +09:00
function_memory_game docs: rand 0.9 RUSTFLAGS instruction 2025-03-03 04:53:22 +09:00
function_router use latest wasm-opt 2025-03-02 23:56:22 +09:00
function_todomvc use latest wasm-opt 2025-03-02 23:56:22 +09:00
futures use latest wasm-opt 2025-03-02 23:56:22 +09:00
game_of_life docs: rand 0.9 RUSTFLAGS instruction 2025-03-03 04:53:22 +09:00
immutable use latest wasm-opt 2025-03-02 23:56:22 +09:00
inner_html use latest wasm-opt 2025-03-02 23:56:22 +09:00
js_callback use latest wasm-opt 2025-03-02 23:56:22 +09:00
keyed_list docs: rand 0.9 RUSTFLAGS instruction 2025-03-03 04:53:22 +09:00
mount_point use latest wasm-opt 2025-03-02 23:56:22 +09:00
nested_list use latest wasm-opt 2025-03-02 23:56:22 +09:00
node_refs use latest wasm-opt 2025-03-02 23:56:22 +09:00
password_strength use latest wasm-opt 2025-03-02 23:56:22 +09:00
portals use latest wasm-opt 2025-03-02 23:56:22 +09:00
router use latest wasm-opt 2025-03-02 23:56:22 +09:00
simple_ssr Bump tokio from 1.43.0 to 1.43.1 (#3840) 2025-04-09 17:54:03 +09:00
ssr_router Bump tokio from 1.43.0 to 1.43.1 (#3840) 2025-04-09 17:54:03 +09:00
suspense use latest wasm-opt 2025-03-02 23:56:22 +09:00
timer use latest wasm-opt 2025-03-02 23:56:22 +09:00
timer_functional use latest wasm-opt 2025-03-02 23:56:22 +09:00
todomvc use latest wasm-opt 2025-03-02 23:56:22 +09:00
two_apps use latest wasm-opt 2025-03-02 23:56:22 +09:00
wasi_ssr_module Prepare for 0.22 release (#3750) 2024-12-17 16:27:02 +08:00
web_worker_fib use latest wasm-opt 2025-03-02 23:56:22 +09:00
web_worker_prime use latest wasm-opt 2025-03-02 23:56:22 +09:00
webgl use latest wasm-opt 2025-03-02 23:56:22 +09:00
.gitignore Fix Dependabot and GitHub Actions (#3111) 2023-03-05 07:03:10 +09:00
README.md docs: rand 0.9 RUSTFLAGS instruction 2025-03-03 04:53:22 +09:00

README.md

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 using the rand crate require a special rust flag to be enabled:

RUSTFLAGS='--cfg getrandom_backend="wasm_js"' 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!