/react-embed-gist

Simple react component which can embed gist in your react application

Primary LanguageJavaScriptMIT LicenseMIT

React Embed Gist

NPM Downloads GitHub license GitHub last-commit GitHub issues-raw

Simple react component which can embed gist in your react application

How to use

Just import as dependency in your file and pass gist as parameter, for example:

import ReactEmbedGist from 'react-embed-gist';

// Only required attribute is gist
<ReactEmbedGist gist="msaracevic/5d757e2fc72482a9a4a439969500c2eb"
                wrapperClass="gist__bash"
                loadingClass="loading__screen"
                titleClass="gist__title"
                file=".bash_profile.sh"/>

Attributes

  • gist - gist you want to display, in a form of :USERNAME/:GIST_ID
  • file - optional, if you want to show just a single file from the gist, you can specify it here
  • titleClass - optional, if you want to pass your own class to h2 title of the gist
  • wrapperClass - optional, if you want to pass your own class to article wrapping the gist
  • loadingClass - optional, if you want to pass your own class to article wrapper which is displayed during loading time