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 🙏

© 2025 – Pkg Stats / Ryan Hefner

egw-react-components

v1.3.4

Published

Custom React Components

Readme

EGW Custom React Components Library

Purpose

There is not much to say... this is a library that I built to reuse my custom components in my projects, and I humbly share with you. This is not a complete library with a lot of components, and I think that it will never be completed. I will updates components as I need to use it, or I have and new idea of component to reuse.

Philosophy

I will develop this library following the Atomic Desing philosophy. atomic-design-web

Development notes

If you checkout this project at first time, after doing npm install you have to do npm build:dev, this will set up the proper files ready to be working in a local enviroment. (By now this script just generate a local .css file in the same folder of the component that will be not pushed).

Install it

npm i egw-react-components

How to view the components

To get a view of the component's behavior execute: npm run gallery

This will run an app called storybook that opens a new browser tab that displays different cases of each components that lets you intereact with them.

How to use the components in your projects

Components Description

import { NameOfComponent } from 'egw-react-components'

Atoms

DraggableButton

Renders a button that allow you to drag and drop in the browser window limited to the body tag.

Props

Either both or one of them needs to be present in order to render the button correctly. If both are present the icon will be displayed and then the text in line.

  • defaultPosition - An object that represents the initial position of the button. {x: number, y: number }
  • style - Custom css-based style object.
  • onClick - Function it is executed when the object is clicked.
  • onStart - Function it is executed when the object is started to be dragged.
  • onDrag - Function it is executed every time the object is being dragged.
  • onStop - Fucntion it is executed when the object is dropped.

RoundedImage

Renders an image which is rounded. With three differents sizes: small, medium and large.

Props
  • src - The URL of the image you want to display.
  • size - The size of the image.
  • style - Custom css-based style object.

ToggleSwitch

Renders a styled checkbox simil to ios switch. It is useful to represent when something is activated or not.

Props
  • enabled - Initial state of the component.
  • theme - Builtin styles. If this prop is not passed "default" theme is applied which is like ios switch toggle.
  • onClick - Function to apply when the toggle is clicked.
  • onStateChanged - Function to apply when the 'enabled' prop is changed.

IconProvider

Wraps the FontAwesomeIcon component, in order to import the icon labrary only one time and reuse it anywhere.

Props
  • iconName - The name of the icon to render.

Molecules

TextAndSubmit

Renders a text input and a button in a line that let the user to submit and make something with the entered text.

Props
  • isVisible - Points if the component is visible or not.
  • placeholder - Fake text indicates the purpose of the text content.
  • submitText - Text goes in the submit button.
  • theme - Predefined theme available to apply. (default or danger by now).
  • formStyle - Custom from style.
  • inputStyle - Custom input style.
  • btnStyle - Custom button style.
  • onSubmit - Custom function to apply on submit event.

LoginForm

Simple login form with username and password input.

Props
  • usernamePlaceholder - Guiding text to show in the username input.

  • passwordPlaceholder - Guiding text to show in the password input.

  • sumitText - Guiding text to show in the submit button

  • theme - Indicates the style to apply in the whole component

  • onSubmit - Custom function to execute when the form is submitted

Third party libraries

I used this libraries to create the components:

Licence ISC