Search⌘ K
AI Features

Set Up Yew

Explore how to set up the Yew framework for Rust-based front-end development using WebAssembly. Understand component creation, state management, and event handling. Learn to configure dependencies, build a sample application, and run tests with wasm-pack to ensure functionality.

We'll cover the following...

Initial configuration

Every web application needs a web interface. There are popular frameworks to do that in JavaScript, such as Angular, Vue, and React-Redux.

Rust has a few front-end frameworks as well, such as Yew, that take advantage of the modern WebAssembly (Wasm) technology.

In this lesson, we’ll learn to set up our front-end in the Yew framework.

We’ll use the below command to create our front-end application.

Shell
cargo new yew-shoe-store

We need the crate trunk, which is a bundler for web applications in Rust.

Shell
cargo install trunk wasm-bindgen-cli

We also need a target.