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

@lux-ok/sv5tiptap

v0.0.6

Published

Tiptap Editor for Svelte5

Downloads

3

Readme

sv5tiptap - A simple rich editor for svelte 5

This component library is not a perfect editor, and compared to other open-source projects, its features are quite limited. The main goal of this small project is to provide a basic rich editor for your Svelte development or testing with Tiptap.

sv5tiptap is primarily based on Svelte 5, Tiptap 2, Tailwind 4, DaisyUI 5, Lucide icons and was developed using the latest versions of these frameworks, as detailed in the package.json. It does not rely on many custom extensions; only two existing open-source extensions were used to implement image and font size functionality. If you need more features, you are welcome to develop extensions yourself. Tiptap provides detailed documentation for this, though it can be a time-consuming challenge.

Currently, there is no user manual, and the code lacks comments, as I haven’t had enough time to complete this yet. However, I plan to continue optimizing it and add clear documentation after using it for a short period in my project. Although there are no official documents yet, most of the code follows the basic usage of Svelte, Tiptap, and Tailwind.

At this moment, sv5tiptap may not be perfect, but for me and many users, it indeed fills the need for a simple CMS editor within Svelte projects. I hope it proves useful to you or at least inspires you.

This library is licensed under the MIT License.

Welcome any suggestions or contributions.

This library uses the following packages. Thanks a lot!

  • Tiptap V2
  • Tailwind CSS V4
  • DaisyUI V5
  • Lucide icons
  • tiptap-extension-resize-image: GitHub
  • tiptap-extension-font-size: GitHub

Installation

npm install @lux-ok/sv5tiptap

also your target project need to installed the following packages:

"peerDependencies": {
  "svelte": "^5.0.0", // dev
  "tailwindcss": "^4.0.0", // dev
  "@tailwindcss/typography": "^0.5.15", // dev
  "daisyui": "^5.0.9", // dev
}

svelte 5 Usage

<script lang="ts">
	import { htmlContent, jsonContent, jsonToHtml, TiptapEditor } from '@lux-ok/sv5tiptap';
	import type { EditorType } from '@lux-ok/sv5tiptap';
	import { onMount } from 'svelte';

	/**
	 * You can put html or json content to display the default content when the editor is instantiated.
	 * If content is set to undefined, sv5tiptap will load the demo content.
	 * or you only need blank content: content = ‘’
	 */
	let content = undefined;
	let editor = $state<EditorType>();
	let html = $state<string>();

	onMount(() => {
		// This is not necessary, you can use getJSON() or getHTML() anytime like save json to database
		html = jsonToHtml(jsonContent);
		editor?.on('update', () => {
			// callback on editor update
			console.log('updated');
			html = jsonToHtml(editor?.getJSON());
		});
	});
</script>

<div class="flex h-svh flex-row gap-4 overflow-hidden p-4">
	<TiptapEditor
		bind:editor
		{content}
		defaultToolbar={true}
		class="flex-1 rounded-md"
		editorClass="rounded-b-xs"
	/>

	<!-- For demo, not necessary -->
	<div class="prose max-w-full flex-1 overflow-auto rounded-md border p-4">
		{@html html}
	</div>
</div>
// src/app.css

@import 'tailwindcss';
@plugin '@tailwindcss/typography';
@plugin "daisyui";
@source "../node_modules/@lux-ok/sv5tiptap";

.prose {
	@apply text-base text-gray-700 dark:text-gray-300;

	h1,
	h2,
	h3 {
		@apply my-3;
	}
	h1 {
		@apply text-primary text-3xl font-bold;
	}
	h2 {
		@apply text-secondary text-2xl font-semibold;
	}
	p {
		@apply leading-relaxed;
	}
	ul {
		@apply marker:text-primary ml-5 list-outside list-disc;
	}
	ol {
		@apply marker:text-secondary ml-5 list-outside list-decimal;
	}
	blockquote {
		@apply border-primary border-l-4 pl-4 text-gray-600 italic dark:text-gray-400;
	}
	li p {
		@apply my-2;
	}
	hr {
		@apply my-3;
	}
	table {
		@apply table w-full rounded-lg border border-gray-300 dark:border-gray-600;
	}
	col {
		@apply w-auto;
	}
	th {
		@apply bg-base-200 dark:bg-base-300 border border-gray-300 p-2 text-base font-semibold dark:border-gray-600;
	}
	td {
		@apply border border-gray-300 p-2 dark:border-gray-600;
	}
	th p,
	td p {
		@apply my-0 min-h-6;
	}
	pre code {
		@apply overflow-hidden text-wrap;
	}
	img {
		@apply mx-0 my-4;
	}
}

#toolbar {
  .lucide {
    stroke-width: 1.25;
    width: 20px;
    height: 20px;
  }

  .lucide * {
    vector-effect: non-scaling-stroke;
  }

  .btn {
    @apply text-xs font-medium;
  }
}