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

@divyagupta261/react-ui-components

v0.0.0

Published

This is a library of reusable UI components built with React, TypeScript, and TailwindCSS. It uses Vite for development and build processes, and includes Storybook for component documentation and visual testing.

Downloads

1

Readme

React UI Components

This is a library of reusable UI components built with React, TypeScript, and TailwindCSS. It uses Vite for development and build processes, and includes Storybook for component documentation and visual testing.

Table of Contents

Cloning the Repository

To clone the repository, run:

git clone https://github.com/DivyaGupta261/react-ui-components.git
cd react-ui-components

Installation

To install the dependencies, run:

npm install

Starting your own Component Library

If you want to start your own component library based on this template:

1. Clone the repository as mentioned above. 2. Remove the existing Git origin:

```bash
git remote remove origin
```

3. Create a new repository as you normally would do, on GitHub or any other Git hosting service.

4. Add the new repository as the origin:

```bash
git remote add origin <your-repository-url>
```

5. Push the code to the new repository:

git push -u origin main

Development

To start the development server with Vite:

npm run dev

Build

To build the library for production:

npm run build

This will compile TypeScript and bundle the project using Vite.

Linting and Formatting

To lint the project using ESLint:

npm run lint

To format the project using Prettier:

npm run format

Linting and formatting are also automatically run on staged files before each commit using Husky and lint-staged.

Testing

To run the tests once:

npm run test

To run the tests in watch mode:

npm run test-watch

To run the UI test interface with Vitest:

npm run test:ui

Storybook

To start Storybook server:

npm run storybook

To build the Storybook static site:

npm run build-storybook

Creating a New Component

To create a new component, use the following command:

npm run create-component <ComponentName>

This will create a new component in the src/components directory, along with a test file and a story file.

Modifying the Component Template

To modify the template files used when creating a new component, navigate to the scripts/templates directory and modify the files as needed. These templates are used by the create-component script to generate new component files.

Using the library in another project

To use the library locally in your other React projects, refer to this blog here

Pre-commit Hook

This project uses Husky to run a pre-commit hook that ensures code quality by running lint-staged on staged files. The pre-commit hook is defined as follows:

#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged

This script ensures that all staged files are linted and formatted and tests are run, before they are committed.

Contributing

Contributions are welcome! Please follow these guidelines when contributing:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/your-feature).
  3. Commit your changes (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature/your-feature).
  5. Open a pull request.

License

This project is licensed under the MIT License.

Feel free to use the components in this library in your own projects!