5.2.0-alpha.273b0e7e • Published 6 years ago

@techstacker/tse-italic-plugin v5.2.0-alpha.273b0e7e

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

SlateJS italic plugin.

npm package npm downloads

Installation

The @slate-editor/italic-plugin is available as an npm package.

yarn add @slate-editor/italic-plugin

Usage

Here is a quick example to get you started:

import React from 'react'
import { SlateEditor, SlateToolbar, SlateContent } from 'slate-editor'
import { ItalicPlugin, ItalicButton } from '@slate-editor/italic-plugin'

const plugins = [
  ItalicPlugin()
]

const SlateRichTextEditor = () => (
  <SlateEditor plugins={plugins}>
    <SlateToolbar>
      <ItalicButton />
    </SlateToolbar>

    <SlateContent />
  </SlateEditor>
)

export default SlateRichTextEditor

Keyboard Shortcut

OSShortcut
Apple Logo+i
Windows Logoctrl+i

API

NameDescription
ItalicMarkComponent that holds the html that will wrap the content with italic style.
ItalicKeyboardShortcutKeyboard shortcut file that manipulates onKeyDown event inside SlateJS.
ItalicUtilsGeneric file that holds the util common functions.
ItalicButtonButton component that have behaviour to wrap content with italic style.

TODO

  • Make keyboard shortcut accepts customization