VVibeFlui

Field Schema

Field schema describes one form input.

Fields may be written as simple strings or full objects. Use strings for quick defaults and objects when you need labels, types, validation, options, visibility, adapters, or styling hooks.

String field

schemas/users/user-form.schema.ts

TS
export const simpleFormSchema = {
  version: "1.0.0",
  resource: "users",
  form: {
    fields: ["name", "email", "status"]
  }
} as const;

Object field

schemas/users/user-fields.ts

TS
export const fieldSchema = {
  name: "email",
  label: "Email",
  type: "email",
  required: true,
  placeholder: "ava@example.com",
  helperText: "Use a work email address.",
  validator: "users.email"
} as const;

Field properties

PropertyTypePurpose
namestringForm value key or path.
labelstringField label.
typestringField type.
valueFromstringSource path for edit/detail mapping.
editValueMode"fromRow" | "empty" | "default" | "hidden"Edit value behavior.
createValueMode"empty" | "default" | "hidden"Create value behavior.
defaultValueunknownDefault value.
hiddenbooleanHides the field.
disabledbooleanDisables interaction.
readonlybooleanMakes field readonly.
placeholderstringPlaceholder text.
helperTextstringHelp text.
componentstringRegistry component key.
adapterstringField adapter key.
validatorstringRegistry validator key.
requiredbooleanRequired flag for UI validation.
minnumberMinimum numeric value.
maxnumberMaximum numeric value.
minLengthnumberMinimum text length.
maxLengthnumberMaximum text length.
patternstringPattern string.
validationMessagestringValidation message.
transformerstringRegistry transformer key.
computedstringRegistry computed value key.
computedFromstring | string[]Source field dependencies for computed values.
visibleWhenobjectConditional visibility.
optionsarrayStatic options.
optionsEndpointstringEndpoint for dynamic options.
optionsDataPathstringResponse path for options.
optionLoaderstringRegistry option loader key.
optionLabelKeystringLabel key in option response rows.
optionValueKeystringValue key in option response rows.
classNamestringStyling hook.

Supported field types

TXT
text
email
password
number
textarea
select
multiselect
checkbox
checkbox-group
radio
radio-group
switch
date
datetime
time
file
image
hidden
color
range
json
code
richtext
markdown
tags
combobox
autocomplete
custom

Boolean and option controls

Use switch for toggle, on-off, and slide controls. Use checkbox for a normal checkbox. Use checkbox-group for multiple selections from options. Use radio or radio-group for single selection from options. Do not use checkbox-toggle; it is not an official field type in the current source.

Static options

schemas/users/user-fields.ts

TS
export const statusField = {
  name: "status",
  label: "Status",
  type: "select",
  options: [
    { label: "Active", value: "active" },
    { label: "Suspended", value: "suspended" }
  ]
} as const;

Registry options

schemas/users/user-fields.ts

TS
export const roleField = {
  name: "roleId",
  label: "Role",
  type: "select",
  optionLoader: "roles.options"
} as const;

Conditional visibility

schemas/users/user-fields.ts

TS
export const suspendedReasonField = {
  name: "suspendedReason",
  label: "Suspension reason",
  type: "textarea",
  visibleWhen: {
    key: "status",
    operator: "equals",
    value: "suspended"
  }
} as const;

Backend responsibility

Field validation improves UX. The backend must still validate every submitted value.