Giter VIP home page Giter VIP logo

preact-github-calendar's Introduction

Preact GitHub Calendar


preact-github-calendar is a small (1.3kb brotli) component library used for displaying a user's contribution calendar from GitHub. This component comes with customization options that you can use for making the component better adhere to the style of your application. Requests for additional customization options are always welcome.

Try out the demo!

Install

$ yarn add preact-github-calendar

Usage

import GitHubCalendar from 'preact-github-calendar';
import 'preact-github-calendar/style.css';

export default function App() {
    return <GitHubCalendar username="rschristian" />;
}

API

All options are entirely optional, no need to provide the options prop if you have no wish to customize anything. These only override the defaults; if you like the display, no need to change anything!

blockMargin

Type: number
Default: 2

Sets the margin to be used between the blocks in the component. This affects both the vertical and horizontal margins.

blockSize

Type: number
Default: 12

Sets the size of the blocks in the component. This affects both the vertical and horizontal dimensions.

contributionColorArray

Type: ['<color>', '<color>', '<color>', '<color>', '<color>']
Default: ['#ebedf0', '#9be9a8', '#40c463', '#30a14e', '#216e39']

Changes the color spread in the calendar. The first item in the array replaces the color for least commits, and the last item replaces the color for most commits. Like the labelColor option, keywords, RGB(A) and HSL(A) values are all supported as valid colors. Default is GitHub's color scheme.

labelFontSize

Type: number
Default: 14

Changes the font size of the month and days of the week labels.

showTooltip

Type: boolean
Default: true

Show a tooltip when hovering over calendar elements. Shows the number of contributions and the date for the element.

showWeekdaysLabels

Type: boolean
Default: false

Add the week day labels to the left axis of the graph.

License

MIT © Ryan Christian

preact-github-calendar's People

Contributors

dependabot[bot] avatar rschristian avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

davidrr48

preact-github-calendar's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.