npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

with-utterances

v1.5.0

Published

React HOC for Utterance comment widget

Downloads

24

Readme

React ❤️ Utterances

WithUtterances is a React Higher-Order-Component for Super LightWeight Comments Widget named Utterances.

No need Duplicated DOM Bindings for each react component.

Just Wrap It!

  1. import withUtterances from 'with-utterances'
  2. Wrap your react component
  3. Pass your repo as a String
  4. Done!

Installation

npm i with-utterances
yarn add with-utterances

Usage

import withUtterances to the file which has component that you want to show utterances comment widget.

import withUtterances from 'with-utterances'


class PostPage extends React.Component {
    //...
}

// Or

const PostPage = () => {
    //...
}

export default withUtterances(PostPage, 'YOUR_REPO')

// Or to specify a theme

export default withUtterances(PostPage, 'YOUR_REPO', 'github-dark')

// Or to specfiy an issue term

export default withUtterances(PostPage, 'YOUR_REPO', 'github-light', 'og:title')


// Or to specfiy label for newly created issues
export default withUtterances(PostPage, 'YOUR_REPO', 'github-light', 'og:title', 'comments')

It uses your pathname as issue-term.

Supported Themes

By default Utterances comes with 6 choices for themes:

  • github-light - The normal Github style
  • github-dark - A dark mode in the style of Github
  • github-dark-orange - A custom dark orange mode in the style of Github
  • icy-dark - A custom blue glow theme
  • dark-blue - A custom blue and black theme
  • photon-dark - A custom dark grey and blue theme

More themes can be added with additional stylesheets.

Supported Issue Terms

  • pathname - Issue title which contains the path of the current page.
  • url - Issue title which contains the URL of the current page.
  • title - Issue title which contains the tab title of the current page.
  • og:title - Issue title which contains the Open Graph title meta.
  • <serach term> - Issue title which contains the given String.

PS. preload and prefetch Applied

It will make your Utterances Widget to load slightly faster. <3

PS. DEMO SITE

Demo Using withUtterance