XinForm Dynamic Form
XinForm is a JSON-driven dynamic form component that supports three display modes (normal form, modal form, drawer form), along with advanced features like field dependencies, grid layout, and custom rendering.
Three Layout Modes
Basic Usage
Form Mode
ModalForm Mode
DrawerForm Mode
Grid Layout
When grid mode is enabled, form items are arranged using Col layout, with each item defaulting to 12 columns (half a row).
You can also specify colProps for individual fields, which will be merged with the global colProps:
Field Dependencies
Use the dependency configuration to implement field-level interactions, including show/hide, enable/disable, and dynamic properties.
FieldDependency Configuration
FormColumn Configuration
Each columns item supports all Ant Design Form.Item properties, plus the following extended properties:
Supported valueTypes
Submitter Bar Configuration
Hide the Submitter Bar
Custom Button Text
Custom Button Props
Fully Custom Submitter Bar
SubmitterProps Configuration
Note: Close button is not displayed in Form mode; it is displayed in ModalForm / DrawerForm.
XinFormRef Instance Methods
Use formRef to access the form instance, which supports all Ant Design Form methods plus the following extensions:
XinFormProps Full Reference
Also inherits all properties from
FormProps<T>exceptonFinish, so you can directly passinitialValues,labelCol, etc.
Complete Example
The following example demonstrates a user creation drawer form with grid layout and field dependencies: