All Projects → thedodd → ybc

thedodd / ybc

Licence: other
A Yew component library based on the Bulma CSS framework.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to ybc

bounce
The uncomplicated Yew State management library
Stars: ✭ 43 (-67.18%)
Mutual labels:  wasm, yew
wasi-worker
WASM / WASI interface for browser service workers
Stars: ✭ 31 (-76.34%)
Mutual labels:  wasm, yew
fullstack-rust
Reference implementation of a full-stack Rust application
Stars: ✭ 39 (-70.23%)
Mutual labels:  wasm, yew
facade
Facade Framework - autogenerated embedded live dashboards for Rust apps
Stars: ✭ 95 (-27.48%)
Mutual labels:  wasm, yew
material-yew
Yew wrapper for Material Web Components
Stars: ✭ 116 (-11.45%)
Mutual labels:  wasm, yew
rocket-yew-starter-pack
Example boilerplate for websites in pure Rust
Stars: ✭ 77 (-41.22%)
Mutual labels:  wasm, yew
rust-electron-demo
rust electron demo using yew
Stars: ✭ 15 (-88.55%)
Mutual labels:  wasm, yew
rusty-connect4
A full-stack application written completely in Rust.
Stars: ✭ 30 (-77.1%)
Mutual labels:  yew
jvm
Pure Rust implementation of the JVM 7 specification
Stars: ✭ 27 (-79.39%)
Mutual labels:  wasm
http-interceptors
The Web apps in this monorepo make HTTP requests and require uniform consistency in how they are executed and handled. This monorepo demonstrates the same app written with Angular and with Svelte. Each app uses HTTP interceptors. The Angular app uses HttpClient and its interceptors while the Svelte app uses Axios and its interceptors.
Stars: ✭ 46 (-64.89%)
Mutual labels:  bulma
vmrp
mrp emulator, virtual machine, mrp模拟器
Stars: ✭ 126 (-3.82%)
Mutual labels:  wasm
TypeScriptXX
🧷 Stay safe! Type-safe scripting for C++ using TypeScriptToLua and CMake with auto-generated declarations.
Stars: ✭ 33 (-74.81%)
Mutual labels:  wasm
koder
QR/bar code scanner for the Browser
Stars: ✭ 73 (-44.27%)
Mutual labels:  wasm
rgeometry
Computational Geometry library written in Rust
Stars: ✭ 77 (-41.22%)
Mutual labels:  wasm
rust-wasm-on-lambda-edge
Rust/WASM on AWS Lambda@Edge (CloudFront)
Stars: ✭ 12 (-90.84%)
Mutual labels:  wasm
hexo-theme-griddy
Hexo theme for artist & photographer showing their work that created with Bulma CSS Framework
Stars: ✭ 22 (-83.21%)
Mutual labels:  bulma
admin-one-nuxt
Admin One Nuxt - Nuxt.js Bulma Buefy admin dashboard
Stars: ✭ 23 (-82.44%)
Mutual labels:  bulma
vue-monthly-picker
VueJS Monthly Picker component
Stars: ✭ 63 (-51.91%)
Mutual labels:  bulma
wasm2kt
Web Assembly to Kotlin and Java converter. Allows to compile a C or C++ program/library, and generate a Kotlin or Java program/library.
Stars: ✭ 20 (-84.73%)
Mutual labels:  wasm
reqwasm
HTTP requests library for WASM Apps
Stars: ✭ 81 (-38.17%)
Mutual labels:  wasm

ybc

Build Status Crates.io docs.rs License Discord Chat Crates.io

A Yew component library based on the Bulma CSS framework.

YBC encapsulates all of the structure, style and functionality of the Bulma CSS framework as a set of Yew components. YBC also ships with support for the Yew Router, adding Bulma-styled components which wrap the Yew Router components for clean integration.

As a guiding principal, YBC does not attempt to encapsulate every single Bulma style as a Rust type, let alone the many valid style combinations. That would be far too complex, and probably limiting to the user in many ways. Instead, YBC handles strucutre, required classes, functionality, sane defaults and every component can be customized with any additional classes for an exact look and feel.

What does it look like to use YBC? The following is a snippet of a component's view method rendering a navbar, a fluid container, and some tiles.

use ybc::NavbarFixed::Top;
use ybc::TileCtx::{Ancestor, Child, Parent};
use ybc::TileSize::Four;
use yew::prelude::*;

struct App; // An application component.

impl Component for App {
  /* .. snip .. */
  fn view(&self) -> Html {
    html!{
      <>
      <ybc::Navbar fixed=Top /* .. your navbar content here .. *//>
      <ybc::Container fluid=true>
        <ybc::Tile ctx=Ancestor>
          <ybc::Tile ctx=Parent vertical=true size=Four>
            <ybc::Tile ctx=Child classes=classes!("box")>
              <p>{"Lorem ipsum dolor sit amet ..."}</p>
            </ybc::Tile>
            /* .. snip .. more tiles here .. */
          </ybc::Tile>
        </ybc::Tile>
      </ybc::Container>
      </>
    }
  }
}

getting started

add ybc dependency

First, add this library to your Cargo.toml dependencies.

[dependencies]
ybc = "0.2"

add bulma

add bulma css (no customizations)

This project works perfectly well if you just include the Bulma CSS in your HTML, as described here. The following link in your HTML head should do the trick: <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css"/>.

add bulma sass (allows customization & themes)

However, if you want to customize Bulma to match your style guidelines, then you will need to have a copy of the Bulma SASS locally, and then import Bulma after you've defined your customizations, as described here.

// index.scss

// Set your brand colors
$purple: #8A4D76;
$pink: #FA7C91;
$brown: #757763;
$beige-light: #D0D1CD;
$beige-lighter: #EFF0EB;

// Import the rest of Bulma
@import "path/to/bulma";

If you are using Trunk to build your application and bundle its assets, then simply point to your index.scss from your index.html file, and Trunk will handle compling your application, your sass, and will make everything available in your dist dir.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <link rel="stylesheet" href="index.sass"/>
  </head>
  <body>
    <!-- ... snip ... -->
  </body>
</html>

Now just execute trunk serve --open, and your application will be built and opened in your browser.

If you are not using Trunk, you will need to use another mechanism for building your Rust WASM application and its assets.

web-sys & stdweb

Currently, this library only supports the web-sys backend. Support for stdweb is not currently planned. If that is problematic, please open an issue describing why. Cheers!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].