Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tleunen/react-gist
Github Gist React component
https://github.com/tleunen/react-gist
gist github github-gist react
Last synced: 3 days ago
JSON representation
Github Gist React component
- Host: GitHub
- URL: https://github.com/tleunen/react-gist
- Owner: tleunen
- License: mit
- Created: 2014-10-30T22:39:55.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T18:20:03.000Z (over 1 year ago)
- Last Synced: 2024-11-07T15:59:24.754Z (5 days ago)
- Topics: gist, github, github-gist, react
- Language: JavaScript
- Size: 14.6 KB
- Stars: 84
- Watchers: 4
- Forks: 22
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# react-gist
[![NPM](https://nodei.co/npm/react-gist.png)](https://nodei.co/npm/react-gist/)
Use this component to add a github gist on your website.
Preview
Get the id from the gist url `https://gist.github.com/{your_name}/{id}` and set it as a property of the component.
## Example
Single-file gist:
```js
var React = require('react');
var Gist = require('react-gist');React.render(
,
document.body
);
```[![Edit react-gist-example-single-file](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/reactgistexamplesinglefile-z9vkc?fontsize=14)
Multi-file gist:
```js
var React = require('react');
var Gist = require('react-gist');React.render(
,
document.body
);
```[![Edit react-gist-example-multi-file](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/reactgistexamplemultifile-9rw4g?fontsize=14)
## Usage
### ``
- `id` {string} Id of the gist
- `file` {string} Name of a specific file in a multi-file gist## License
MIT, see [LICENSE.md](http://github.com/tleunen/react-gist/blob/master/LICENSE.md) for details.