Skip to content

befreestudios-io/ts-react-gist

Repository files navigation

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

About

Modern Typescript React Component for embedding github gists into your project

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published