Editor

Toolbar

Accessible formatting controls that follow the active Tiptap editor.

EditorToolbar is exported separately from @typseo/ui. TypseoEditor includes it by default; set showToolbar={false} to hide it and build your own controls.

'use client';

import { EditorContent } from '@tiptap/react';
import { useTypseoEditor } from '@typseo/react';
import { EditorToolbar } from '@typseo/ui';

export function CustomEditor() {
  const editor = useTypseoEditor();
  return (
    <>
      <EditorToolbar editor={editor} />
      <EditorContent editor={editor} />
    </>
  );
}

The native style picker offers Paragraph and H1–H6 with keyboard support. Bold, italic, underline, strikethrough, lists, undo, and redo expose accessible labels and disabled states; toggles also expose pressed state. Formatting uses StarterKit's existing commands, so it remains undoable and survives JSON or HTML serialization. Host CSS must provide visible focus indicators, contrast, and spacing. The toolbar operates on the editor instance; it does not own persistence or analysis.

Opt in to paragraph and heading alignment with useTypseoEditor({ textAlign: true }) or <TypseoEditor textAlign />. The toolbar then shows a native Left / Center / Right / Justify picker. Alignment is stored in Tiptap JSON and HTML; existing editors keep their current schema unless they opt in. Tiptap documents a Firefox limitation for justified text with white-space: pre-wrap.

Opt in to task lists with useTypseoEditor({ taskLists: true }) or <TypseoEditor taskLists />. The toolbar then shows a checkable-list button. Task items can be nested with Tab and Shift+Tab, and their checked state is serialized with the document. The host app is responsible for task-list styling.

See UI API for props.