@befreestudios/ts-react-gist
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

ts-react-gist   CI Pipeline CodeQL CodeQL

A simple React component that embeds a github.com gist. Built with modern functional components and typescript.


Install Package

NPM

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

Package Sidebar

Install

npm i @befreestudios/ts-react-gist

Weekly Downloads

5

Version

1.1.0

License

MIT

Unpacked Size

12.5 kB

Total Files

7

Last publish

Collaborators

  • bpod