Skip to content

Ultra Form

Advanced forms for quickly building form UIs. Using pro-form requires the use of defineForm Functions.

Advanced forms are based on object-oriented functional programming concepts. The form data is abstracted as a JavaScript object, which can be manipulated and encapsulated for better reusability and maintainability.

UltraForm is a downward-compatible wrapper based on Naive Form, fully compatible with Naive features, and includes all data entry components. It also adds some preset behaviors and layouts, and provides a common API.

Form Props

NameTypeDefaultDescription
isUltraFormInstance-Instance of the component
gridbooleantrueEnable grid layout
cols`numberResponsiveDescription`24
x-gap`numberResponsiveDescription`0
y-gap`numberResponsiveDescription`0

For more parameters, see n-form and n-grid.

Form Methods

NameTypeDescription
validate(paths?: string[]) => Promise<void>Validate form items, filter by paths
resetValidate(paths?: string[]) => voidReset validation, filter by paths
resetFields(paths?: string[]) => voidReset form data to initial values, filter by paths

Field Methods

NameTypeDescription
config(config) => FieldAttach and return a new config
preventDefault() => FieldClear label and rules
preventRequired() => FieldRemove required from rules
preventAutofill() => FieldPrevent browser autofill
clone() => FieldShallow clone field
cloneDeep() => FieldDeep clone field

Field Types

NameDescription
date-pickerDate picker
auto-completeAuto complete
cascaderCascader
inputInput
input-numberInput number
rateRate
time-pickerTime picker
mentionMention
selectSelect
switchSwitch
sliderSlider
radioRadio
checkboxCheckbox
textareaTextarea

Slots

NameTypeDescription
toolbars()Toolbar content, enable toolbar mode by default

Released under the MIT License.