Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/toughyear/react-github-gists
Simple and powerful react component to embed a single gist or all gists from a user in your react application.
https://github.com/toughyear/react-github-gists
api gist github javascript react
Last synced: 9 days ago
JSON representation
Simple and powerful react component to embed a single gist or all gists from a user in your react application.
- Host: GitHub
- URL: https://github.com/toughyear/react-github-gists
- Owner: toughyear
- Created: 2020-06-28T18:19:05.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-05T02:59:25.000Z (almost 2 years ago)
- Last Synced: 2024-11-28T07:07:49.755Z (about 1 month ago)
- Topics: api, gist, github, javascript, react
- Language: JavaScript
- Homepage: https://toughyear.github.io/react-github-gists/
- Size: 2.99 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
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](https://github.com/msaracevic/react-embed-gist)
[![NPM](https://img.shields.io/npm/v/react-github-gists.svg)](https://www.npmjs.com/package/react-github-gists) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
## Install
```bash
npm install --save react-github-gists
```## Usage
Import in your react component.
This component takes two props:
1. user (required)
2. 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:
```jsx
import ReactGithubGists from "react-github-gists";// This will embed all the gist from user
// This will embed a particular gist
```
## Attributes
- `user` - username of which you want to display the gist of.
- `gistID` -_optional_, gist you want to display
- `file` - _optional_, if you want to show just a single file from the gist, you can specify it here
- `wrapperClass` - _optional_, if you want to pass your own class to `article` wrapping the gist
- `titleClass` - _optional_, if you want to pass your own class to `h2` title of the gist
- `contentClass` - _optional_, if you want to pass your own class to `section` wrapping the content
- `errorClass` - _optional_, if you want to pass your own class to `article` wrapping the error message
- `loadingClass` - _optional_, if you want to pass your own class to `article` wrapper which is displayed during loading time## License
MIT © [Rajeev Singh Naruka](https://github.com/toughyear)