@slate-editor/strikethrough-plugin

5.1.0 • Public • Published
Nossas Cidades logo

@slate-editor/strikethrough-plugin

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

OS Shortcut
Apple Logo + ^ + s
Windows Logo ctrl + alt + s

API

Name Description
StrikethroughMark Component that holds the html that will wrap the content with strikethrough style.
StrikethroughKeyboardShortcut Keyboard shortcut file that manipulates onKeyDown event inside SlateJS.
StrikethroughUtils Generic file that holds the util common functions.
StrikethroughButton Button component that have behaviour to wrap content with strikethrough style.

TODO

  • Make keyboard shortcut accepts customization

/@slate-editor/strikethrough-plugin/

    Package Sidebar

    Install

    npm i @slate-editor/strikethrough-plugin

    Weekly Downloads

    811

    Version

    5.1.0

    License

    MIT

    Unpacked Size

    8.99 kB

    Total Files

    10

    Last publish

    Collaborators

    • rolivegab
    • lpirola
    • igrsantos
    • alalbux
    • nossas