npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-repo-card-v2

v0.0.2

Published

A React component for the GitHub repository card

Downloads

7

Readme

react-repo-card-v2

The RepoCard component is designed to display GitHub repository information in a clean, visually appealing card format. It supports both light and dark modes and can show various repository details, including stars, forks, license information, and last update time.

Features

  • Display GitHub repository details.
  • Customizable to show/hide specific information.
  • Supports dark and light themes.
  • Responsive design.
  • Direct integration with GitHub repository API data.

Installation

npm install react-repo-card-v2
# or
yarn add react-repo-card-v2

Usage

First, import the RepoCard component in your React project:

import { RepoCard } from 'react-repo-card-v2';

Direct API Use

The RepoCard component is designed to seamlessly integrate with the GitHub Repository API. You can directly pass the JSON response from the GitHub API to the repository prop of the RepoCard. This makes it incredibly easy to display repository information fetched from GitHub.

For example, after fetching data from the GitHub API:

<RepoCard
  repository={{
    name: 'Example Repository',
    description: 'This repository is an example of how to use the RepoCard component.',
    language: 'JavaScript',
    updated_at: '2023-01-01T00:00:00Z',
    html_url: 'https://github.com/yourusername/your-repository',
    license: { name: 'MIT' },
    open_issues_count: 10,
    stargazers_count: 100,
    forks_count: 20,
  }}
  showCodeLanguage={true}
  showLicense={true}
  showIssues={true}
  showStars={true}
  showForks={true}
  showUpdatedAt={true}
  showCodeColorBar={true}
  repoInfoColor="grey"
  darkMode={false}
/>

Props

| Prop | Type | Description | Default | | ------------------ | --------- | ----------------------------------------------------------------------------------------- | -------- | | repository | Object | The JSON response object from the GitHub repository API. No need for manual data mapping. | - | | showCodeLanguage | boolean | Show the primary language of the repository. | true | | showLicense | boolean | Show the license information. | true | | showIssues | boolean | Show the number of open issues. | true | | showStars | boolean | Show the star count. | true | | showForks | boolean | Show the fork count. | true | | showUpdatedAt | boolean | Show the last update timestamp. | true | | showCodeColorBar | boolean | Show a color bar representing the code language. | true | | repoInfoColor | string | Text color for the repository information. | 'grey' | | darkMode | boolean | Enable dark mode for the card. | false |

Customization

You can customize the appearance of the RepoCard by using the repoInfoColor and darkMode props. Additionally, you can choose which pieces of information to display by setting the corresponding props to true or false.

Contributing

We welcome contributions to improve this component! Please feel free to submit issues or pull requests to our GitHub repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.