1.1.0 • Published 2 years ago

@befreestudios/ts-react-gist v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

NameTypeRequiredDescription
urlstringThe URL of the Gist repository or the permalink of an individual gist file.
filenamestringOptional 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