@canadies/svelte-customizable-quill
v1.0.5
Published
An easy to use and flexible quill editor for Svelte
Downloads
231
Maintainers
Readme
Svelte Customizable Quill Editor
An easy to use and flexible Quill editor for Svelte
Authors
Installation
Install with npm
npm i quill @canadies/svelte-customizable-quill
Basic Usage/Examples
<script>
import QuillEditor from "@canadies/svelte-customizable-quill"
import { onMount } from "svelte"
let data = "asdfasdf"
let Quill
let quillOptions = {
theme: "snow",
}
let quillReady = false
const typingEvent = (event) => {
const { text, html } = event?.detail ?? {}
data = html
}
onMount(async () => {
const quillModule = await import("quill")
Quill = quillModule.default
quillReady = true // Set the flag when Quill is ready
})
</script>
<svelte:head>
<link
rel="stylesheet"
href="https://unpkg.com/[email protected]/dist/quill.snow.css"
crossorigin
/>
</svelte:head>
{#if quillReady}
<h1>Hello</h1>
<QuillEditor
{Quill}
options={quillOptions}
{data}
on:typing={typingEvent}
/>
{/if}