Field Properties
Fields are configured through form.fields.
Core properties
| Property | Type | Purpose |
|---|---|---|
name | string | Form value path. Supports nested paths through VibeFlui path helpers. |
label | string | Visible field label. Defaults from name. |
type | field type | Input type. Defaults by inference. |
valueFrom | string | Row path used when mapping edit/view values. Defaults to name. |
defaultValue | unknown | Default value used by default value modes and fallback row mapping. |
placeholder | string | Native input placeholder. |
helperText | string | Helper text below the control. |
className | string | Field wrapper class hook. |
State properties
| Property | Purpose |
|---|---|
hidden | Excludes the field from rendering and value mapping. |
disabled | Disables the input. |
readonly | Renders the input as read-only. |
visibleWhen | Conditionally renders the field. |
Registry properties
| Property | Registry slot |
|---|---|
component | registry.components |
adapter | registry.fieldAdapters |
validator | registry.validators |
transformer | registry.transformers |
computed | registry.computedResolvers |
optionLoader | registry.optionLoaders |
Example
TS
export const usersSchema = {
resource: "users",
form: {
fields: [
{
name: "profile.firstName",
label: "First name",
type: "text",
required: true,
minLength: 2,
helperText: "Use the user's legal first name."
},
{
name: "roleId",
label: "Role",
type: "select",
valueFrom: "role.id",
optionLoader: "users.roles"
},
{
name: "internalNotes",
type: "textarea",
visibleWhen: {
key: "roleId",
operator: "equals",
value: "admin"
}
}
]
},
registry: {
optionLoaders: ["users.roles"]
}
} as const;