# @slate-editor/alignment-plugin

> SlateJS alignment node plugin.

Latest version **5.1.0** (published 2018-10-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @slate-editor/alignment-plugin
pnpm add @slate-editor/alignment-plugin
yarn add @slate-editor/alignment-plugin
bun add @slate-editor/alignment-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.1.0 |
| Published | 2018-10-25 |
| First published | 2018-04-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 15.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 267 |
| Author | Nossas |
| Maintainers | gabrielrtakeda, nossas |
| Keywords | slate, rich-text, editor, react, slate-plugins |

## Links

- npm: https://www.npmjs.com/package/@slate-editor/alignment-plugin
- Repository: https://github.com/nossas/slate-editor
- Issues: https://github.com/nossas/slate-editor/issues
- npm.io page: https://npm.io/package/@slate-editor/alignment-plugin

## Dependencies (5)

- [exenv](https://npm.io/package/exenv.md) ^1.2.1
- [react](https://npm.io/package/react.md) ^16.2.0
- [classnames](https://npm.io/package/classnames.md) ^2.2.5
- [react-fontawesome](https://npm.io/package/react-fontawesome.md) ^1.6.1
- [@slate-editor/components](https://npm.io/package/@slate-editor/components.md) ^5.1.0

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 5.1.0 (latest) — 2018-10-25
- 5.0.0-alpha.9e6f4feb (canary) — 2018-04-20
- 5.0.0 — 2018-05-08
- 5.0.0-alpha.f4219f70 — 2018-04-20
- 5.0.0-alpha.03550d1c — 2018-04-20
- 5.0.0-alpha.c75189d0 — 2018-04-20
- 5.0.0-alpha.19a19572 — 2018-04-20
- 5.0.0-alpha.f2d763f7 — 2018-04-20
- 5.0.0-alpha.f7181996 — 2018-04-20

## README

<div align="center">
  <a href="https://www.en.nossas.org" rel="noopener" target="_blank">
    <img
      width="200"
      src="https://s3.amazonaws.com/hub-central/uploads/logo-nossas-20170517185909.svg"
      alt="Nossas logo"
      title="Nossas"
    />
  </a>
</div>
<div align="center">
  <img
    src="https://www.psdmockups.com/wp-content/uploads/2016/07/slatejs-520x292.jpg"
    alt="Nossas Cidades logo"
    title="Nossas Cidades"
    height="50"
  />
</div>

<h1 align="center">@slate-editor/alignment-plugin</h1>

<div align="center">

[SlateJS](https://github.com/ianstormtaylor/slate) alignment plugin.

[![npm package](https://img.shields.io/npm/v/@slate-editor/alignment-plugin.svg?maxAge=60)](https://www.npmjs.com/package/@slate-editor/alignment-plugin)
[![npm downloads](https://img.shields.io/npm/dt/@slate-editor/alignment-plugin.svg?maxAge=60)](https://www.npmjs.com/package/@slate-editor/alignment-plugin)

</div>

## Installation
The **@slate-editor/alignment-plugin** is available as an [npm package](https://www.npmjs.com/package/@slate-editor/alignment-plugin).

```sh
yarn add @slate-editor/alignment-plugin
```

## Usage
Here is a quick example to get you started:

```js
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

| OS                       | Action       | Shortcut                                          |
|--------------------------|--------------|---------------------------------------------------|
| ![Apple Logo][apple]     | Align Left   | <kbd>⌘</kbd> + <kbd>shift</kbd> + <kbd>l</kbd>    |
| ![Apple Logo][apple]     | Align Center | <kbd>⌘</kbd> + <kbd>shift</kbd> + <kbd>c</kbd>    |
| ![Apple Logo][apple]     | Align Right  | <kbd>⌘</kbd> + <kbd>shift</kbd> + <kbd>r</kbd>    |
| ![Windows Logo][windows] | Align Left   | <kbd>alt</kbd> + <kbd>shift</kbd> + <kbd>l</kbd>  |
| ![Windows Logo][windows] | Align Center | <kbd>alt</kbd> + <kbd>shift</kbd> + <kbd>c</kbd>  |
| ![Windows Logo][windows] | Align Right  | <kbd>alt</kbd> + <kbd>shift</kbd> + <kbd>r</kbd>  |

## API

| Name                      | Description                                                                    |
|---------------------------|--------------------------------------------------------------------------------|
| AlignmentNode             | Component that holds the html that will wrap the content with alignment style. |
| AlignmentUtils            | Generic file that holds the util common functions.                             |
| AlignmentButtonBar        | Component that holds all action buttons to handle the alignment behaviour.     |
| AlignmentLeftButton       | Component that holds button to handle the left alignment behaviour.            |
| AlignmentCenterButton     | Component that holds button to handle the center alignment behaviour.          |
| AlignmentRightButton      | Component that holds button to handle the right alignment behaviour.           |
| AlignmentKeyboardShortcut | Keyboard shortcut file that manipulates `onKeyDown` event inside SlateJS.      |

## TODO

- Make keyboard shortcut accepts customization

[apple]: https://cdn2.iconfinder.com/data/icons/designer-skills/128/apple-ios-system-platform-os-mac-linux-48.png
[windows]: https://cdn2.iconfinder.com/data/icons/designer-skills/128/windows-48.png

---
_Source: https://npm.io/package/@slate-editor/alignment-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
