@slate-editor/italic-plugin

5.1.0 • Public • Published
Nossas Cidades logo

@slate-editor/italic-plugin

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

OS Shortcut
Apple Logo +i
Windows Logo ctrl+i

API

Name Description
ItalicMark Component that holds the html that will wrap the content with italic style.
ItalicKeyboardShortcut Keyboard shortcut file that manipulates onKeyDown event inside SlateJS.
ItalicUtils Generic file that holds the util common functions.
ItalicButton Button component that have behaviour to wrap content with italic style.

TODO

  • Make keyboard shortcut accepts customization

Package Sidebar

Install

npm i @slate-editor/italic-plugin

Weekly Downloads

1,243

Version

5.1.0

License

MIT

Unpacked Size

8.21 kB

Total Files

10

Last publish

Collaborators

  • rolivegab
  • lpirola
  • igrsantos
  • alalbux
  • nossas