Skip to content

TextareaFieldInput

Defined in: packages/core/src/fields/textarea/types.ts:51

Configuration input for a textarea() field.

Textarea fields store multi-line string values — bios, descriptions, internal notes, anything longer than a single-line text() field is comfortable holding. All properties are optional; unset properties fall back to the defaults listed below.

Defaults applied by textarea():

{
type: "textarea",
label: "", // inferred from the field key by defineCollection
required: false, // field is optional by default
rows: 4, // visible textarea rows
admin: {
hidden: false, // visible in the admin form
readOnly: false, // editable by default
position: "main", // placed in the main content column, not the sidebar
width: "100%", // spans the full form width, not half
cellAlignment: "left", // text aligned left in the data table column
}
}
// Minimal — label is inferred from the key ("Bio")
bio: textarea()
// Required with length validation and a taller textarea
bio: textarea({ required: true, min: 10, max: 500, rows: 8 })
// Min/max with a custom error message
notes: textarea({ max: [280, "Keep it under 280 characters."] })

BaseFieldInput for shared properties (label, description, required, admin, index)

TCollectionSlug extends VexResourceSlug = VexResourceSlug

TFieldKey extends string = never

TFieldMeta extends object = { }

optional admin?: FieldAdminConfigInput<TCollectionSlug, ComponentHKT>

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

Admin UI configuration for this field.

BaseFieldInput.admin


optional defaultValue?: string

Defined in: packages/core/src/fields/textarea/types.ts:60

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

BaseFieldInput.defaultValue


optional description?: string

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

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.

BaseFieldInput.description


optional index?: 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.

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"])

BaseFieldInput.index


optional interfaceDescription?: string

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

The JSDoc comment on the generated document interface property

BaseFieldInput.interfaceDescription


optional label?: string

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

Display label for the field in the admin form.

BaseFieldInput.label


optional max?: FieldLimitInput

Defined in: packages/core/src/fields/textarea/types.ts:64

Maximum character length config.


optional meta?: TFieldMeta

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

BaseFieldInput.meta


optional min?: FieldLimitInput

Defined in: packages/core/src/fields/textarea/types.ts:62

Minimum character length config.


optional required?: boolean

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

Whether this field is required.

Default: false

BaseFieldInput.required


optional rows?: number

Defined in: packages/core/src/fields/textarea/types.ts:70

Visible textarea rows in the admin form.

Default: 4


optional searchIndex?: FieldSearchIndex

Defined in: packages/core/src/fields/textarea/types.ts:77

Create a full-text search index on this field. The field this is defined on becomes the searchField.

FieldSearchIndex

optional validate(props): void | Promise<void>

Defined in: packages/core/src/fields/textarea/types.ts:79

Server-only async validation with value typed as string.

FieldValidateProps<TCollectionSlug, string>

void | Promise<void>

FieldValidate

BaseFieldInput.validate