@lexical/react/LexicalContentEditable
Type Aliases
ContentEditableElementProps
ContentEditableElementProps =
object&Omit<React.AllHTMLAttributes<HTMLDivElement>,"placeholder">
Defined in: packages/lexical-react/src/shared/LexicalContentEditableElement.tsx:26
Props for the ContentEditableElement component. In addition to an
editor, it accepts the standard <div> HTML attributes (except
placeholder), including the hyphenated aria-* attributes, which are the
preferred way to set ARIA properties. The camelCase aria* props (such as
ariaLabel) are also accepted but are retained only for backwards
compatibility.
Type Declaration
ariaActiveDescendant?
optionalariaActiveDescendant?:React.AriaAttributes["aria-activedescendant"]
ariaAutoComplete?
optionalariaAutoComplete?:React.AriaAttributes["aria-autocomplete"]
ariaControls?
optionalariaControls?:React.AriaAttributes["aria-controls"]
ariaDescribedBy?
optionalariaDescribedBy?:React.AriaAttributes["aria-describedby"]
ariaErrorMessage?
optionalariaErrorMessage?:React.AriaAttributes["aria-errormessage"]
ariaExpanded?
optionalariaExpanded?:React.AriaAttributes["aria-expanded"]
ariaInvalid?
optionalariaInvalid?:React.AriaAttributes["aria-invalid"]
ariaLabel?
optionalariaLabel?:React.AriaAttributes["aria-label"]
ariaLabelledBy?
optionalariaLabelledBy?:React.AriaAttributes["aria-labelledby"]
ariaMultiline?
optionalariaMultiline?:React.AriaAttributes["aria-multiline"]
ariaOwns?
optionalariaOwns?:React.AriaAttributes["aria-owns"]
ariaRequired?
optionalariaRequired?:React.AriaAttributes["aria-required"]
autoCapitalize?
optionalautoCapitalize?:HTMLDivElement["autocapitalize"]
data-testid?
optionaldata-testid?:string|null
editor
editor:
LexicalEditor
ContentEditableProps
ContentEditableProps =
Omit<ContentEditableElementProps,"editor"> & {aria-placeholder?:void;placeholder?:null; } | {aria-placeholder:string;placeholder: ((isEditable) =>null|JSX.Element) |JSX.Element; }
Defined in: packages/lexical-react/src/LexicalContentEditable.tsx:29
Props for the ContentEditable component. These are the
ContentEditableElementProps (minus editor, which is read from
context) plus an optional placeholder; when a placeholder is provided an
aria-placeholder string is also required for accessibility.
Variables
ContentEditable
constContentEditable:ForwardRefExoticComponent<ContentEditableProps&RefAttributes<HTMLDivElement>>
Defined in: packages/lexical-react/src/LexicalContentEditable.tsx:50
The editable surface of a Lexical editor: the contentEditable element that
users type into. Render it inside a LexicalComposer (it reads the
editor from context) and pass it to RichTextPlugin or
PlainTextPlugin. An optional placeholder is shown while the editor
is empty. The ref is forwarded to the underlying <div>.
ContentEditableElement
constContentEditableElement:ForwardRefExoticComponent<object&Omit<AllHTMLAttributes<HTMLDivElement>,"placeholder"> &RefAttributes<HTMLDivElement>>
Defined in: packages/lexical-react/src/shared/LexicalContentEditableElement.tsx:142
A lower-level building block for the editor's editable <div>. It binds the
given editor to the rendered element via
LexicalEditor.setRootElement, reflects the editor's editable state on
the contentEditable attribute, and applies the provided ARIA and HTML
attributes. Prefer ContentEditable, which reads the editor from
context and adds placeholder support, unless you need this extra control.