On this sectionProps

Props

The complete prop list for NotionLikeEditorBlock and NotionLikeEditorStatic, with the type, the default and the effect of every field.

The public entry point has no "use client" directive, so a server component can import from it. What needs the directive is the file that passes a function prop.

NotionLikeEditorBlock

The editor. With an adapter it loads and saves a stored document; without one it keeps the document in component state.

NameTypeDefaultDescription
documentIdstringrequiredThe document identity. The persisted editor is keyed by it.
initialValueEditorValueEMPTY_EDITOR_VALUEThe content of a new document. The default is one empty paragraph.
onChange(value: EditorValue) => voidnoneCalled with the value after each change.
readOnlybooleanfalseTurns editing off.
placeholderstringDEFAULT_PLACEHOLDERShown in an empty block. The default is "Type something, or type "/" for commands".
ariaLabelstring"Rich text editor"The accessible name of the editable.
classNamestringnoneAdded to the wrapper element.
adapterEditorPersistenceAdapternoneSelects persisted mode when present. Without it, the editor runs in memory mode.
linkPreviewLinkPreviewAdapter | nullnullFills bookmark previews.
mentionProviderMentionProvider | nullnullSearches and resolves people for mentions.
pageProviderPageProvider | nullnullSearches and resolves pages for page links.
onOpenPage(request: PageOpenRequest) => voidnoneCalled when a user opens a page link.
fileUploadFileUploadAdapter | nullnullUploads files and resolves their stored URLs. The image, video, audio and file blocks use it to show a stored URL that is not http, https or root-relative.
optionsEditorOptionsDEFAULT_EDITOR_OPTIONSTuning values for the handle, autosave, shortcut hints and the tail click.
featuresEditorFeaturesDEFAULT_EDITOR_FEATURESTurns feature groups off. Every group is on by default.

NotionLikeEditorStatic

The read-only renderer. It has no hooks, takes no adapters and calls nothing. It renders whatever the value contains, including content a feature switch has turned off.

NameTypeDefaultDescription
valueEditorValuerequiredThe document content to render.
classNamestringnoneAdded to the rendered element.

Exports

Everything the entry point re-exports. Anything not on this list is internal.

  • NotionLikeEditorBlock, NotionLikeEditorBlockProps
  • NotionLikeEditorStatic, NotionLikeEditorStaticProps
  • EditorValue, EMPTY_EDITOR_VALUE
  • EditorOptions, ResolvedEditorOptions, DEFAULT_EDITOR_OPTIONS
  • EditorFeatures, EditorFeature, EDITOR_FEATURES, DEFAULT_EDITOR_FEATURES
  • DEFAULT_PLACEHOLDER
  • createLocalStorageAdapter, EditorPersistenceAdapter
  • LinkPreviewAdapter
  • FileUploadAdapter, FileUploadOptions, UploadedFile
  • MentionProvider, MentionEntity
  • PageProvider, PageEntity, PageResolution, PageOpenRequest
In the installed copy, the entry point is @/components/blocks/notion-like-editor. The editor's own files can be imported directly from that folder if you need something the barrel does not export, such as SaveRequest; nothing outside the folder is public.

Related