Officina UI
Components

Editor

Rich-text editor (TipTap) with bold, italic, lists, and headings, controlled as HTML.

Editor is a rich-text editor built on TipTap, with a toolbar for bold, italic, lists, and headings. It is controlled by an HTML string: pass value and onChange receives the updated HTML on every edit. Use it for comments, descriptions, or any content that needs light formatting; add a placeholder for the empty state.

Example

Preview
import { Editor } from '@officina/ui';
import { useState } from 'react';

function DescriptionEditor() {
  const [value, setValue] = useState('<p>Write something…</p>');
  return <Editor value={value} onChange={setValue} placeholder="Write a description…" />;
}

API

PropTypeDefaultDescription
onChange*(html: string) => void—Called with the updated HTML on every change.
value*string—Editor content as an HTML string (controlled).
placeholderstring—Placeholder shown while the editor is empty.

On this page