An open API service indexing awesome lists of open source software.

https://github.com/vidschofelix/vite-plugin-svelte-anywhere

Use Svelte components anywhere
https://github.com/vidschofelix/vite-plugin-svelte-anywhere

svellte vite-plugin web-components

Last synced: 4 months ago
JSON representation

Use Svelte components anywhere

Awesome Lists containing this project

README

          

![logo](docs/public/logo.png)

# Vite Plugin: Svelte Anywhere

[![NPM Version](https://img.shields.io/npm/v/vite-plugin-svelte-anywhere)](https://www.npmjs.com/package/vite-plugin-svelte-anywhere)
[![NPM Downloads](https://img.shields.io/npm/d18m/vite-plugin-svelte-anywhere)](https://img.shields.io/npm/d18m/vite-plugin-svelte-anywhere)
[![Build Status](https://github.com/vidschofelix/vite-plugin-svelte-anywhere/actions/workflows/release.yml/badge.svg)](https://github.com/vidschofelix/vite-plugin-svelte-anywhere/actions)
[![License](https://img.shields.io/github/license/vidschofelix/vite-plugin-svelte-anywhere)](https://github.com/vidschofelix/vite-plugin-svelte-anywhere/blob/main/LICENSE)

**Use Svelte components anywhere HTML is accepted.**

This Vite plugin lets you define **custom elements** right inside your Svelte componentsโ€”just add an annotation, and you're ready to embed them in any environment, from static HTML to legacy backends or CMS platforms.

No boilerplate. No runtime shenanigans. Just Svelte, anywhere.

---

### Features

- ๐Ÿงฉ **Custom Elements from Svelte** โ€” Turn any Svelte component into a reusable HTML element with a single comment.
- ๐Ÿ›  **Zero Boilerplate** โ€” No manual registration or wrapper code.
- ๐Ÿ” **Dev + Prod Ready** โ€” Works with Vite HMR dev server and production builds
- ๐ŸŒ“ **Shadow DOM Control** โ€” Opt-in or out with simple config.
- โšก **Lazy/Eager/Custom Templates** โ€” Choose how your components are loaded.

---

### Links

- ๐Ÿ“š [Documentation](https://svelte-anywhere.dev)
- โœจ [Quickstart Guide](https://svelte-anywhere.dev/guide/quickstart)
- ๐ŸŽฎ [Live Demo](https://svelte-anywhere.dev/demo)

---

### Quick Example

```svelte

let { count = 0 } = $props();

count++}>
Clicked {count} times

```

Now just use it anywhere:
```html

```