Onboarding Tour for Yew Framework in Rust.
This library provides an onboarding tour for applications built using the Yew framework in Rust.
You can see the demo here:
trunk serve
Visit http://localhost:8080 in your browser.
Add the following to your Cargo.toml
:
[dependencies]
yew-tou-rs = { git = "https://github.com/chriamue/yew-tou-rs" }
Add the following to your index.html
:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/intro.js/7.2.0/introjs.css">
See Intro.js for more information about its license.
Add the following to your App.rs
:
use yew::prelude::*;
use yew_tou_rs::prelude::*;
#[function_component(App)]
pub fn app() -> Html {
let steps = vec![
TourStep {
selector: ".h1-step".to_string(),
content: "This is a title".to_string(),
}
];
html! {
<div class="app">
<h1 class="h1-step">{"Hello, Yew Tou-rs"}</h1>
<Tour steps={steps} />
</div>
}
}
If you enable the storage feature, closed tours will not be shown again:
[dependencies]
yew-tou-rs = { git = "https://github.com/chriamue/yew-tou-rs", features = ["storage"] }
If you enable the markdown feature, you can use markdown in the content:
[dependencies]
yew-tou-rs = { git = "https://github.com/chriamue/yew-tou-rs", features = ["markdown"] }
let steps = vec".to_string(),
},
];
This project is licensed under the MIT License - see the LICENSE file for details.