richtext
richtext<
TCollectionSlug,TFieldKey,TFieldMeta>(options?):RichTextField<TCollectionSlug,TFieldMeta>
Defined in: packages/core/src/fields/richtext/config.ts:50
Creates a richtext field with all defaults applied.
Richtext fields store a single locale-agnostic rich-text document — body
copy, article content, anything requiring headings, marks, and inline
media rather than a plain string. Editing requires a configured editor
adapter on VexClientConfig (e.g. editor: plateEditor()); the admin
Input renders a configuration error, not markup, when it is absent.
Accepts RichTextFieldInput (all optional) and returns RichTextField with all defaults applied.
Defaults applied:
label—""(inferred from the field key bydefineCollection)required—falsedefaultValue—[]admin.hidden—falseadmin.readOnly—falseadmin.position—"main"admin.width—"100%"admin.cellAlignment—"left"
Type Parameters
Section titled “Type Parameters”TCollectionSlug
Section titled “TCollectionSlug”TCollectionSlug extends string = string
TFieldKey
Section titled “TFieldKey”TFieldKey extends string = never
TFieldMeta
Section titled “TFieldMeta”TFieldMeta extends BaseFieldMeta = BaseFieldMeta
Parameters
Section titled “Parameters”options?
Section titled “options?”RichTextFieldInput<TCollectionSlug, TFieldKey, TFieldMeta>
Richtext field configuration. All properties are optional.
Returns
Section titled “Returns”RichTextField<TCollectionSlug, TFieldMeta>
Resolved richtext field definition with all defaults applied.
Example
Section titled “Example”import { richtext, defineCollection } from '@vexcms/core'
posts: defineCollection({ fields: { // Minimal — label inferred from key ("Body") body: richtext(),
// Required field, e.g. an article summary excerpt: richtext({ required: true }), }})- RichTextFieldInput for the full input type
- RichTextField for the resolved output type