The nice form meta to define the form layout and fields.

interface NiceFormMeta {
    columnGap?: string | number;
    columns?: number;
    defaultViewWidget?: null | string | ReactComponent;
    defaultWidget?: null | string | ReactComponent;
    disabled?: boolean;
    fields: NiceFormField[];
    initialValues?: Record<string, any>;
    labelWidth?: string | number;
    layout?: any;
    name?: string;
    rowGap?: string | number;
    viewMode?: boolean;
    wrapperProps?: Record<string, any>;
}

Hierarchy (view full)

Properties

columnGap?: string | number

The column gap of the grid layout system.

columns?: number

How many columns in the grid layout system.

defaultViewWidget?: null | string | ReactComponent

The default widget component or widget id for fields in view mode. This overrides the defaultViewWidget in config.

defaultWidget?: null | string | ReactComponent

The default widget component or widget id for fields in edit mode. This overrides the defaultWidget in config.

disabled?: boolean

Whether the form is disabled (means all fields are disabled)

fields: NiceFormField[]

The fields of the form.

initialValues?: Record<string, any>

The initial values of the form.

labelWidth?: string | number

The label width of the field. It differs when using different adapters. For example, you can use 1-24 in antd, but it's unncessary in MUI.

layout?: any

?

name?: string

If you have mulitple forms in one page, you may set different names so that fields ids will not conflict.

rowGap?: string | number

The row gap of the grid layout system.

viewMode?: boolean

Whether the form is in view mode. If true, all fields will be rendered with viewWidget.

wrapperProps?: Record<string, any>

Deprecated.

Generated using TypeDoc