Skip to content

BaseFieldInput

Defined in: packages/core/src/fields/baseTypes.ts:183

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

TFieldMeta extends object = { }

optional admin?: FieldAdminConfigInput

Defined in: packages/core/src/fields/baseTypes.ts:209

Admin UI configuration for this field.


optional defaultValue?: unknown

Defined in: packages/core/src/fields/baseTypes.ts:207

Pre-filled value shown in the admin form when creating a new field. Does not apply to database values


optional description?: string

Defined in: packages/core/src/fields/baseTypes.ts:194

Semantic description of the field. Used in three places:

  1. Helper text rendered below the field input in the admin form UI.
  2. As the Zod .meta({ description }) value for form validation.
  3. As the JSDoc comment on the generated document interface property.

To write a separate JSDoc comment, use interfaceDescription in addition.


optional index?: string

Defined in: packages/core/src/fields/baseTypes.ts:220

Create a database index on this field. The string value becomes the index name in Convex.

slug: { type: "text", index: "by_slug", required: true }
// Generates: .index("by_slug", ["slug"])

optional interfaceDescription?: string

Defined in: packages/core/src/fields/baseTypes.ts:196

The JSDoc comment on the generated document interface property


optional label?: string

Defined in: packages/core/src/fields/baseTypes.ts:185

Display label for the field in the admin form.


optional meta?: TFieldMeta

Defined in: packages/core/src/fields/baseTypes.ts:221


optional required?: boolean

Defined in: packages/core/src/fields/baseTypes.ts:202

Whether this field is required.

Default: false