5.2.0-alpha.273b0e7e ā€¢ Published 6 years ago

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

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

SlateJS strikethrough plugin.

npm package npm downloads

Installation

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

yarn add @slate-editor/strikethrough-plugin

Usage

Here is a quick example to get you started:

import React from 'react'
import { SlateEditor, SlateToolbar, SlateContent } from 'slate-editor'
import { StrikethroughPlugin, StrikethroughButton } from '@slate-editor/strikethrough-plugin'

const plugins = [
  StrikethroughPlugin()
]

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

    <SlateContent />
  </SlateEditor>
)

export default SlateRichTextEditor

Keyboard Shortcut

OSShortcut
Apple LogoāŒ˜ + ^ + s
Windows Logoctrl + alt + s

API

NameDescription
StrikethroughMarkComponent that holds the html that will wrap the content with strikethrough style.
StrikethroughKeyboardShortcutKeyboard shortcut file that manipulates onKeyDown event inside SlateJS.
StrikethroughUtilsGeneric file that holds the util common functions.
StrikethroughButtonButton component that have behaviour to wrap content with strikethrough style.

TODO

  • Make keyboard shortcut accepts customization