31 releases (9 breaking)

0.10.1 Jun 29, 2024
0.10.0 Jan 5, 2024
0.9.0 Dec 10, 2023
0.8.1 Nov 29, 2023
0.3.0 Nov 29, 2021

#305 in Web programming

Download history 84/week @ 2024-03-25 89/week @ 2024-04-01 63/week @ 2024-04-08 101/week @ 2024-04-15 158/week @ 2024-04-22 804/week @ 2024-04-29 48/week @ 2024-05-06 45/week @ 2024-05-13 113/week @ 2024-05-20 135/week @ 2024-05-27 135/week @ 2024-06-03 124/week @ 2024-06-10 168/week @ 2024-06-17 367/week @ 2024-06-24 274/week @ 2024-07-01 220/week @ 2024-07-08

1,040 downloads per month

MIT license

380KB
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

~10–14MB
~257K SLoC