ts-react-gist
A simple React component that embeds a github.com gist. Built with modern functional components and typescript.
Install Package
npm install @befreestudios/ts-react-gist
Component Propertieis
Name | Type | Required | Description |
---|---|---|---|
url |
string | The URL of the Gist repository or the permalink of an individual gist file. | |
filename |
string | Optional filename to include. |
Example Usage (single-file gist)
import React from 'react';
import TSReactGist from 'ts-react-gist';
function CODE_COMPONENT({ url }:TS_REACT_GIST): JSX.Element {
return url ? (
<div>
<TSReactGist url={url} />
</div>
) : null;
}
export default CODE_COMPONENT;
Example Usage (multi-file gist)
import React from 'react';
import TSReactGist from 'ts-react-gist';
function CODE_COMPONENT({ url, filename }:TS_REACT_GIST): JSX.Element {
return url ? (
<div>
<TSReactGist url={url} filename={filename} />
</div>
) : null;
}
export default CODE_COMPONENT;
Contributing
@todo
Security Policy
@todo