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

chrome-web-share

v2.0.9

Published

A lightweight React Share Button for mobile web with web share api integration, native intent support and fallback

Downloads

13

Readme

chrome-web-share

A lightweight React share button for mobile web with Web Share API integration, native intent support and modal fallback.

Features

  1. Web Share API
  2. Share Modal Fallback for browsers lacking support
  3. Share via Whatsapp, FB, Twitter, E-Mail or copy to clipboard

Installation

npm install chrome-web-share --save
yarn add chrome-web-share

Basic Usage

JSX

import ShareBtn from 'chrome-web-share';

<ShareBtn
  shareUrl={url}
  disabled={['whatsApp']]
  shareText={text}
  className='my-class-name'
  buttonText='Share Profile'
/>

CSS

@import "chrome-web-share/dist/ShareBtn";

Options

<ShareBtn/> Component

prop|default|description ----|-------|----------- shouldCloseOnEscape|false|Whether or not the fallback modal should close when the user hits the escape key on desktop disabled|[]|An array of button names to be disabled className|''|Custom classname, you can style your button with this fbAppId|''|Required if you are planning on sharing to Facebook fbDisplayType|'touch'|The type of share window that will be launched to support different devices. E.g. mobile, tablet, or desktop. shareUrl|''|The URL you want to share shareMessage|''|The Text before the URL (E.g. Hey checkout this awesome thing I'm sharing!!) buttonText| Share |The text that will appear for the share button onButtonClick| () => {} |A callback function when the share button gets clicked onCopySuccess| () => {} |A callback function that fires when the user has copied some text, also contains the text sharedBy| (medium) => {console.log('shared via ', medium)}|A callback function when user clicks on any share medium from share modal

Button Names

Used for disabling a button with the disabled prop.

Can also be imported using the included util. E.g.

import { BUTTON_TYPES } from 'chrome-web-share'
  • WhatsApp
  • Facebook
  • Twitter
  • Gmail
  • Copy

Development

git clone https://github.com/martinwheeler/chrome-web-share
cd chrome-web-share
yarn install
yarn storybook

Open an issue before opening a PR.

License

MIT