API / @aionbuilders/nabu

NabuEditor

Component Stability: stable

The contenteditable root: renders the document of an editor and wires every event to the engine.

Related guide: Your first editor →

Usage

Svelte
<script>
  import { NabuEditor } from '@aionbuilders/nabu';
</script>

<NabuEditor />

Props

Props of NabuEditor
PropTypeDefaultDescription
engineoptionalNabunew Nabu()

The editor this component works on (a Nabu instance).

labeloptionalstringn/a

the accessible name of the editor (aria-label on the contenteditable root), e.g. "Chapter text".

labelledbyoptionalstringn/a

the id of the element that names it (aria-labelledby), for a visible <label>. Wins over label for assistive technology when both are set. No role is ever set on an editable root: it would flatten the headings inside.

readonlyoptionalbooleann/a

show the document without letting anyone edit it. Reactive (toggle it live). When omitted, the editor follows engine.readonly (the readonly option of the engine); when given, it sets engine.readonly.

Source: src/lib/blocks/Nabu.svelte