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

@matthew-stanley/react-component-library

v0.0.4

Published

A react component library

Downloads

3

Readme

React Component Library

A simple Component Library

Components

Text Input

import {TextInput} from @matthew-stanley/react-component-library.

The Text Input component can be used as quick way to get form text inputs up & running within your project. This component offers validation and comes with built in regular expressions to test the inputted value. It will function on it's own right out the box or can be customized to fit your needs as a developer.

A Demo of the Components can be found at the following link.

Matthew Stanley - React Component Library

| Props | Type | Description | | ---------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | label | String | Text that would display for the input's label. If you would like to remove this element pass in a value of null | | labelAttributes | Object | If you have any html attributes you would like to pass on to the label element, they can be added as an object here. | | componentID | String | This will be used as the id of the input html element | | value | String | If a value for this input already exists then it should be placed here. Default will be an empty string. | | placeholder | String | Text that appears in input when it has no value set. | | onChangeCallBack | Function | You can pass a function here. If you would like a function to be called with the input value's change. An example for this is passing the user input value on to a separate component. | | inputAttributes | Object | If you have any html attributes you would like to pass on to the input element, they can be added as an object here. | | validate | Boolean | Set to true if you would like to validate the user's input. The user's input would can be validated using the component's built in Regex or utilize a customRegex. Default false. | | regexType | String | The TextInput Component offers a couple of built in Regular Expressions that can be used to validate the user's input. The options are personName, email and postalCode. See below for more information about the available options. | | customRegex | Regex | If you would like to use your own Regular Expression, you can use this prop to submit it here. This will override the value for RegexType | | optional | boolean | Default set to false. Text components with optional set to true, will accept blank values, even if validate is set to true. | | errorMessage | String | If the validate is set to true, then an error message will appear if the user's input value does not pass the Regular expression being used. | | errorMessageAttributes | Object | If you have any html attributes you would like to pass on to the error message paragraph element, they can be added as an object here. | | containerClassName | String | The class name of the div element wrapping the entire component. |

Form

import {Form} from @matthew-stanley/react-component-library.

The Form component is can automatically recognize when a component from the same library is a child of the form & automatically collect the data and run validation on Submit. The default Form is empty with the exception of a the submit button

| Props | Type | Description | | ---------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | formID | String | The id for the form element. This is required in order for the Form component to function correctly. | | initialFormState | Object | If you are providing initial values for any of the Form component's children, you can pass them in this object. Ex. {formValues: {firstName: "Matthew", lastName: "Stanley", email: "[email protected]"}} | | formAttributes | Object | If you have any additional html attributes you would like to pass on to the HTML form element within the component, they can be added as an object here. | | onSubmit | Function | This function gets called when the user presses submit and if the form does not have any errors. | | groupErrors | Boolean | Default: false. If this prop is set to true, all error messages will be grouped into one message that displays at the bottom of the form. | | onChangeCallBack | Function | You can pass a function here. If you would like a function to be called with the input value's change. An example for this is passing the user input value on to a separate component. | | errorMessage | String | This is the error message that will display if there is an error within the Form and groupErrors has been set to true. | | |