rb-components
v1.4.5
Published
This is a fork of React-Bulma-Components
Downloads
5
Maintainers
Readme
React-bulma-components
React components for Bulma (v0.7.1) framework
This is a implementation in React of the Bulma Framework Component by Jeremy Thomas.
You can find the Storybook of all components here
To Install
npm install react-bulma-components
or yarn add -E react-bulma-components
To Use
import React from 'react';
// You can import from the global component (you will need to include the css file dist/react-bulma-components.min.css)
import { Columns } from 'react-bulma-components';
// You can also include the js that also bundle the ccs (do not work with server-side rendering)
import { Columns } from 'react-bulma-components/full';
// [RECOMENDED] Or import only the components you will use (this will reduce the total bundle size)
// If you use this approach and want to use the global Bulma styles import react-bulma-components/src/index.sass and configure webpack to handle sass files
import Columns from 'react-bulma-components/lib/components/columns';
export default () => (
<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>
);
Documentation
You can find the documentation in https://couds.github.io/react-bulma-components
Each component import his own sass file, in this way you can reduce your css total file only including the styles you use, to enable this please configure your Webpack to handle sass files. You can use the webpack.config.js on the root folder of this repository
Some componets may vary the api/naming convention with the Bulma Docs, please refear to each storybook to see how to use each component (you can find the source code of the story usin ght button "Show info" on the top-right corner)
The Following componets were ported:
- Box (Storybook) (Docs)
- Breadcrumb (Storybook) (Docs)
- Button (Storybook) (Docs)
- Card (Storybook) (Docs)
- Column (Storybook) (Docs)
- Container (Storybook) (Docs)
- Content (Storybook) (Docs)
- Dropdown (Storybook) (Docs)
- Footer (Storybook) (Docs)
- Form (Storybook) (Docs)
- Heading (Title, Subtitle and heading on Bulma) (Storybook) (Docs)
- Hero (Storybook) (Docs)
- Icon (Storybook) (Docs)
- Image (Storybook) (Docs)
- Level (Storybook) (Docs)
- Loader (Storybook)
- Media (Storybook) (Docs)
- Message (Storybook) (Docs)
- Menu (Storybook) (Docs)
- Modal (Storybook) (Docs)
- Navbar (Storybook) (Docs)
- Notification (Storybook) (Docs)
- Pagination (Storybook) (Docs)
- Panel (Storybook) (Docs)
- Progress (Storybook) (Docs)
- Section (Storybook) (Docs)
- Tabs (Storybook) (Docs)
- Table (Storybook) (Docs)
- Tag (Storybook) (Docs)
- Tile (Storybook) (Docs)
Override Bulma variables
To Override the variables set by Bulma you will need to create a sass file like this one (_variable.sass)
@import '~bulma/sass/utilities/initial-variables.sass'
// ADD HERE variables you want to override
$primary: #f4f4f4
@import '~bulma/sass/utilities/_all.sass'
After that you will need to add to your webpack configuration an alias pointing to the file
resolve {
// Other resolve props
alias: {
// Other aliases
'_variables.sass': path.resolve(__dirname, 'relative/path/to/your/file/from/webpack/config/file'),
},
}
This page is open source. Noticed a typo? Or something unclear? Improve this page on GitHub