npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-bulma-board

v0.1.0

Published

Create boards to display lists and also drag and drop items back and forth while maintaing the state of the lists.

Downloads

5

Readme

react-bulma-board

Create boards to display lists and also drag and drop items back and forth while maintaing the state of the lists.

Installation

npm i react-bulma-board --save

Sample Code

import React, { Component } from "react";
import { render } from "react-dom";
import { DragAndDropBoard } from "react-bulma-board";
import "./bulma.css";

class App extends Component {
  constructor(props) {
    super(props);
    this.state = {
      boardContent: {
        "To-Do": [
          "Implement item specific actions",
          "Trello clone",
          "Include stateful components"
        ],
        WIP: ["Footer implementation", "write test cases", "optimization"],
        Completed: ["Board", "Drag and Drop", "default Props", "State Handling"]
      },
      options: {
        boardColors: ["#FF9800", "#03A9F4", "#8BC34A"],
        innerItemColor: ["#FFE0B2", "#B3E5FC", "#DCEDC8"],
        roundedCorner: true,
        innerItemsRoundedCorner: true,
        showKeyIndex: true
      }
    };
  }

  handleState(data) {
    this.setState({
      data
    });
  }

  render() {
    const { boardContent, options } = this.state;
    return (
      <DragAndDropBoard
        numberOfBoards={3}
        boardContent={boardContent}
        onDrop={data => this.handleState(data)}
        options={options}
      />
    );
  }
}

render(<App />, document.getElementById("root"));

Props

| name | type | required | description | | -------------- | ------ | -------- | ---------------------------------------------------------------------------- | | numberOfBoards | Number | true | The number of boards to be displayed | | boardContent | Object | true | Lists to be passed on to the boards are to be represented in key-value pairs | | options | Object | true | Display options, explained in the next section. |

Options

| name | type | required | description | exampleValue | defaultValue | | ------------------------ | ------- | -------- | ----------------------------------------------------------------------------- | ----------------------------------- | ------------ | | boardColors | array | false | Board's background color, applied to each board in the passed order | ["#FF9800", "#03A9F4", "#8BC34A"] | #fff | | innerItemColor | array | false | Inner list item's background color, applied to each board in the passed order | ["#FFE0B2", "#B3E5FC", "#DCEDC8"] | #fff | | roundedCorners | boolean | false | Toggle between rounded corners | true | false | | innerItemsroundedCorners | boolean | false | Toggle between rounded corners | true | false | | showKeyIndex | boolean | false | Make the list items as numbered lists | true | false |

Release History

  • 0.1.0
    • Render Boards | Stateful List Items | Drag and Drop List Items

Author

Raghavendran Ramesh (BeardDude)

[email protected]

Distributed under the MIT license. See LICENSE for more information.

License

MIT License

References

This component has been created only because of the availability of some cool references that are listed below,

  1. Polyfills for touch devices - https://github.com/Bernardo-Castilho/dragdroptouch
  2. Bulma - https://www.bulma.io
  3. Drag and Drop Implementation - https://github.com/rajeshpillai/youtube-react-components/blob/master/src/AppDragDropDemo.js