GithubHelp home page GithubHelp logo

chapeee / react-nextjs-github-gist Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 445 KB

A package help you to add Github gist in react and next on client side with username and avatar.

Home Page: https://www.npmjs.com/package/@myselfraj/react-nextjs-github-gist?

License: MIT License

TypeScript 100.00%
gist github-gist next react-gist next-gist

react-nextjs-github-gist's Introduction

React & nextJs Gist Loader

  • A package help you to add github gist in react and next client side with username and avatar.

Demo

https://www.myselfraj.com/eg/gist

Setup

npm i "@myselfraj/react-nextjs-github-gist"

Usage

"use client"
import GitGist from "@myselfraj/react-nextjs-github-gist";

//Somewhere in component or page 
<GitGist id={string} file={string} />

You can get the id from the Github url, kindly check the URL sample https://gist.github.com/{your_name}/{id}

Default Configuration

If no props are passed to <GitGist id="MUST" />, below is the default configuration applied.

<GitGist 
    file = "",
    width = '100%',
    height = '600px',
    getProfile = 'false',  //disables the feature that retrieves the avatar and name of the gist owner. Still you need to pass "UserName" manually, This Will depereacted in future releases to support UserName in advance Mode
    userName = '' //pass the username of the gist owner
/>

Currently, due to CORS (Cross-Origin Resource Sharing) restrictions, I am unable to fetch the username from GitHub using the Gist API. However, I plan to find a solution for this in future releases. In the meantime, we will have to resort to manual work. That's why you need to pass the userName parameter manually.


How i can contribute

  1. Fork the repo
  2. Make changes
  3. Create pull request
  4. We will review it and will merge it.

We are using Tsdx.

Love it Drop a star on github

https://github.com/chapeee/react-nextjs-github-gist

Authors

Connect with me

LinkedIn

Thanks to tleunen's code.

react-nextjs-github-gist's People

Contributors

chapeee avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.