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

@gerrico/react-components

v0.1.27

Published

This library provides a list of useful components for React projects

Downloads

87

Readme

React Components

This library provides a list of useful components for React projects

Install

To install the library, run this command:

npm install @gerrico/react-components

Index

BubbleLoader

A loader with twelve bubbles that increase and decrease their size.

Alt Text

Props

| Name | Description | Type | Required | Default | | ----------- | ---------------------------------------------------------------------- | ------ | -------- | --------- | | left? | Set the distance from the left margin | string | No | | | top? | Set the distance from the top margin | string | No | | | bubbleSize? | Set the size of the bubbles (the size of the component doesn't change) | number | No | 1 | | color? | The color of the bubbles | string | No | #DDD | | className? | Provide other style | string | No | undefined |

Example

import React from "react";
import { BubbleLoader } from "./components";

const App = () => {
  return (
    <div>
      <BubbleLoader left="50vw" top="50vh" color="#20E080" />
    </div>
  );
};

export default App;

BounceLoader

A loader with three bouncing balls.

Alt Text

Props

| Name | Description | Type | Required | Default | | ---------- | ------------------------------------- | ------ | -------- | --------- | | left? | Set the distance from the left margin | string | No | | | top? | Set the distance from the top margin | string | No | | | size? | A multiplying factor for balls size | number | No | 1 | | color? | The color of the balls | string | No | #DDD | | className? | Provide other style | string | No | undefined |

Example

import React from "react";
import { BounceLoader } from "./components";

const App = () => {
  return (
    <div>
      <BounceLoader left="50vw" top="50vh" color="#2080E0" size={0.8}/>
    </div>
  );
};

export default App;

RadarLoader

A loader that simulates a radar signal

Alt Text

Props

| Name | Description | Type | Required | Default | | ---------- | ------------------------------------------------- | ------- | -------- | --------- | | left? | Set the distance from the left margin | string | No | | | top? | Set the distance from the top margin | string | No | | | size? | A multiplying factor for radar size | number | No | 1 | | color? | The color of the radar | string | No | #be97e8 | | fill? | Only border (if false) or entire circle (if true) | boolean | No | false | | className? | Provide other style | string | No | undefined |

Example

import React from "react";
import { RadarLoader } from "./components";

const App = () => {
  return (
    <div>
      <RadarLoader left="50vw" top="62vh" size={1} fill={false} />
    </div>
  );
};

export default App;

Selector

A button to toggle between states.

Alt Text

Props

| Name | Description | Type | Required | Default | | ---------- | --------------------------------------------------------- | -------- | -------- | --------- | | id | Unique id for the component | string | Yes | | | status | The status of the selector (false -> left, true -> right) | boolean | Yes | | | onClick | Action to perform | function | Yes | | | colorOff? | The color of the selector while is off | string | No | #444 | | colorOff? | The color of the selector while is on | string | No | #444 | | textColor? | The color of the text inside the selector | string | No | #FFF | | disabled? | If true, the selector is disabled | boolean | No | false | | className? | Provide other style | string | No | undefined |

Example

import React, { useState } from "react";
import { Selector } from "@gerrico/react-components";

const App = () => {
  const [status, setStatus] = useState(false);

  return (
    <div>
      <Selector
        id="selector"
        status={status}
        onClick={() => {
          setStatus(!status);
        }}
        items={["OFF", "ON"]}
        colorOff="#2080B0"
        colorOn="#20B080"
      />
    </div>
  );
}

export default App;

Checkbox

A simple and custom checkbox

Alt Text Alt Text

Props

| Name | Description | Type | Required | Default | | ---------- | ---------------------------------- | -------- | -------- | --------- | | onClick | Action performed after clicking it | function | Yes | | | text? | Custom text for the checkbox | string | No | | | disabled? | If true, the component is disabled | boolean | No | false | | className? | Provide other style | string | No | undefined |

Example

import React, { useState } from "react";
import { Checkbox } from "@gerrico/react-components";

const App = () => {
  const [status, setStatus] = useState(false);

  return (
    <div>
      <Checkbox
        status={status}
        onClick={() => {
          setStatus(!status);
        }}
        text="Checkbox"
      />
    </div>
  );
}

export default App;

Button

A simple button with background color selection and automatic text color.

Alt Text

Props

| Name | Description | Type | Required | Default | | ---------- | --------------------------------------------------------------------------------------------------- | -------- | -------- | --------- | | onClick | Action performed after clicking it | function | Yes | | | color | Background color for the button (text color is always black or white, based on the background color | string | No | #2090F0 | | disabled? | If true, the button is disabled | boolean | No | false | | className? | Provide other style | string | No | undefined |

ATTENTION: currently, the color prop must be in hex format (#RRGGBB). This is due to the calculation of the text color. In future, there will be the possibility to set the color by:

  • picking it from a list of standard colors (primary, info, warning, danger, etc.)
  • writing the exact color (red, blue, green, etc.)
  • by entering the color coding (rgb, hsl, etc.)

Example

import React from "react";
import { Button } from "./components";

const App = () => {
  return (
    <div>
      <Button onClick={() => alert("Pressed!")}>Press Me!</Button>
    </div>
  );
};

export default App;

Dropdown

A dropdown control for items selection.

| | | | ---------------------------------------- | ------------------------------------------ | | Alt Text | Alt Text |

Props

| Name | Description | Type | Required | Default | | ---------- | ------------------------------------------------------------------------------------------------- | -------- | -------- | ---------- | | items | Array of items to show (props for items are described below) | array | Yes | | | title? | The string to show inside the control. If not set, the selected values is shown | string | No | First item | | selected? | The index of the selected item | number | No | 0 | | onSelect? | Action to perform after selecting an item. It returns the text and the index of the selected item | function | No | | | disabled? | If true, the dropdown is disabled | boolean | No | false | | className? | Provide other style | string | No | undefined |

Each item of the array can have these props:

| Name | Description | Type | Required | Default | | --------- | -------------------------------------------------------------------------------- | -------- | -------- | ------- | | text? | The text of the item | string | No | | | checkbox? | Set if the item is a normal string or a checkbox | boolean | No | false | | status? | The status of the checkbox (if checkbox is true) | boolean | No | false | | onSelect? | Action to perform after selecting a checkbox item | function | No | | | disabled? | If true, the item is disabled | boolean | No | false | | header? | If true, the item has a different style and it cannot be selected | boolean | No | false | | divider? | A line that divides the previous and the following item. Other props are ignored | boolean | No | false |

Example

import React from "react";
import { Dropdown } from "./components";

const App = () => {
  const [dropdownSelected, setDropdownSelected] = useState(0);

  const onChangeDropdownValue = (value, index) => {
    // `values` is the text of the item
    // `index` is the index of the item
    setDropdownSelected(index);
  };

  return (
    <div>
      <Dropdown
          items={[
            {
              text: "London",
            },
            {
              text: "Berlin",
            },
            {
              text: "Paris",
            },
            {
              text: "New York",
            },
            {
              text: "Rome",
            }
          ]}
          onSelect={onChangeDropdownValue}
          selected={dropdownSelected}
        />
    </div>
  );
};

export default App;