Giter VIP home page Giter VIP logo

common-react's Introduction

Common React

The goal of this package is not to be installed!

This package is a collection of common React components and utilities that are used across multiple projects. It is not meant to be installed as a dependency, but rather to be copied and pasted into new projects as needed.

Just take the component you need and paste it into your project. You can then modify it as needed.

Use cases

I would recommend using this package in the following cases:

  • You are doing a side project that will take some years, and you don't want to depend on a package that may be abandoned.
  • You are working on a project and don't want to depend on visual packages that needs to be tweaked

I would not recommend using this package in the following cases:

  • big projects
  • projects that need to be maintained by a team of developers
  • projects that need to be updated frequently

Setup

The basic set that is used by the package is the follow.

important: the following is a template and should can modified to almost any react project.

The only things you need are:

  • React 18^
  • Tailwind CSS

The rest including Typescript, ESLint, Prettier, and Vite are optional, at least for the basic setup.

Requirements:

  • Node.js v20.x
npm install

Development

npm run dev

Build

run the following command to build the application:

npm run build

The build will create a dist directory with the built files.

Testing

Based on the current configuration, the unit tests are run using Vitest. To run the tests, run the following command:

npm run test

Development tools and features

Typescript

The application is built using Typescript. The types are defined in the src/modles directory. explicit any is allowed in the codebase.

Linting and formatting

  • eslint is used for linting the code.
  • prettier is used for code formatting (prettier is defined as an eslint plugin).
  • vite is used as the build tool. The configuration is defined in the vite.config.js file. The different environments are defined in the env files such as env.development and env.production.

App Configuration file

The app configuration file is located in the src/configuration directory. The configuration file is uses the values from the env files and return a configuration object.

Style

  • Some of the components mainly buttons and inputs are styled using Tailwind CSS.
  • Some component are styled using CSS modules - usually the more complex / experimental styles.
  • some styles are still exprimental like the @starting-style, and components that use the native html modal and popover.

common-react's People

Contributors

chenpeleg avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.