1.2.0 • Published 3 years ago

react-repo-widget v1.2.0

Weekly downloads
29
License
MIT
Repository
github
Last release
3 years ago

react-repo-widget License: MIT Ask Me Anything !

forthebadge forthebadge

A beautiful card that displays Github repository infos.

Demo Show

  • Online Demo Website

  • Local

    git clone https://github.com/saj96n/react-repo-widget.git
    cd react-repo-widget
    npm i
    npm start

    open localhost:3001

How to Use 🍕

  1. Install

    npm i react-repo-widget
  2. Import one component

    import { RepoCard } from "react-repo-widget"; // Pass repo data to the component
    import { RepoCardFetch } from "react-repo-widget"; // Fetch data from the GitHub
    
    import "react-repo-widget/dist-esm/styles.css";
  3. Use

    <RepoCardFetch login={username} reponame={repository}>

    or

    <RepoCard repo={repoData} />

    repo prop data structure:

    repo: {
      name: string;
      owner: {
        avatarUrl: string;
        login: string;
      }
      description: string;
      forks: {
        totalCount: number;
      }
      primaryLanguage: {
        name: string;
      }
      licenseInfo: {
        spdxId: string;
      }
      pushedAt: string;
      stargazerCount: number;
      watchers: {
        totalCount: number;
      }
    }

Settings 🔨

ParameterTypeDefaultDescription
loginString""GitHub username. Required for RepoCardFetch component!
reponameString""Repository name. Required for RepoCardFetch component!
repoObject""Repository data. Required for RepoCard component!
classNameString"repo-widget"Widget className
centerBooleanfalseIf card is aligned center.
squareAvatarBooleanfalseIf avatar is displayed with square outline.
descriptionLineNumber2The maximum line of repo description.
showLanguageBooleantrueIf the repo language is displayed.
showLicenseBooleantrueIf the repo license is displayed.
1.2.0

3 years ago

1.1.0

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago