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-bootstrap4-ribbon

v0.1.2

Published

A Microsoft's ribbon-like menu for React using Bootstrap 4

Downloads

2

Readme

React Bootstrap 4 Ribbon

A responsive Microsoft's ribbon-like menu for React using Bootstrap 4, forked from and inspired by LGK's excellent work doing the same thing on Bootstrap 3. See a demo.

Installation

Add it using npm npm i react-bootstrap4-ribbon.

Next, import the components:

import  { Ribbon, RibbonGroup, RibbonGroupItem, RibbonButton }  from  "react-bootstrap4-ribbon";

Also, you need to import the styling file:

import  "react-bootstrap4-ribbon/dist/react-bootstrap-ribbon.css";

Components

Ribbon

Main container. Provides responsiveness to it. When in small screens, shows a combobox containing the titles from all groups it has in it.

RibbonGroup

A group maintains RibbonGroupItems together. Aligns items by using flex row. It has the following properties:

  • title: appears on the group's footer (and also on the ribbon's combobox, in small screens);
  • colClass: you can pass Bootstrap responsive col classes to this property, to customize how much space the group will take. The default is col, which means the group will take all the space available in all screen sizes.

RibbonGroupItem

A group item is where you put your buttons. It has a single property:

  • direction: Determine which flex orientation your group buttons will follow (row | column). Defaults to row.

RibbonButton

A Bootstrap light block button. Has a title and an icon, that you can import from the package and pass to it as children or by compounding them into the button (as shown in Usage).

RibbonButtonTitle | RibbonButtonIcon

Names are self-describing. Put these inside the button. Both have the following boolean properties, which also are self-describing:

  • small | inline

Usage

This is the code from demo's simple ribbon (icons by Font Awesome):

<Ribbon>
  <RibbonGroup  title="Clipboard"  colClass="col-md-4">
    <RibbonGroupItem>
      <RibbonButton>
        <RibbonButton.Icon>
          <i  className="fas fa-thumbtack"></i>
        </RibbonButton.Icon>
        <RibbonButton.Title>Pin</RibbonButton.Title>
      </RibbonButton>
      <RibbonButton>
        <RibbonButton.Icon>
          <i  className="fas fa-copy"></i>
        </RibbonButton.Icon>
        <RibbonButton.Title>Copy</RibbonButton.Title>
      </RibbonButton>
      <RibbonButton>
        <RibbonButton.Icon>
          <i  className="fas fa-paste"></i>
        </RibbonButton.Icon>
        <RibbonButton.Title>Paste</RibbonButton.Title>
      </RibbonButton>
    </RibbonGroupItem>
  </RibbonGroup>
  <RibbonGroup  title="New"  colClass="col-md-5">
    <RibbonGroupItem>
      <RibbonButton>
        <RibbonButton.Icon>
          <i  className="fas fa-folder-open"></i>
        </RibbonButton.Icon>
        <RibbonButton.Title>New folder</RibbonButton.Title>
      </RibbonButton>
    </RibbonGroupItem>
    <RibbonGroupItem  direction="column">
      <RibbonButton>
        <RibbonButton.Icon  small  inline>
          <i  className="fas fa-file">&nbsp;</i>
        </RibbonButton.Icon>
        <RibbonButton.Title  inline  small>
          New file
        </RibbonButton.Title>
      </RibbonButton>
      <RibbonButton>
        <RibbonButton.Icon  small  inline>
          <i  className="fas fa-inbox">&nbsp;</i>
        </RibbonButton.Icon>
        <RibbonButton.Title  inline  small>
          Easy access
        </RibbonButton.Title>
      </RibbonButton>
    </RibbonGroupItem>
  </RibbonGroup>
  <RibbonGroup  title="Select"  colClass="col-md-3">
    <RibbonGroupItem  direction="column">
      <RibbonButton>
        <RibbonButton.Icon  small  inline>
          <i  className="fas fa-check-square">&nbsp;</i>
        </RibbonButton.Icon>
        <RibbonButton.Title  small  inline>
          Select all
        </RibbonButton.Title>
      </RibbonButton>
      <RibbonButton>
        <RibbonButton.Icon  small  inline>
          <i  className="fas fa-check">&nbsp;</i>
        </RibbonButton.Icon>
        <RibbonButton.Title  small  inline>
          Toggle selection
        </RibbonButton.Title>
      </RibbonButton>
    </RibbonGroupItem>
  </RibbonGroup>
</Ribbon>

Run an example

  • Clone this repo;
  • install all dependencies by running npm i;
  • cd into test-app and install all dependencies too;
  • run npm start inside test-app to see a demo.