@cairocoder/svelte-typewriter

1.5.8 • Public • Published

Svelte Typewriter

A rich text editor for Svelte using Typewriter. WIP.

Installing

npm install --save @cairocoder/svelte-typewriter

import { Editor } from '@cairocoder/svelte-typewriter';

<Editor
toolbar={[
  [ 'heading' ],
  [ 'bold', 'italic', 'link', 'code' ],
  [ 'image' ]
]}
on:text-change={({ detail }) => {
  console.log(detail) // change, contents, oldContents, oldSelection, selection, source
}}
on:text-changing={({ detail }) => {
  console.log(detail) // change, contents, oldContents, oldSelection, selection, source
}}
on:selection-change={({ detail }) => {
  console.log(detail) // selection, oldSelection, source
}}
/>

screenshot

Upcoming

  • Custom Toolbar Button API
  • Tests

Package Sidebar

Install

npm i @cairocoder/svelte-typewriter

Weekly Downloads

1

Version

1.5.8

License

UNLICENSE

Unpacked Size

1.85 MB

Total Files

18

Last publish

Collaborators

  • cairocoder