33 releases

0.11.1 Jan 16, 2025
0.11.0 Sep 8, 2024
0.10.1 Jun 29, 2024
0.10.0 Jan 5, 2024
0.3.0 Nov 29, 2021

#165 in Web programming

Download history 264/week @ 2024-11-15 190/week @ 2024-11-22 213/week @ 2024-11-29 129/week @ 2024-12-06 165/week @ 2024-12-13 51/week @ 2024-12-20 86/week @ 2024-12-27 177/week @ 2025-01-03 301/week @ 2025-01-10 173/week @ 2025-01-17 186/week @ 2025-01-24 283/week @ 2025-01-31 322/week @ 2025-02-07 590/week @ 2025-02-14 238/week @ 2025-02-21 351/week @ 2025-02-28

1,566 downloads per month

MIT license

385KB
2.5K SLoC

Contains (WOFF font, 180KB) bootstrap-icons.woff, (WOFF font, 130KB) bootstrap-icons.woff2

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–20MB
~267K SLoC