Skip to content

GroupFieldInput

Defined in: packages/core/src/fields/group/types.ts:87

Configuration input for a group() field.

Group fields store a named set of sub-fields as a single nested object. All properties except fields are optional; unset properties fall back to the defaults applied by group().

Defaults applied by group():

{
type: "group",
label: "", // inferred from the field key by defineCollection
required: false,
defaultValue: {},
admin: {
hidden: false,
readOnly: false,
position: "main",
width: "100%",
cellAlignment: "left",
defaultCollapsed: false,
}
}
seo: group({
label: "SEO",
fields: {
title: text({ required: true }),
description: text(),
},
// Collapsed on load — secondary metadata, not the primary edit target.
admin: { defaultCollapsed: true },
})
  • GroupField for the resolved output type
  • group for the config function that produces this type

TCollectionSlug extends VexResourceSlug = VexResourceSlug

TFieldKey extends string = never

TFieldMeta extends object = { }

optional admin?: GroupFieldAdminConfigInput<TCollectionSlug>

Defined in: packages/core/src/fields/group/types.ts:103

Admin UI configuration for this field.

BaseFieldInput.admin


optional defaultValue?: Record<string, unknown>

Defined in: packages/core/src/fields/group/types.ts:101

Pre-filled value shown when creating a new document. Defaults to {}.

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


fields: Record<string, AdminField>

Defined in: packages/core/src/fields/group/types.ts:99

Sub-fields that form the object’s shape.

Accepts any AdminField value, including nested group() or array(). Each sub-field uses its own required setting for both Zod validation and Convex schema generation.


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 interfaceName?: string

Defined in: packages/core/src/fields/group/types.ts:102


optional label?: string

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

Display label for the field in the admin form.

BaseFieldInput.label


optional meta?: TFieldMeta

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

BaseFieldInput.meta


optional required?: boolean

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

Whether this field is required.

Default: false

BaseFieldInput.required

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

Defined in: packages/core/src/fields/group/types.ts:105

Server-only async validation with value typed as Record<string, unknown>.

FieldValidateProps<TCollectionSlug, Record<string, unknown>>

void | Promise<void>

FieldValidate

BaseFieldInput.validate