Skip to content

VexEditorComponentProps

Defined in: packages/core/src/editor/types.ts:15

Props the react Input passes to a richtext editor adapter’s editorComponent for one form field.

mediaCollectionSlug and the media*/onMedia*/generateUploadUrl/ createMediaDocument props are present only when the field declares mediaCollectionSlug (Design Decision 6); an adapter that doesn’t support inline images may ignore all of them.

optional createMediaDocument?: (props) => Promise<{ mediaId: string; url?: string; }>

Defined in: packages/core/src/editor/types.ts:67

Creates the uploaded file’s media document, resolving to its id and — when the storage adapter resolves one synchronously at doc-creation time (the Convex adapter does, via ctx.storage.getUrl()) — its stored URL. An adapter without a synchronous URL omits it; callers fall back to a temporary local URL only as a last resort.

string

Record<string, unknown>

Promise<{ mediaId: string; url?: string; }>


optional description?: string

Defined in: packages/core/src/editor/types.ts:33

The field’s description/help text. Rendered visibly by the host field input; an adapter must not render it again.


optional generateUploadUrl?: () => Promise<string>

Defined in: packages/core/src/editor/types.ts:59

Mints a presigned upload URL for a new file, resolving to that URL.

Promise<string>


optional label?: string

Defined in: packages/core/src/editor/types.ts:28

The field’s label — for the editor’s accessible name. The host field input already renders it visibly; an adapter must not render it again.


optional mediaAltRequired?: boolean

Defined in: packages/core/src/editor/types.ts:43

Whether the media collection’s alt field is required — the adapter’s upload UI should enforce it before creating the document, exactly as the upload field’s own form does.


optional mediaCanLoadMore?: boolean

Defined in: packages/core/src/editor/types.ts:51

Whether the image picker has more results to page in.


optional mediaCollectionSlug?: string

Defined in: packages/core/src/editor/types.ts:37

The field’s configured inline-image target collection, if any.


optional mediaIsLoading?: boolean

Defined in: packages/core/src/editor/types.ts:55

Whether the image picker’s search results are loading.


optional mediaResults?: VexMediaDocument[]

Defined in: packages/core/src/editor/types.ts:45

Search results from the media collection, for the image picker.


optional mediaSearchTerm?: string

Defined in: packages/core/src/editor/types.ts:47

The image picker’s current search term.


name: string

Defined in: packages/core/src/editor/types.ts:23

The field’s name, used for accessibility attributes.


onChange: (value) => void

Defined in: packages/core/src/editor/types.ts:19

Called with the new value on every edit.

RichTextDocument

void


optional onMediaLoadMore?: () => void

Defined in: packages/core/src/editor/types.ts:53

Called when the image picker should load its next page of results.

void


optional onMediaSearchChange?: (term) => void

Defined in: packages/core/src/editor/types.ts:49

Called when the image picker’s search term changes.

string

void


optional onUploadNew?: () => void

Defined in: packages/core/src/editor/types.ts:57

Called when the user chooses to upload a new file instead of picking one.

void


optional placeholder?: string

Defined in: packages/core/src/editor/types.ts:35

Placeholder text shown when the document is empty.


optional readOnly?: boolean

Defined in: packages/core/src/editor/types.ts:21

Whether the field is read-only (versions/preview contexts).


value: RichTextDocument

Defined in: packages/core/src/editor/types.ts:17

The field’s current value.