Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-bulma-components

couds38.7kMIT4.1.0TypeScript support: included

React components for Bulma framework

react, bulma, bulma.io, css, bootstrap, modal, layout, responsive

readme

React Bulma Components

Build Status Coverage Status Release Version Npm Downloads

React components for Bulma (v0.9.2) UI compatible with most used React Frameworks (Gatsby, CRA, Next.js)

To Install

npm install react-bulma-components or yarn add -E react-bulma-components

Documentation

You can find the documentation in https://react-bulma.dev/en/storybook

Some components may vary the api/naming convention with the Bulma Docs. Please refer to each stories in the Storybook to see how each component could be used

To Use

import React from 'react';
import 'bulma/css/bulma.min.css';
import { Button } from 'react-bulma-components';

export default () => (
  <Button color="primary">My Bulma button</Button>
)

Form elements are imported as part of the Form class.

import { Form } from 'react-bulma-components';

const { Input, Field, Control, Label } = Form;

SASS support

Since CSS logic is separated from this library, there is no special setup required with the library. Simply follow the instructions in the official documentation. You only need to make sure the CSS is properly imported for your website.

Starting from v4, tree shaking is supported, so only the code of the components you have imported will be bundled.

FAQ

We allow custom render component on all our components, to do it you can use the renderAs props like this

import React from 'react';
import { Button } from 'react-bulma-components';
import { Link } from 'react-router';

const CustomLink = ({ to }) => {
  return (
    <Button to={to} renderAs={Link}>
      My react router link
    </Button>
  )
}

Adding ref to a component

We use a custom prop to pass down the ref to the next dom object. (instead to the instance of the component).

const TestComponent = () => {
  const buttonRef = useRef(null);
  return <Button domRef={buttonRef}>button</Button>
}

Why we do this instead of using React.forwardRef? The forwardRef wrap the component into another one, because this is a library for wrapping the Bulma Framework cause an overhead and a lot of noise on the component tab of the React Dev Tools.

changelog

Changelog

4.0.0

  • [Breaking Change] Move Bulma as a Peer Dependency
  • [Breaking Change] <List /> component is completely removed.
  • Bump Bulma version to 0.9.2
  • Improves TS support
  • New Storybook, with more details (and hopefully more helpful)
  • Enable Tree shaking by default

    All Components

  • New spacing modifiers. They have the same names as their equivalent Bulma class names. Refer to the official documentation for more information.
    • Usage: pt-0 in Bulma is equivalent to pt={0} in props. Applies to all spacing modifiers.
  • Added srOnly prop to all components to display only on screen readers
  • Add Support to textSize 7
  • [Breaking Change] Improve responsive helper props (mobile, tablet, desktop, widescreen, fullhd, touch, untilWidescreen, untilFullhd)
  • Added invisible to responsive props
  • hidden is now inside display prop, { hidden: true } become { display: 'hidden' }
  • Added invisible prop on all Components
  • [Breaking Change] Renamed the prop value centered to center on all components to use the same everywhere
  • Added display prop with same values as responsive display (bulma currently only support flex, hidden and relative at this level)
  • Added colorVariation prop to hancle light/dark color helpers
  • Added clickable prop
  • Added fontFamily prop
  • [Breaking Change] Removed items props in favor of composition with Breadcrumb.Item
  • New Component

Botton.Group

  • Deprecated gapless to hasAddons in Button.Group
  • [Breaking Change] Renamed position prop to align

Columns

  • [Breaking Change] Remove gapless prop
  • [Breaking Change] Add variable gap prop
  • Add gap to responsive option

Columns.Column

  • Merge common responsive props with Column responsive props

Container

  • [Breaking Change] Removed fluid prop in favor to add it as an option of the breakpoint prop
  • Added max prop to allow use is-max-desktop and is-max-widescreen from bulma
  • [Breaking Change] Dropdown component now accept an icon prop that will accept the the component to render the icon
  • [Breaking Change] Removed deprecated align prop in favor of boolean right prop

Form.Control

  • [Breaking Change] Removed size props (did nothing)
  • Automatically add has-icon-left/right if an Icon with align is on the children
  • Update default renderAs to footer

Form.Field

  • Added size prop that will be also used on childrens that accept size as a prop Input, InputFile, Label, Icon, Button...

Form.Input

  • [Breaking Change] Removed hovered and focused prop in favor to a state props that accept hover or focus as value

Form.InputFile

  • Removed centered and right prop in favor to a align props that accept center or right as value

Form.Label

  • Added size prop that will be used on components inside the Field, like Input, Select, Label...

Form.Select

  • Added state props that accept hover or focus as value
  • Added rounded prop

Form.Textarea

  • Removed hovered and focused prop in favor to a state props that accept hover or focus as value

Hero

  • size prop its ignored if hasNavbar prop is set

Hero.Head

  • Renamed to Hero.Header

Icon

  • Removed the icon prop from the Icon component.
  • Add text prop to enable icon-text

Level

  • Update default renderAs from div to nav

Media.Content

  • Removed the whole component, use Content component insted

Media.Item

  • Renamed position prop to align
  • Renamed Modal.Card.Head to Modal.Card.Header
  • Renamed Modal.Card.Foot to Modal.Card.Footer
  • Close button on the top-right corner will be displayed always if the showClose prop is passed, (Before if the children was a card was not displayed)
  • Only need to pass onClose prop to Modal component, no need to pass if to any Modal.* any more
  • Removed dropdown prop, it will be added automatically if a Navbar.Dropdown is detected on the childrens.
  • Renamed position prop to align
  • Change align values from start,end to left/right

Pagination

  • Renamed position prop to align

Table

  • Add hoverable prop

Table.Container

  • New Component

Tile

  • Remove notification prop. You can use renderAs={Notification} if need it
  • Remove color prop.

3.3.0

  • Add CHANGELOG.md

  • Bump Bulma version to 0.8.2

    • <Panel /> component now supports color prop which is exactly the same as other component that supports color, like <Button />

    • New modifier: colorVariant. Accepts two values: 'light' and 'dark'. It is equivalent to Bulma's is-light and is-dark modifier.

    • For changelog of Bulma 0.8.2, see here