Every extension

textAlign

Behaviour takes options 0.36 kB gzipped

Alignment as an attribute on existing blocks.

It is an extension rather than a node because alignment applies to whatever textblock is already there — turning a heading into a "centered heading" node type would double the schema for no gain. The attribute is declared here and lands on every type named, so a paragraph that knows nothing about alignment still keeps, renders and parses it.

Adding it

import { createEditor, document, paragraph, text, textAlign } from '@matrajs/core'

const editor = createEditor({
  extensions: [document, paragraph, text, textAlign({ … })],
  element: document.querySelector('#editor'),
})

There is no separate package · textAlign is already in @matrajs/core, and an extension you do not import is not in your bundle. document, paragraph and text are the floor every document needs.

Commands

Keys

← All 81 extensions

Edit this page on GitHub