JSPM

@canadies/svelte-customizable-quill

1.0.5
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 14
    • Score
      100M100P100Q63337F
    • License MIT

    An easy to use and flexible quill editor for Svelte

    Package Exports

    • @canadies/svelte-customizable-quill

    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/quill@2.0.2/dist/quill.snow.css"
            crossorigin
        />
    </svelte:head>
    
    {#if quillReady}
        <h1>Hello</h1>
        <QuillEditor
            {Quill}
            options={quillOptions}
            {data}
            on:typing={typingEvent}
        />
    {/if}