Simple and flexible component that allows you to embed GitHub Gists in React projects.
- Embed a single file from Gist repository!
- Embed multiple files from multiple Gist repositories!
- Embed the whole Gist repository!
- Easy usage: Just copy-paste the Gist's repository URL to embed the whole repository, or copy-paste the permalink of an individual file to include just that.
- Maximize Development Experience with custom error handling.
- Lightweight: ~9KB minified (~4kb if gzipped).
- Packaged as UMD module that can be loaded everywhere.
- Works both on secret and public repositories.
To install through npm run:
npm install super-react-gist@github:hfxbse/super-react-gist
Name | Type | Required | Description |
---|---|---|---|
url |
string | ✅ | The URL of the Gist repository or the permalink of an individual gist file. |
file |
string | Filename to include. | |
onLoad |
function | Callback triggered on Gist load. | |
onError |
function | Callback triggered on fetch error. | |
LoadingComponent |
Component | React component to render on Gist loading. | |
ErrorComponent |
Component | React component to render if Gist fetch fails. | |
colorMode |
string | Color mode to apply. Available values are light , dark , and auto . light is the default. |
Have a bug or a feature request? Please open a new issue.
Please read through our contributing guidelines in CONTRIBUTING.md file.
Editor preferences are available in the editor config for easy use in common text editors. Read more and download plugins at http://editorconfig.org.
Code released under the MIT License. See LICENSE.md for more details.