Skip to content

GroupFieldInput

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

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,
defaultOpen: true,
defaultValue: {},
admin: {
hidden: false,
readOnly: false,
position: "main",
width: "full",
cellAlignment: "left",
}
}
@example
```ts
seo: group({
label: "SEO",
fields: {
title: text({ required: true }),
description: text(),
},
defaultOpen: false, // accordion starts collapsed
})
## See
- [GroupField](/api/core/src/interfaces/groupfield/) for the resolved output type
- [group](/api/core/src/functions/group/) for the config function that produces this type
## Extends
- [`BaseFieldInput`](/api/core/src/interfaces/basefieldinput/)\<`TFieldMeta`\>
## Type Parameters
### TFieldMeta
`TFieldMeta` *extends* `object` = \{ \}
## Properties
### admin?
> `optional` **admin?**: [`FieldAdminConfigInput`](/api/core/src/interfaces/fieldadminconfiginput/)
Defined in: packages/core/src/fields/baseTypes.ts:209
Admin UI configuration for this field.
#### Inherited from
[`BaseFieldInput`](/api/core/src/interfaces/basefieldinput/).[`admin`](/api/core/src/interfaces/basefieldinput/#admin)
***
### defaultOpen?
> `optional` **defaultOpen?**: `boolean`
Defined in: packages/core/src/fields/group/types.ts:62
Whether the accordion fieldset starts open in the admin form.
Defaults to `true`. Set `false` for secondary or rarely-edited groups
(e.g. SEO metadata on a page) to reduce visual noise on load.
***
### defaultValue?
> `optional` **defaultValue?**: `Record`\<`string`, `unknown`\>
Defined in: packages/core/src/fields/group/types.ts:55
Pre-filled value shown when creating a new document. Defaults to `{}`.
#### Overrides
[`BaseFieldInput`](/api/core/src/interfaces/basefieldinput/).[`defaultValue`](/api/core/src/interfaces/basefieldinput/#defaultvalue)
***
### description?
> `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.
#### Inherited from
[`BaseFieldInput`](/api/core/src/interfaces/basefieldinput/).[`description`](/api/core/src/interfaces/basefieldinput/#description)
***
### fields
> **fields**: `Record`\<`string`, [`AdminField`](/api/core/src/type-aliases/adminfield/)\>
Defined in: packages/core/src/fields/group/types.ts:53
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.
***
### index?
> `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.
#### Example
```ts
slug: { type: "text", index: "by_slug", required: true }
// Generates: .index("by_slug", ["slug"])

BaseFieldInput.index


optional interfaceDescription?: string

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

The JSDoc comment on the generated document interface property

BaseFieldInput.interfaceDescription


optional interfaceName?: string

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


optional label?: string

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

Display label for the field in the admin form.

BaseFieldInput.label


optional meta?: TFieldMeta

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

BaseFieldInput.meta


optional required?: boolean

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

Whether this field is required.

Default: false

BaseFieldInput.required