@slate-editor/bold-plugin

SlateJS bold mark plugin.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@slate-editor/bold-plugin
259305.1.04 years ago5 years agoMinified + gzip package size for @slate-editor/bold-plugin in KB

Readme

src="https://www.psdmockups.com/wp-content/uploads/2016/07/slatejs-520x292.jpg" alt="Nossas Cidades logo" title="Nossas Cidades" height="50" />

@slate-editor/bold-plugin


SlateJS bold plugin.
npm package npm downloads

Installation

The @slate-editor/bold-plugin is available as an npm package.
yarn add @slate-editor/bold-plugin

Usage

Here is a quick example to get you started:
import React from 'react'
import { SlateEditor, SlateToolbar, SlateContent } from 'slate-editor'
import { BoldPlugin, BoldButtonBar } from '@slate-editor/bold-plugin'

const plugins = [
  BoldPlugin()
]

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

    <SlateContent />
  </SlateEditor>
)

export default SlateRichTextEditor

Keyboard Shortcut

| OS | Shortcut | |--------------------------|----------| | !Apple Logoapple | +b | | !Windows Logowindows | ^+b |

API

| Name | Description | |----------------------|---------------------------------------------------------------------------| | BoldMark | Component that holds the html that will wrap the content with bold style. | | BoldUtils | Generic file that holds the util common functions. | | BoldButton | Button component that have behaviour to wrap content with bold style. | | BoldKeyboardShortcut | Keyboard shortcut file that manipulates onKeyDown event inside SlateJS. |

TODO

  • Make keyboard shortcut accepts customization