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.
| Name | Type | Default | Description |
|---|---|---|---|
| documentId | string | required | The document identity. The persisted editor is keyed by it. |
| initialValue | EditorValue | EMPTY_EDITOR_VALUE | The content of a new document. The default is one empty paragraph. |
| onChange | (value: EditorValue) => void | none | Called with the value after each change. |
| readOnly | boolean | false | Turns editing off. |
| placeholder | string | DEFAULT_PLACEHOLDER | Shown in an empty block. The default is "Type something, or type "/" for commands". |
| ariaLabel | string | "Rich text editor" | The accessible name of the editable. |
| className | string | none | Added to the wrapper element. |
| adapter | EditorPersistenceAdapter | none | Selects persisted mode when present. Without it, the editor runs in memory mode. |
| linkPreview | LinkPreviewAdapter | null | null | Fills bookmark previews. |
| mentionProvider | MentionProvider | null | null | Searches and resolves people for mentions. |
| pageProvider | PageProvider | null | null | Searches and resolves pages for page links. |
| onOpenPage | (request: PageOpenRequest) => void | none | Called when a user opens a page link. |
| fileUpload | FileUploadAdapter | null | null | Uploads 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. |
| options | EditorOptions | DEFAULT_EDITOR_OPTIONS | Tuning values for the handle, autosave, shortcut hints and the tail click. |
| features | EditorFeatures | DEFAULT_EDITOR_FEATURES | Turns 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.
| Name | Type | Default | Description |
|---|---|---|---|
| value | EditorValue | required | The document content to render. |
| className | string | none | Added 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
- Options for the fields inside the
optionsprop - Feature switches for the groups inside the
featuresprop