@slate-editor/underline-plugin

SlateJS underline mark plugin.

Usage no npm install needed!

<script type="module">
  import slateEditorUnderlinePlugin from 'https://cdn.skypack.dev/@slate-editor/underline-plugin';
</script>

README

Nossas Cidades logo

@slate-editor/underline-plugin

SlateJS underline plugin.

npm package npm downloads

Installation

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

yarn add @slate-editor/underline-plugin

Usage

Here is a quick example to get you started:

import React from 'react'
import { SlateEditor, SlateToolbar, SlateContent } from 'slate-editor'
import { UnderlinePlugin, UnderlineButton } from '@slate-editor/underline-plugin'

const plugins = [
  UnderlinePlugin()
]

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

    <SlateContent />
  </SlateEditor>
)

export default SlateRichTextEditor

Keyboard Shortcut

OS Shortcut
Apple Logo + u
Windows Logo ctrl + u

API

Name Description
UnderlineMark Component that holds the html that will wrap the content with underline style.
UnderlineKeyboardShortcut Keyboard shortcut file that manipulates onKeyDown event inside SlateJS.
UnderlineUtils Generic file that holds the util common functions.
UnderlineButton Button component that have behaviour to wrap content with underline style.

TODO

  • Make keyboard shortcut accepts customization