JSPM

react-utterances-github-comments

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q20621F
  • License MIT

A lightweight React wrapper for Utterances GitHub comment system

Package Exports

  • react-utterances-github-comments

Readme

react-utterances-github-comments

๐Ÿ’ฌ A lightweight React wrapper for Utterances, the GitHub-powered comment widget.


โœจ Features

  • โœ… Lightweight and framework-agnostic (just React)
  • ๐Ÿ“ Uses GitHub issues to store comments
  • ๐ŸŽจ Theme support (light, dark, preferred-color-scheme)
  • ๐Ÿ’ป Ideal for blogs, documentation, or static sites

๐Ÿ“ฆ Installation

npm install react-utterances-github-comments

or

yarn add react-utterances-github-comments

๐Ÿš€ Usage

import GithubComments from 'react-utterances-github-comments';

function BlogPost() {
  return (
    <GithubComments
      repo="your-username/your-repo"
      issueTerm="pathname"
      theme="github-light"
      label="comentario"
      titleText="Deja tu comentario"
      loadingText="Cargando comentarios..."
    />
  );
}

โš™๏ธ Props

Prop Type Required Description
repo string โœ… GitHub repo in the format user/repo
issueTerm string โœ… How issues are matched: pathname, url, title, etc.
theme string โŒ Utterances theme (github-light, github-dark, etc.)
label string โŒ GitHub issue label
titleText string โŒ Title shown above the comment box
loadingText string โŒ Text shown while Utterances is loading
className string โŒ Custom class for the wrapping <section>

๐Ÿงช Example with dynamic theme switching

const [theme, setTheme] = useState('github-light');

return (
  <>
    <select onChange={(e) => setTheme(e.target.value)}>
      <option value="github-light">Light</option>
      <option value="github-dark">Dark</option>
      <option value="preferred-color-scheme">Auto</option>
    </select>

    <GithubComments
      repo="your-username/your-repo"
      issueTerm="pathname"
      theme={theme}
    />
  </>
);

๐Ÿ“„ License

MIT


โœ๏ธ Author

Made with โค๏ธ by Percy Chuzon
๐Ÿ“ง contacto@percychuzon.com
๐Ÿ”— GitHub