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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gbg/gbgcomponentlibrary_react

v6.0.0

Published

## Usage

Readme

GBG Component Library for React

Usage

First, install the GBG component library and GBG component library using the package manager of your choice

# yarn
yarn add @gbg/gbgcomponentlibrary @gbg/gbgcomponentlibrary_react

# npm
npm install @gbg/gbgcomponentlibrary @gbg/gbgcomponentlibrary_react

You must include the GBG component library css files and assets in your React App when using these components, e.g.

// Main.jsx
import React from 'react';
import App from './app';
import '@gbg/gbgcomponentlibrary/dist/gbgcomponentlibrary.min.css';

...

Then in your React display components include the library components you wish to use

// MyCustomButton.jsx
import React from "react";
import { Button, ButtonKind } from "@gbg/gbgcomponentlibrary_react";

const MyCustomButton = ({ onClick, children }) => (
  <Button kind={ButtonKind.Tertiary} onClick={onClick}>
    {children}
  </Button>
);

export default MyCustomButton;

For a full list of exported components please visit https://ds.gbgplc.com/react/

Contributing

Pre-requisites

node v14 is required to develop in this repository - we reccomend using a node version manager, we like nvm, but your environment is your environment!

Setting up your environment

First ensure you have cloned this repository and installed the requirements using npm ci in your terminal.

Ensure that you have storybook running with npm run storybook and your tests are running npm run test:watch

Creating new components.

New components should conform to the GBG Design System and should follow the principles of writing tests to cover component use cases of inversion of control.

Our components are organised following atomic design, so should be organised under Atoms, Molecules, Templates and Base

Anatomy of a component

Each component should follow this structure

📂 MyComponent/ // Note the capitalisation
| 📄 MyComponent.snippets.js // usage code snippets
| 📄 MyComponent.stories.tsx // examples for storybook
| 📄 MyComponent.test.tsx    // the tests for your components
| 📄 MyComponent.tsx         // the file containing your component and type definitions
| 📄 index.tsx               // the public exports for this component

All components should be exported from the root index file (src/index.ts), and the index file for it's organising folder (eg. src/Atoms/Atoms.ts)

Your component must include storybook stories and have complete usecase coverage in its test cases.

Do not include the global GBGComponentLibrary.css file in your component!

Testing your component

Ensure that your tests cover

  1. Basic accessibilty tests.
it("should not have basic a11y issues", async () => {
  const { container } = render(<MyComponent />);
  const results = await axe(container);
  expect(results).toHaveNoViolations();
});
  1. Cover the use cases for your component. Think about how you would want to use this component in your projects, write tests that prove it works this way.

If you find you are writing complex tests or too many tests, you trying to do too much with this component? Could this component be broken into smaller units?

Submitting your changes

When you are ready to contribute your changes, ensure that you have a clear, clean branch containing only the changes you wish to contribute, and that the tests are passing for your component, push this branch and Raise a PR.

Raising a PR

Ensure that your PR includes the following

  • A clear title.
  • What is your PR doing.
  • A clear description of the problem you are trying to solve.
  • Any notes to help the reviewer.

It must include tests covering your changes.