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

zh-ui-library

v1.0.0

Published

Component based UI Library created using react.js and bootstrap

Downloads

3

Readme

ZH-UI-Library

A library of UI components created using react.js and bootstrap.

Installation

Run the following command: npm install zh-ui-library --save

Dependecies

Bootswatch (a variation of the bootstrap framework). For more info please visit https://bootswatch.com

How to use

Import these files in the index.js file

import 'bootswatch/dist/<theme of your choice>/bootstrap.min.css';
import 'zh-ui-library/dist/<name of component you want to use>';

List of UI Components currently available

Dynamic Form

Takes the following props attributes:

  1. formInputs: takes an object.
  2. changed: takes input event handler function to set/update form input values.
  3. sort(boolean value accepted): true or false.
  4. formStyling: takes style object.
  5. submit: takes submit handler function to submit the data.

Currently the form supports dropdowns, date field, number field, text field, password field, email field, textareas and check-boxes.

Use case example:

this.state = {
	formInputs: {
		name: {
			elementType: 'input',
			elementConfig: {
			  type: 'text',
			  value: '',
			  placeholder: 'Name',
			  id: 'name',
			  className: 'form-control'
			}
		},
		usCitizenship: {
		  elementType: 'select',
		  label: 'US Citizenship',
		  elementConfig: {
		    value: 'Please select one',
		    id: 'usCitizenship',
		    className: 'form-control' 
		  },
		  options: [
		    {value: 'Please select one', displayValue: 'Please select one', disabled: true},
		    {value: 'Yes', displayValue: 'Yes', disabled: false},
		    {value: 'No', displayValue: 'No', disabled: false}
		  ]
		},
		description: {
		  elementType:'textarea',
		  label: 'Description',
		  elementConfig: {
		    value: '',
		    id:'description',
		    placeholder: 'Please enter description...',
		    className: 'form-control'
		  }
		}
	};
};

Finally call the component

<Form formInputs={this.state.formInputs} changed={this.inputChangeHandler.bind(this)} sort={true} formStyling={{topPadding: '20px'}} submit={this.submitDataHandler.bind(this))}/>

Flash Message

Takes the following props attributes:

  1. message: Displayed Message srting.
  2. messageType: One of these strings 'success', 'warning', 'primary', 'danger', 'info', 'secondary' or 'light'.
  3. dismiss: takes dismiss handler to set message and messageType to null in the state of the parent component.

Use case example:

state = {
	flashMessage: {
		message: 'Thank You!',
		messageType: 'success'
	}
};

closeFlashHandler = () => {
	this.setState(flashMessage: {message: null, messageType: null});
}

Finally call the component

<FlashMessage message={this.state.flashMessage.message} messageType={this.state.flashMessage.messageType} dismiss={this.closeFlashHandler.bind(this)}/>

Pagination

Takes the following props attributes:

  1. links: Array of objects
  2. pageChange: takes page change handler function to change the page and query data.
<Pagination links={this.state.links} pageChange={this.pageChangedHandler} />