Skip to content

Embed Gists into your React Project. Extends @GeorgeGkas's super-react-gist to support GitHub's dark mode.

License

Notifications You must be signed in to change notification settings

hfxbse/super-react-gist

 
 

Repository files navigation

super-react-gist

Simple and flexible component that allows you to embed GitHub Gists in React projects.

Features

  • 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.

Table of contents

Installation

Through NPM

To install through npm run:

npm install super-react-gist@github:hfxbse/super-react-gist

Component Properties

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.

Bugs and feature requests

Have a bug or a feature request? Please open a new issue.

Contributing

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.

License

Code released under the MIT License. See LICENSE.md for more details.

About

Embed Gists into your React Project. Extends @GeorgeGkas's super-react-gist to support GitHub's dark mode.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • CSS 62.5%
  • JavaScript 29.5%
  • MDX 8.0%