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

@svelte-share/button

v0.0.1

Published

A button for sharing to social media in Svelte & SvelteKit.

Downloads

1

Readme

@svelte-share/button

A button for sharing to social media with Svelte.

Supported Components

There are multiple npm packages for their respective social medias.

  • @svelte-share/line
  • @svelte-share/x

Usage

Usage of the <ShareButton> component is only recommended if you would like to implement a social media that isn't supported already.

Custom button example

Below is an example of implementing a custom share button for the messaging app Line.

<script lang="ts">
  import { ShareButton } from '@svelte-share/button';

  const url = encodeURI(
    `https://social-plugins.line.me/lineit/share?url=https://twitter.com/marley_eng`
  );
</script>

<ShareButton {url} --share-button-background-color="#00b900" --share-button-hover-color="#00b900">
  <svg
    class="share-icon"
    slot="icon"
    aria-label="LINE"
    viewBox="0 0 512 512"
    xmlns="http://www.w3.org/2000/svg"
  >
    <path
      d="M512.017 227.437c-2.734 61.513-28.706 103.889-69.715 140.796-72.448 64.247-187.272 143.53-202.308 131.227-15.037-19.137 28.706-64.246-27.34-71.08C92.365 411.975.778 327.224.778 227.436c0-112.09 116.191-205.042 256.987-205.042 140.796 0 258.354 92.953 254.253 205.042z"
      fill="#fff"
      style="stroke-width:1.36695"
      transform="translate(0 -5.565)"
    /><path
      d="M413.596 223.24H367.12m46.476-49.21h-49.21v98.42h49.21m-168.135 0v-98.42l73.816 98.42v-98.42m-121.659 98.42v-98.42m-90.218 0v98.42h50.577"
      fill="none"
      stroke="#00b900"
      stroke-linecap="round"
      stroke-linejoin="round"
      stroke-width="24.25"
    />
  </svg>

  <span class="share-text"> 送る </span>
</ShareButton>

<style>
  .share-icon {
    width: 2em;
    height: 2em;
  }

  .share-text {
    font-size: 1.3em;
    font-weight: 600;
  }
</style>