Features
Libraries
Installation#
bash
pnpm dlx shadcn@latest add @zui/document-editor @zui/editor-tableUsage#
tsx
import type { DocJSON, IEditor } from '@zeroxsolutions/editor-core/document/core/index';
import { table } from '@/components/editor/document/features/table';
import { standardKit } from '@/components/editor/document/features/standard';
import { Editor } from '@/components/editor/document/react';tsx
const features = [standardKit(), table()];
function NotesEditor({ content }: { content: DocJSON }) {
return <Editor features={features} content={content} />;
}table adds tables of header and body cells, with columns that resize by dragging and cells that select as a range. Its slash item is "Table" and its command insertTable inserts a table of two rows and two columns.
Run the command on the editor that Editor hands to onReady, as Document Editor shows:
tsx
function insert(editor: IEditor) {
editor.run('insertTable');
}The Viewer draws the same block, with the same feature in its features, wherever a stored document is only read.