Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/panoptix-za/seed-bootstrap
https://github.com/panoptix-za/seed-bootstrap
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/panoptix-za/seed-bootstrap
- Owner: panoptix-za
- License: apache-2.0
- Created: 2021-01-06T12:16:57.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-08T17:57:37.000Z (almost 2 years ago)
- Last Synced: 2024-08-04T01:04:29.696Z (5 months ago)
- Language: Rust
- Size: 144 KB
- Stars: 2
- Watchers: 7
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
- awesome-seed-rs - Seed Bootstrap - A collection of the [Bootstrap](https://getbootstrap.com/) CSS components. (Libraries)
README
Seed Bootstrap
==============[![crates.io](https://img.shields.io/crates/v/seed-bootstrap.svg)](https://crates.io/crates/seed-bootstrap)
[![build status](https://panoptix.semaphoreci.com/badges/seed-bootstrap/branches/main.svg)](https://panoptix.semaphoreci.com/projects/seed-bootstrap)A collection of frontend components to make it convenient to use the
[Bootstrap](https://getbootstrap.com/) CSS components together with
the [Seed](https://seed-rs.org/) 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](https://github.com/seed-rs/seed-quickstart) project to get
started.Depend on Seed Bootstrap in your Cargo.toml like a normal Rust library.
```toml
[dependencies]
seed = "0.8"
seed-bootstrap = "0.1"
```See [Bootstrap's documentation](https://getbootstrap.com/docs/4.5/getting-started/introduction/)
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.```rust
use seed_bootstrap::button::{Button, Role, Type};fn view(model: &Model) -> Node {
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](./example). Then, run `cargo run`. Then, open a web browser
and navigate to . You should see a catalog of
components.## License
Licensed under either of
* Apache License, Version 2.0
([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)at your option.