Skip to Content
SchemaAttribute Reference

Attribute Reference

Attributes define how each field is stored, validated, and rendered.

Attribute Shape

React
{
  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,
  },
  isSearchable: true,
  validation: (z) => z.string().min(1, { message: 'Status is required' }),
}

Required Keys

  • name: string
  • label: string
  • scope: 'local' | 'global' | 'relationship'
  • dataType: DataType
  • inputType: InputType

Optional Keys

  • defaultValue?: string
  • previewType?: PreviewType
  • isEditable?: boolean
  • isHidden?: boolean
  • isPrimary?: boolean
  • isUnique?: boolean
  • isSearchable?: boolean
  • options?: AttributeOptions[inputType]
  • relationship?: { entity: string; mode: 'single' | 'multiple'; field: string }
  • validation?: (z) => zodSchema

Scope

  • global: shared across all scopes.
  • local: scope-specific value.
  • relationship: relationship field/connection semantics.

Validation

Flexkit uses a zod callback.

React
validation: (z) => z.number().min(0, { message: 'Must be >= 0' })

Use validation for constraints that should block invalid input.

Flags

  • isPrimary: preferred display field in relationship UIs.
  • isUnique: marks uniqueness intention.
  • isSearchable: includes field in search behavior.
  • isEditable: false: renders as read-only.
  • isHidden: true: hides the field.

Relationship Attributes

When inputType: 'relationship', add:

React
relationship: {
  entity: 'company',
  mode: 'single',
  field: 'name',
}
  • entity: target entity name.
  • mode: single or multiple.
  • field: target attribute used for display/labeling.
Last updated on

© 2026