Skip to content

Commit 7023f10

Browse files
committed
v1
1 parent fbbab7c commit 7023f10

File tree

8 files changed

+2791
-0
lines changed

8 files changed

+2791
-0
lines changed

README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,71 @@
11
# react-github-languages
22
A React component to display a repository's used languages (just like Github does).
3+
4+
<div style="text-align:center"><img src="public/demo.png" /></div>
5+
6+
## How to use
7+
Install from package registry:
8+
```
9+
// NPM
10+
npm install --save react-github-languages
11+
12+
// Yarn
13+
yarn add react-github-languages
14+
```
15+
Import into your project:
16+
```
17+
import GithubLanguages from 'react-github-languages'
18+
```
19+
20+
You can also import the type definitions:
21+
```
22+
import GithubLanguages, { GithubLanguagesProps } from 'react-github-languages'
23+
```
24+
25+
## Available props
26+
27+
```
28+
repository: string (required): The Github repository to display values from.
29+
width: number (required): The width of the component.
30+
textColor: string (optional) (default: "black"): Text color.
31+
lightColor: string (optional) (default: "gray"): Percentage text color.
32+
```
33+
34+
### Example configuration:
35+
```typescript
36+
// your-component.jsx
37+
38+
import GithubLanguages from 'react-github-languages'
39+
40+
const YourComponent() => (
41+
<GithubLanguages
42+
repository="willdavsmith/react-github-languages"
43+
width={300}
44+
/>
45+
)
46+
47+
const YourDarkModeComponent() => (
48+
<GithubLanguages
49+
repository="willdavsmith/react-github-languages"
50+
width={500}
51+
textColor: "white"
52+
lightColor: "#aaa"
53+
/>
54+
)
55+
```
56+
57+
## Development
58+
59+
Clone the repository:
60+
```
61+
git clone https://github.com/willdavsmith/react-github-languages.git
62+
```
63+
Install dependencies:
64+
```
65+
npm i
66+
```
67+
Build with Rollup:
68+
```
69+
npm run-script build
70+
```
71+
To test, use `npm link`.

0 commit comments

Comments
 (0)