30 releases (9 breaking)

0.10.0 Jan 5, 2024
0.9.0 Dec 10, 2023
0.8.1 Nov 29, 2023
0.5.16 Jul 24, 2023
0.3.0 Nov 29, 2021

#755 in GUI

Download history 23/week @ 2023-12-29 94/week @ 2024-01-05 73/week @ 2024-01-12 65/week @ 2024-01-19 100/week @ 2024-01-26 100/week @ 2024-02-02 53/week @ 2024-02-09 34/week @ 2024-02-16 96/week @ 2024-02-23 131/week @ 2024-03-01 165/week @ 2024-03-08 80/week @ 2024-03-15 87/week @ 2024-03-22 108/week @ 2024-03-29 59/week @ 2024-04-05

348 downloads per month

MIT license

355KB
2.5K SLoC

Usage

This project assumes that you have an existing web application that uses the Yew framework.

Add the dependency next to the regular yew dependency:

[dependencies]
yew = "0.21"
yew-bootstrap = "*"

To use form callback functions, the following dependencies should be added:

[dependencies]
wasm-bindgen = "0.2.*"
web-sys = { version = "0.3.*", features = ["HtmlTextAreaElement", "HtmlSelectElement"] }

Then in the beginning of your application, include the include_cdn() or include_inline() function to load the required CSS. Some components require the Bootstrap JavaScript library to be loaded - for these you can use the include_cdn_js() function. It is recommended that you put this at the bottom of your html!{} macro, as done below:

    fn view(&self, _ctx: &Context<Self>) -> Html {
        html! {
            <>
                {include_cdn()}
                <Button style={Color::Primary}>{"Primary"}</Button>
                {include_cdn_js()}
            </>
        }
    }

Check main.rs for example usage for every implemented component.

Version Convention

This project uses semantic versioning.

Coverage

Core Content

Components

Helpers

Examples

Several examples are provided:

  • examples/basics: Components
  • examples/forms: Form fields

To run an example:

cd examples/<directory>
trunk --serve

Dependencies

~11–15MB
~259K SLoC