Every extension

focus

Behaviour takes options 0.15 kB gzipped

A class on the block the caret is in.

What a focus mode dims everything else against, and what a block toolbar anchors to. A decoration rather than an attribute, so the document never knows which block was being looked at.

Adding it

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

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

There is no separate package · focus 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.

Options

Field Type
className string The class put on the block the caret is in. Default `has-focus`.
ancestors boolean Also mark every ancestor block — the list around the item. Default false.

← All 81 extensions

Edit this page on GitHub