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 🙏

© 2026 – Pkg Stats / Ryan Hefner

svelte-tag

v5.0.0

Published

webcomponent wrapper for svelte

Readme

Svelte-tag

Node.js Package

A web component wrapper for Svelte. Embeds your Svelte app or components inside custom elements using the light DOM or shadow DOM. Automatically forwards all slots and attributes to your Svelte app.

Why?

Svelte already allows you to create web components. However, it has a couple of flaws:

  • All of your nested components have to be web components as the render flag applies to everything.
  • You have to use shadow DOM.
  • You have to deal with lots of bugs.
  • You loose many features Svelte has for inter-component communication.

How do I use it?

For svelte 3 & 4 use version 1 of the tag, for svelte 5, use version 5.

# eg svelte 4
npm install svelte-tag@1

# eg svelte 5
npm install svelte-tag@5
import SvelteTag from "svelte-tag"
import App from "your-app.svelte"

new SvelteTag({
	component: App,
	tagname: "hello-world",
	href: "/your/stylesheet.css",
	attributes: ["name"]
})

Now anywhere you use the <hello-world> custom element tag, you'll get a Svelte app. Note that you must set your tag name to anything containing a dash.

<hello-world name="Cris"></hello-world>

| Option | Description | | ---------- | ------------------------------------------------------------------ | | component | Your Svelte component | | tagname | The webcomponent tag-name, must contain a dash | | href | link to your stylesheet - optional, but required with shadow dom | | attributes | array - attributes you like your tag to forward to your component | | shadow | boolean - should this component use shadow dom |

Support

Be aware, I don't have a lot of time to support this package. I've mainly open sourced it because I've noticed lots of people with similar use cases. If you open an issue I'll respond but it may not be super quick. I'll accept pull requests to fix any issues, but I'd prefer not to add additional functionality.

Note:

The svelte 5 version was only recently created and has had significant changes to fall in-line with new apis. Please specify which version you're using if you encounter any issues.

Attribution

Logo - Rich Harris, MIT http://opensource.org/licenses/mit-license.php, via Wikimedia Commons