Skip to content

Configuration Options

All options are passed as a single object to createRepoWidget().

createRepoWidget({ /* options here */ });
OptionTypeDefaultDescription
usernamestringRequiredGitHub username or organization name to fetch repositories from
containerIdstringRequiredid of the DOM element where the widget will render
maxReposnumberComputed from columnsMaximum number of repositories to display
sortBystring"stars"Sort criteria — see sortBy values
excludestring[][]Repository names to hide from the output
columnsobject{ mobile: 1, tablet: 2, desktop: 3 }Column counts per breakpoint — see columns object
scaleOnHovernumber1.05CSS scale on hover. Set to 1 or 0 to disable
cardStylesobject{}CSS property/value pairs applied to each card element
textStylesobject{}Color overrides for text elements — see textStyles properties

Type: string

The GitHub username or organization whose public repositories will be displayed.

createRepoWidget({ username: 'peterbenoit', containerId: 'repos' });
// or an org:
createRepoWidget({ username: 'microsoft', containerId: 'repos' });

Type: string

The id attribute of the HTML element that will receive the widget output.

<div id="my-repos"></div>
<script>
createRepoWidget({ username: 'peterbenoit', containerId: 'my-repos' });
</script>

Type: stringDefault: "stars"

ValueSorts by
"stars"Star count, descending
"forks"Fork count, descending
"size"Repository size, descending
"name"Alphabetical, ascending
"updated"Last-pushed date, most recent first
createRepoWidget({
username: 'peterbenoit',
containerId: 'repos',
sortBy: 'updated',
});

Type: string[]Default: []

An array of repository names to omit from the output. Names are matched exactly (case-sensitive).

createRepoWidget({
username: 'peterbenoit',
containerId: 'repos',
exclude: ['my-dotfiles', 'old-project', 'fork-i-never-touched'],
});

Type: number

Caps the number of repositories displayed. Applied after sorting, so combined with sortBy: "stars" it surfaces your top N most-starred repos.

createRepoWidget({
username: 'peterbenoit',
containerId: 'repos',
maxRepos: 6,
sortBy: 'stars',
});

Controls how many cards appear per row at each viewport width.

PropertyBreakpointDefault
mobile< 640px1
tablet640px – 1024px2
desktop> 1024px3
createRepoWidget({
username: 'peterbenoit',
containerId: 'repos',
columns: { mobile: 1, tablet: 3, desktop: 4 },
});

Type: numberDefault: 1.05

The CSS transform scale applied when a card is hovered. Values between 1.02 and 1.1 look natural. Set to 1 or 0 to disable.

scaleOnHover: 1.08 // more pronounced
scaleOnHover: 0 // disabled

Type: object

Any valid CSS property in camelCase format. Applied directly to each card’s inline style.

cardStyles: {
backgroundColor: '#f6f8fa',
borderRadius: '12px',
boxShadow: '0 4px 12px rgba(0,0,0,0.08)',
border: '1px solid #e1e4e8',
}
PropertyApplies to
titleColorRepository name
descriptionColorRepository description
iconColorStars and forks icons
sizeColorRepository size label
textStyles: {
titleColor: '#24292e',
descriptionColor: '#586069',
iconColor: '#6a737d',
sizeColor: '#959da5',
}