1.3.2 • Published 2 years ago

react-github-embed v1.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

How to Install

npm i react-github-embed

Get your Personal Access Token by signing in to your github account and then go to your setting -> developer setting -> Personal access tokens -> Generate new token. Add it to .env file in the root directory.

REACT_APP_GITHUB_TOKEN = <YOUR_GITHUB_TOKEN>

Demo & Playground

Demo & Playground

Components

Repository

import React from 'react';
import { Repository } from 'react-github-embed';

const RepositoryCard = () => {
  return (
    <div>
      <Repository
        username="facebook"
        repository="react"
        theme="light"
        showStarCount={true}
        showForkCount={true}
        showLanguage={true}
        showDescription={true}
        showType={true}
      />
      <Repository username="Mridul2820" repository="css-js" theme="light" />
      <Repository
        username="Mridul2820"
        repository="next-template"
        theme="dark"
      />
    </div>
  );
};

export default RepositoryCard;

Options

PropertyTypeDescription
username(required)stringUsername of the Github User
repository(required)stringRepository of the Github User
themestringTheme of the card "light" or "dark"Deafults to "light"
showStarCountboolWhen true, shows the total star count of repository.Defaults to true
showForkCountboolWhen true, shows the total fork count of repository.Defaults to true
showLanguageboolWhen true, shows the main language of repository.Defaults to true
showDescriptionboolWhen true, shows the description of repository.Defaults to true
showTypeboolWhen true, shows the type of repository.Public template Private template Private Public ForkedDefaults to true

Star Count

import React from 'react';
import { StarCount } from 'react-github-embed';

const StarCountCard = () => {
  return (
    <StarCount
      username="facebook"
      repository="react"
      theme="light"
      iconText="Star"
      formatNumber={true}
    />
  );
};

export default RepositoryCard;
PropertyTypeDescription
username(required)stringUsername of the Github User
repository(required)stringRepository of the Github User
themestringTheme of the card "light" or "dark"Deafults to "light"
iconTextstringText to display on the card.Defaults to Star
formatNumberboolWhen true, shows the total star count formatted.Defaults to true

Fork Count

import React from 'react';
import { ForkCount } from 'react-github-embed';

const ForkCountCard = () => {
  return (
    <ForkCount
      username="facebook"
      repository="react"
      theme="light"
      iconText="Fork"
      formatNumber={true}
    />
  );
};

export default RepositoryCard;
PropertyTypeDescription
username(required)stringUsername of the Github User
repository(required)stringRepository of the Github User
themestringTheme of the card "light" or "dark"Deafults to "light"
iconTextstringText to display on the card.Defaults to Star
formatNumberboolWhen true, shows the total fork count formatted.Defaults to true

Browser Compatibility

BrowserWorks?
ChromeYes
FirefoxYes
SafariYes
IE 11Yes

Pull requests are welcome!

See CONTRIBUTING.md for more information.

License

MIT

1.3.2

2 years ago

1.3.1

2 years ago

1.2.9

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago