@slate-editor/list-plugin

5.1.0 • Public • Published
Nossas Cidades logo

@slate-editor/list-plugin

SlateJS list plugin.

npm package npm downloads

Installation

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

yarn add @slate-editor/list-plugin

Usage

Here is a quick example to get you started:

import React from 'react'
import { SlateEditor, SlateToolbar, SlateContent } from 'slate-editor'
import { ListPlugin, ListButtonBar } from '@slate-editor/list-plugin'

const plugins = [
  ListPlugin()
]

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

    <SlateContent />
  </SlateEditor>
)

export default SlateRichTextEditor

Keyboard Shortcut

OS Action Shortcut
Apple Logo Unordered List ^ + shift + l
Apple Logo Ordered List ^ + shift + n
Windows Logo Unordered List alt + shift + l
Windows Logo Ordered List alt + shift + n

API

Name Description
ListNode Component that holds the html that will wrap the content with list style.
ListKeyboardShortcut Keyboard shortcut file that manipulates onKeyDown event inside SlateJS.
ListUtils Generic file that holds the util common functions.
ListButtonBar Component that holds all action buttons to handle list behaviours.
UnorderedListButton Component that render ordered list button to handle its behaviour.
OrderedListButton Component that render unordered list button to handle its behaviour.

TODO

  • Make keyboard shortcut accepts customization

Package Sidebar

Install

npm i @slate-editor/list-plugin

Weekly Downloads

1,113

Version

5.1.0

License

MIT

Unpacked Size

18.3 kB

Total Files

15

Last publish

Collaborators

  • rolivegab
  • lpirola
  • igrsantos
  • alalbux
  • nossas