Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gsharath/react-component-library-vite
https://github.com/gsharath/react-component-library-vite
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/gsharath/react-component-library-vite
- Owner: gsharath
- Created: 2024-01-21T04:32:28.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-01-21T12:05:31.000Z (10 months ago)
- Last Synced: 2024-08-02T19:36:29.649Z (3 months ago)
- Language: JavaScript
- Size: 205 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- fucking-awesome-vite - react-component-library-vite - A library template for with `React`, `Javascript`,`Styled-Components`, `Vitest`, `React Testing Library`, `Storybook`. (Get Started / Templates)
- awesome-vite - react-component-library-vite - A library template for with `React`, `Javascript`,`Styled-Components`, `Vitest`, `React Testing Library`, `Storybook`. (Get Started / Templates)
README
# Create library using react
- This template provides a minimal setup to create a library in React using Vite.
- This uses styledcomponents for styling
- It uses javascript. Typescript also can be configured easily by adding relevant libraries.## Publishing the library
Publish the library using the below command
```bash
npm run publish:lib
```## Installation
Once you have published the repo to npm, Install react-component-library-vite with npm. Feel free to change the name in package.json.
```bash
npm install react-component-library-vite
```## Usage/Examples
Example 1:
```javascript
import { Button} from 'react-component-library-vite/components';Primary
```Example 2: Assume we are having common styles which should be applied to any application that uses this library, we can export a css and use that in our project as below.
I have a customstyles.css file in my library, which I am importing in my project as:```javascript
import 'react-component-library-vite/customstyles.css'
```## Test cases
You can run test cases with the below command
```bash
npm run test
```## Storybook
Basic storybook setup is also present and it can be run using below command
```bash
npm run storybook
```