35 releases

0.13.0 Apr 23, 2025
0.11.1 Jan 16, 2025
0.11.0 Sep 8, 2024
0.10.1 Jun 29, 2024
0.3.0 Nov 29, 2021

#58 in GUI

Download history 224/week @ 2025-01-09 287/week @ 2025-01-16 138/week @ 2025-01-23 285/week @ 2025-01-30 347/week @ 2025-02-06 539/week @ 2025-02-13 256/week @ 2025-02-20 333/week @ 2025-02-27 385/week @ 2025-03-06 325/week @ 2025-03-13 384/week @ 2025-03-20 225/week @ 2025-03-27 194/week @ 2025-04-03 246/week @ 2025-04-10 547/week @ 2025-04-17 241/week @ 2025-04-24

1,313 downloads per month

MIT license

405KB
3.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"] }

Some components need features to be enabled, for example:

[dependencies]
yew = "0.21"
yew-bootstrap = { version = "*", features = ["searchable_select"] }

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

Extra components

Some additional components are provided, not strictly part of Bootstrap, but based on Boostrap components.

  • Searchable select (component::SearchableSelect) - Requires feature "searchable_select"

    A component similar to a Select showing a field to filter the items.

Features

searchable_select

Enables the component::SearchableSelect, which requires additional dependencies.

Examples

Several examples are provided:

  • examples/basics: Components
  • examples/forms: Form fields
  • examples/searchable_select: Searchable Select component

To run an example:

cd examples/<directory>
trunk --serve

Dependencies

~11–20MB
~278K SLoC