@techstacker/tse-underline-plugin

5.2.0-alpha.273b0e7e • Public • Published
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

Package Sidebar

Install

npm i @techstacker/tse-underline-plugin

Weekly Downloads

0

Version

5.2.0-alpha.273b0e7e

License

MIT

Unpacked Size

8.58 kB

Total Files

10

Last publish

Collaborators

  • kandelborg
  • techstacker-owner