1.0.9 • Published 7 months ago

repowidget v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

GitHub Repository Widget

A lightweight, customizable widget to showcase GitHub repositories on any website. Features responsive design, caching, and beautiful repository cards with rich metadata.


Installation

Install the package via npm:

npm install repowidget

Usage

UMD (Browser)

Include the widget in your webpage using the UMD bundle:

<div id="my-repos"></div>
<script>
    import { createRepoWidget } from 'repowidget';
    RepoWidget.createRepoWidget({
        username: 'github-username',
        containerId: 'my-repos',
    });
</script>

ESM (Module)

Use the widget as a module:

<div id="my-repos"></div>
<script type="module">
    import { createRepoWidget } from 'repowidget';
    createRepoWidget({
        username: 'github-username',
        containerId: 'my-repos',
    });
</script>

Configuration Options

OptionTypeDefaultDescription
usernamestringrequiredYour GitHub username
containerIdstringrequiredID of the container element
columnsobject{mobile: 1, tablet: 2, desktop: 3}Number of columns for different screen sizes
cardStylesobject{}Custom styles for repository cards
textStylesobject{}Custom styles for text elements
scaleOnHovernumber/boolean1.05Scale factor on hover (0 or false to disable)
maxReposnumbercolumns.desktop * 2Maximum number of repositories to display
sortBystring'stars'Sort criteria ('stars', 'forks', 'size', 'name')

Styling Examples

Custom Card Styles

createRepoWidget({
    username: 'github-username',
    containerId: 'my-repos',
    cardStyles: {
        background: 'linear-gradient(145deg, #ffffff, #f0f0f0)',
        boxShadow: '5px 5px 15px #d1d1d1, -5px -5px 15px #ffffff',
    },
});

Custom Text Colors

createRepoWidget({
    username: 'github-username',
    containerId: 'my-repos',
    textStyles: {
        titleColor: '#2d3748',
        descriptionColor: '#4a5568',
        iconColor: '#718096',
    },
});

Features

  • Responsive grid layout
  • Local caching for better performance
  • Language color coding
  • Multiple sorting options
  • Hover animations
  • Configurable display limits

License

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

1.0.9

7 months ago

1.0.8

7 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago