Typix LogoTypix
CoreComponents

EditorContent

The editable content area of the editor

EditorContent renders the editable content area. It sets up the rich text plugin and provides a floating anchor element for menus.

Import

import { EditorContent } from '@typix-editor/react';

Usage

<EditorRoot>
  <EditorContent placeholder="Start writing..." />
</EditorRoot>

With custom class names

<EditorContent
  className="border rounded-lg p-4"
  classNames={{
    contentEditable: 'min-h-[200px] outline-none',
    placeholder: 'text-gray-400',
  }}
/>

With a ref

const ref = useRef<HTMLDivElement>(null);

<EditorContent ref={ref} placeholder="Type here..." />

Props

PropTypeDefaultDescription
childrenReactNodeAdditional content rendered inside the wrapper
placeholderstringPlaceholder text shown when the editor is empty
classNamestringCSS class for the outer container
classNamesobjectFine-grained class names (see below)

classNames object

KeyTypeDescription
scrollerstringScroller wrapper class
containerstringContent container class
contentEditablestringThe contenteditable element class
placeholderstringPlaceholder text class

Ref

EditorContent accepts a ref via forwardRef. The ref points to the outer <div> wrapper element.

On this page