rbx
is a comprehensive library of React components for Bulma 0.7.2.
π₯ All components have exhaustive storybook examples.
π I'll wait, go check them out!
npm install rbx
or yarn add rbx
import "rbx/index.css";
import React from "react";
import { Columns } from "rbx";
export const MyPage = () => (
<Columns>
<Columns.Column>First Column</Columns.Column>
<Columns.Column>Second Column</Columns.Column>
<Columns.Column>Third Column</Columns.Column>
<Columns.Column>Fourth Column</Columns.Column>
</Columns>
);
To customize Bulma (including colors), follow the instructions below.
All components support ref-forwarding, and are able to render as any other React Component Type you want to provide, by using the special prop as
.
For example, to render a Button
component as a react-router
Link
:
import { Button } from "rbx";
import { Link } from "react-router-dom";
export const goHomeLink = (
<Button as={Link} to="/home" color="primary" text>
Go home
</Button>
);
For styling, each component imports its own sass file. Thus, you can reduce your css total file size by only including the styles that you will use. To enable this, configure your Webpack to handle sass files.
While some components may slightly differ from the Bulma API, these changes are usually minimal.
Item | Storybook | Bulma Documentation |
---|---|---|
Generic | Stories | N/A |
Item | Storybook | Bulma Documentation |
---|---|---|
Breadcrumb | Stories | Documentation |
Card | Stories | Documentation |
Dropdown | Stories | Documentation |
Level | Stories | Documentation |
List | Stories | Documentation |
Media | Stories | Documentation |
Menu | Stories | Documentation |
Message | Stories | Documentation |
Modal | Stories | Documentation |
Navbar | Stories | Documentation |
Pagination | Stories | Documentation |
Panel | Stories | Documentation |
Tabs | Stories | Documentation |
Item | Storybook | Bulma Documentation |
---|---|---|
Box | Stories | Documentation |
Button | Stories | Documentation |
Container | Stories | Documentation |
Content | Stories | Documentation |
Form | Stories | Documentation |
Icon | Stories | Documentation |
Image | Stories | Documentation |
Notification | Stories | Documentation |
Other | Stories | N/A |
Progress | Stories | Documentation |
Table | Stories | Documentation |
Tag | Stories | Documentation |
Title | Stories | Documentation |
Item | Storybook | Bulma Documentation |
---|---|---|
Columns | Stories | Documentation |
Tiles | Stories | Documentation |
Item | Storybook | Bulma Documentation |
---|---|---|
Footer | Stories | Documentation |
Hero | Stories | Documentation |
Section | Stories | Documentation |
To override the variables set by Bulma, install Bulma (npm install [email protected]
), and follow the Bulma instructions.
You will also need to import rbx/rbx.sass
as it contains any pertinent bug fixes for Bulma.
A minimal example of style.sass
might look like:
$primary: #61dafb
@import "~bulma/bulma.sass"
@import "../src/index.sass"
Then, import this file into the root of your project.
Create React App 2 supports SASS compilation out of the box.
To get started, please follow the official instructions to enable this feature.
Then, create a SASS file in your project (as described above):
Finally, import this stylesheet somewhere in your CRA app.
import "./App.sass";