Socket
Socket
Sign inDemoInstall

react-bulma-components

Package Overview
Dependencies
28
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-bulma-components

React components for Bulma framework


Version published
Weekly downloads
33K
decreased by-15.68%
Maintainers
1
Install size
956 kB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 04 Feb 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc