@slate-editor/grid-plugin

5.1.0 • Public • Published
Nossas Cidades logo

@slate-editor/grid-plugin

SlateJS grid plugin.

npm package npm downloads

Installation

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

yarn add @slate-editor/grid-plugin

Usage

Here is a quick example to get you started:

import React from 'react'
import { SlateEditor, SlateToolbar, SlateContent } from 'slate-editor'
import { GridPlugin, GridButtonBar } from '@slate-editor/grid-plugin'

const plugins = [
  GridPlugin()
]

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

    <SlateContent />
  </SlateEditor>
)

export default SlateRichTextEditor

Keyboard Shortcut

OS Action Shortcut
Apple Logo Add Grid + ^ + g
Apple Logo Split Row + ^ + r
Windows Logo Add Grid ^ + alt + g
Windows Logo Split Row ^ + alt + r

API

Name Description
GridNode Component that holds the html that will render the content with grid style.
GridRowNode Component that holds the html that will render the grid row.
GridCellNode Component that holds the html that will render the grid cell.
GridKeyboardShortcut Keyboard shortcut file that manipulates onKeyDown event inside SlateJS.
GridUtils Generic file that holds the util common functions.
GridButtonBar Component that holds all action buttons to handle the grid behaviour.
GridButton Component that handle behaviour to wrap content with grid style.
GridSplitRowButton Component that handle behaviour to split rows into the grid.

TODO

  • Make keyboard shortcut accepts customization

Package Sidebar

Install

npm i @slate-editor/grid-plugin

Weekly Downloads

650

Version

5.1.0

License

MIT

Unpacked Size

13.5 kB

Total Files

15

Last publish

Collaborators

  • rolivegab
  • lpirola
  • igrsantos
  • alalbux
  • nossas