Skip to content

panoptix-za/seed-bootstrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Seed Bootstrap

crates.io build status

A collection of frontend components to make it convenient to use the Bootstrap CSS components together with the Seed framework for creating Single Page Web Applications in Rust.

Usage

This project assumes that you have an existing web application that uses the Seed framework. If you do not, refer to the Seed quickstart project to get started.

Depend on Seed Bootstrap in your Cargo.toml like a normal Rust library.

[dependencies]
seed = "0.8"
seed-bootstrap = "0.1"

See Bootstrap's documentation on how to include Bootstrap in your application.

Seed Bootstrap provides a number of builders that can be used as part of your Seed view functions. For example, this is how you can create a variety of Bootstrap-style buttons.

use seed_bootstrap::button::{Button, Role, Type};

fn view(model: &Model) -> Node<Msg> {
    div![
        Button::new("Primary"),
        " ",
        Button::new("Secondary").secondary(),
        " ",
        Button::new("Success").success(),
        " ",
        Button::new("Danger").danger(),
        " ",
        Button::new("Warning").warning(),
        " ",
        Button::new("Info").info(),
        " ",
        Button::new("Light").light(),
        " ",
        Button::new("Dark").dark(),
        " ",
        Button::new("Link").link(),
    ]
}

Running the Demo

A demo of all of the components are included in this repo.

From a clean Rustup-based Rust install, you need to install the WebAssembly target and Wasm-pack to build the demo. You can do so with these commands:

  • rustup target add wasm32-unknown-unknown
  • cargo install wasm-pack

After that, open a terminal in the example directory. Then, run cargo run. Then, open a web browser and navigate to http://localhost:3030/. You should see a catalog of components.

License

Licensed under either of

at your option.

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published