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