BaseFieldInput
Defined in: packages/core/src/fields/baseTypes.ts:501
Properties shared by all field types.
Every field type (text, number, checkbox, etc.) extends this interface
with its own type discriminant and type-specific options. These base
properties control labeling, validation, admin UI behavior, and database
indexing.
Defaults applied by field config functions:
{ label: "", // inferred from the field key by defineCollection required: false, // field is optional in the database schema admin: { ... } // see FieldAdminConfigInput for admin defaults}BaseField for the resolved type after defaults are applied
Extended by
Section titled “Extended by”TextFieldInputEmailFieldInputTextareaFieldInputJsonFieldInputNumberFieldInputCheckboxFieldInputSelectFieldInputRelationshipFieldInputDateFieldInputUrlFieldInputColorFieldInputArrayFieldInputGroupFieldInputUploadFieldInputRichTextFieldInput
Type Parameters
Section titled “Type Parameters”TCollectionSlug
Section titled “TCollectionSlug”TCollectionSlug extends VexResourceSlug = VexResourceSlug
TFieldKey
Section titled “TFieldKey”TFieldKey extends string = never
TFieldMeta
Section titled “TFieldMeta”TFieldMeta extends object = { }
Properties
Section titled “Properties”admin?
Section titled “admin?”
optionaladmin?:FieldAdminConfigInput<TCollectionSlug,ComponentHKT>
Defined in: packages/core/src/fields/baseTypes.ts:531
Admin UI configuration for this field.
defaultValue?
Section titled “defaultValue?”
optionaldefaultValue?:unknown
Defined in: packages/core/src/fields/baseTypes.ts:529
Pre-filled value shown in the admin form when creating a new field. Does not apply to database values
description?
Section titled “description?”
optionaldescription?:string
Defined in: packages/core/src/fields/baseTypes.ts:516
Semantic description of the field. Used in three places:
- Helper text rendered below the field input in the admin form UI.
- As the Zod
.meta({ description })value for form validation. - As the JSDoc comment on the generated document interface property.
To write a separate JSDoc comment, use interfaceDescription in addition.
index?
Section titled “index?”
optionalindex?:FieldIndexConfigInput<TCollectionSlug,TFieldKey>
Defined in: packages/core/src/fields/baseTypes.ts:545
Create a database index on this field. The string value becomes the index name in Convex.
Example
Section titled “Example”slug: { type: "text", index: "by_slug", required: true }// Generates: .index("by_slug", ["slug"])
author: { type: "relationship", index: { name: "by_author_status", additionalFields: ["status"] } }// Generates: .index("by_author_status", ["author", "status"])interfaceDescription?
Section titled “interfaceDescription?”
optionalinterfaceDescription?:string
Defined in: packages/core/src/fields/baseTypes.ts:518
The JSDoc comment on the generated document interface property
label?
Section titled “label?”
optionallabel?:string
Defined in: packages/core/src/fields/baseTypes.ts:507
Display label for the field in the admin form.
optionalmeta?:TFieldMeta
Defined in: packages/core/src/fields/baseTypes.ts:546
required?
Section titled “required?”
optionalrequired?:boolean
Defined in: packages/core/src/fields/baseTypes.ts:524
Whether this field is required.
Default: false
Methods
Section titled “Methods”validate()?
Section titled “validate()?”
optionalvalidate(props):void|Promise<void>
Defined in: packages/core/src/fields/baseTypes.ts:551
Server-only async validation, run after the generated Zod schema passes.
Parameters
Section titled “Parameters”FieldValidateProps<TCollectionSlug>
Returns
Section titled “Returns”void | Promise<void>