react-github-gists
v1.2.1
Published
Simple and powerful react component to embed a single gist or all gists from a user in your react application.
Downloads
5
Readme
react-github-gists
Simple and powerful react component to embed a single gist or all gists from a user in your react application.
Based on react-embed-gist by msaracevic
Install
npm install --save react-github-gists
Usage
Import in your react component.
This component takes two props:
- user (required)
- gistID (optional)
To embed a particular gist, use both the props. Else if you want to embed all the gists from a use, pass both props to the component.
For example:
import ReactGithubGists from "react-github-gists";
// This will embed all the gist from user
<ReactGithubGists user="toughyear" />
// This will embed a particular gist
<ReactGithubGists user="toughyear" gistID="486446951c7e082aac19568ea679af35" />
Attributes
user
- username of which you want to display the gist of.gistID
-optional, gist you want to displayfile
- optional, if you want to show just a single file from the gist, you can specify it herewrapperClass
- optional, if you want to pass your own class toarticle
wrapping the gisttitleClass
- optional, if you want to pass your own class toh2
title of the gistcontentClass
- optional, if you want to pass your own class tosection
wrapping the contenterrorClass
- optional, if you want to pass your own class toarticle
wrapping the error messageloadingClass
- optional, if you want to pass your own class toarticle
wrapper which is displayed during loading time
License
MIT © Rajeev Singh Naruka