Attribute Reference
Attributes define how each field is stored, validated, and rendered.
Attribute Shape
{
name: 'status',
label: 'Status',
scope: 'global',
dataType: 'string',
inputType: 'select',
defaultValue: 'active',
options: {
list: [
{ label: 'Active', value: 'active' },
{ label: 'Inactive', value: 'inactive' }
],
comment: 'Operational lifecycle status',
placeholder: 'Select a status',
size: 160,
},
searchable: true,
validation: (z) => z.string().min(1, { message: 'Status is required' }),
}Required Keys
name: stringlabel: stringscope: 'local' | 'global' | 'relationship'dataType: DataTypeinputType: InputType
Optional Keys
defaultValue?: DefaultValueByDataType[dataType]previewType?: PreviewTypehidden?: boolean | ((context) => boolean)readOnly?: boolean | ((context) => boolean)unique?: booleansearchable?: booleangroup?: string | string[]options?: AttributeOptions[inputType]relationship?: { entity: string; mode: 'single' | 'multiple'; field: string }validation?: (z) => zodSchema
defaultValue must match dataType: use a number for int and float, a boolean for boolean, and a
string for textual and temporal types. An empty string is accepted as the legacy “no default” value; omitting
defaultValue is preferred when no default is needed.
Scope
global: shared across all scopes.local: scope-specific value.relationship: relationship field/connection semantics.
Validation
Flexkit uses a zod callback.
validation: (z) => z.number().min(0, { message: 'Must be >= 0' });Use validation for constraints that should block invalid input. Currently-hidden and currently-read-only fields are not validated.
Flags
unique: marks uniqueness intention. Enforced at deploy for global non-asset attributes.searchable: includes the field in search indexing and the global search UI.hidden: hides the field in the form. A statictruealso hides the list column.readOnly: renders the field as read-only. Currently-read-only attributes are omitted from create/update mutations and skipped during form validation.
These are not the same as entity.menu.hidden, which hides the entity from the sidebar menu.
Field Groups
group assigns the attribute to one or more form tabs defined on entity.groups. This is not entity.menu.group (sidebar section). See Field Groups.
Conditional Fields
hidden and readOnly can be a static boolean or a synchronous callback. See Conditional Fields for examples and the callback reference.
Relationship Attributes
When inputType: 'relationship', add:
relationship: {
entity: 'company',
mode: 'single',
field: 'name',
}entity: target entity name.mode:singleormultiple.field: target attribute used for display/labeling.
Permission spaces
Use spaces: ['catalog'] to restrict a supported entity or global/local attribute to members of a deployed space. Membership in any listed space is sufficient. The effective display attribute cannot be space-bound, and relationship-scoped attributes cannot declare spaces. See permission spaces for deployment and assignment.