Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@slate-editor/alignment-plugin

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@slate-editor/alignment-plugin

SlateJS alignment node plugin.

  • 5.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source
Nossas logo
Nossas Cidades logo

@slate-editor/alignment-plugin

SlateJS alignment plugin.

npm package npm downloads

Installation

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

yarn add @slate-editor/alignment-plugin

Usage

Here is a quick example to get you started:

import React from 'react'
import { SlateEditor, SlateToolbar, SlateContent } from 'slate-editor'
import { AlignmentPlugin, AlignmentButtonBar } from '@slate-editor/alignment-plugin'

const plugins = [
  AlignmentPlugin()
]

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

    <SlateContent />
  </SlateEditor>
)

export default SlateRichTextEditor

Keyboard Shortcut

OSActionShortcut
Apple LogoAlign Left + shift + l
Apple LogoAlign Center + shift + c
Apple LogoAlign Right + shift + r
Windows LogoAlign Leftalt + shift + l
Windows LogoAlign Centeralt + shift + c
Windows LogoAlign Rightalt + shift + r

API

NameDescription
AlignmentNodeComponent that holds the html that will wrap the content with alignment style.
AlignmentUtilsGeneric file that holds the util common functions.
AlignmentButtonBarComponent that holds all action buttons to handle the alignment behaviour.
AlignmentLeftButtonComponent that holds button to handle the left alignment behaviour.
AlignmentCenterButtonComponent that holds button to handle the center alignment behaviour.
AlignmentRightButtonComponent that holds button to handle the right alignment behaviour.
AlignmentKeyboardShortcutKeyboard shortcut file that manipulates onKeyDown event inside SlateJS.

TODO

  • Make keyboard shortcut accepts customization

Keywords

FAQs

Package last updated on 25 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc