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

@seznam/pocitadlo-libi-se-react

v1.0.1

Published

Integration for the social Líbí se button by Seznam.cz for React-powered apps.

Downloads

16

Readme

Počítadlo Líbí se React component

React component for easier integration of the Líbí se social button by Seznam.cz.

Usage

First make sure you load the client script in the browser:

// Import the client script URL
import {BUTTON_SCRIPT_URL} from '@seznam/pocitadlo-libi-se-react'

// Add the following JSX snippet to the React component you use to render the
// <body> element or the <head> element:

<script src={BUTTON_SCRIPT_URL} async/>

// You may, optionally, also include the default styling provided by the
// '@seznam/pocitadlo-libi-se-common' package (a dependency of this package, it
// will be installed automatically). The styling will be used until the client
// script loads.
<link
  rel="stylesheet"
  href={
    // Replace the path below to the actual path on which the file will be
    // available in your project, or add the file to your styles bundle.
    'node_modules/@seznam/pocitadlo-libi-se-common/pocitadlolibise.css'
  }
/>

Now you may put a Líbí se button anywhere on your site (multiple vote buttons on single page are supported):

import PocitadloLibiSe from '@seznam/pocitadlo-libi-se-react'

// Put the following JSX snippet into any React component you want to render the
// social button:

<PocitadloLibiSe entity={entityUrl}/>

// Replace entityUrl with URL to the entity (article, video, ...) you want the
// votes counted on, e.g. "https://some-site.com/example-article".

There are multiple customization options at your disposal:

import {
  ButtonColorVariable,
  ButtonLayout,
  ButtonSize,
} from '@seznam/pocitadlo-libi-se-react'

<PocitadloLibiSe
  entity={entityUrl}
  layout={ButtonLayout.BOX_COUNT}
  size={ButtonSize.LARGE}
  colors={{
    [ButtonColorVariable.PRIMARY_COLOR]: '#222',
    [ButtonColorVariable.BACKGROUND_COLOR]: 'transparent',
    [ButtonColorVariable.HOVER_COLOR]: '#878787',
    [ButtonColorVariable.COUNT_COLOR]: '#757575',
    [ButtonColorVariable.ACTIVE_COLOR]: '#de0000',
  }}
  analytics={{
    payload: analyticsPayload, // Any JSON-serializable data
    position: 'optional information about the location of the button on page',
  }}
  placeholderHTML={`
    <span class="placeholder">
      HTML content shown until the client script loads
    </span>
  `}
/>