Skip to content

Commit be7d3ad

Browse files
committed
Update rendere api
1 parent 1757eca commit be7d3ad

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

packages/react-renderer-demo/src/app/pages/renderer/renderer-api.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Form Renderer provides a lot of customization via props.
3232
|<RouterLink href="/renderer/unmounting"><Link>clearOnUnmount</Link></RouterLink>|bool|Will clear values of unmounted components. You can also set this to specific component in the form schema.|false|
3333
|canReset|bool|Show/hide reset button.|false|
3434
|onReset|func|A reset callback. You don't need to manually clear the form values!||
35-
|onCancel|func|A cancel callback.||
35+
|onCancel|func|A cancel callback, which receives `values` as the first argument.||
3636
|onStateUpdate|func|A function which will be called with every form update, i.e. `({ values }) => setValues(values)`||
3737
|disableSubmit|array of strings|You can specify a form attributes (see [here](https://final-form.org/docs/final-form/types/FormState)) which will make the submit button disabled. |[ ]|
3838
|initialValues|object|An object of fields names as keys and values as their values.||
@@ -42,6 +42,30 @@ Form Renderer provides a lot of customization via props.
4242
|uiSchema|object|Use when you need to use mozilla schema.|{ }|
4343
|<RouterLink href="/renderer/validators"><Link>validate</Link></RouterLink>|func|A function which receives all form values and returns an object with errors.||
4444

45+
### Schema
46+
47+
The root object of the schema represents the <RouterLink href="/renderer/component-mapping#formwrapper"><Link>Form</Link></RouterLink> component, which accepts only these three props:
48+
49+
|Prop|Type|Description|
50+
|----|:--:|----------:|
51+
|label, title|node|<RouterLink href="/renderer/component-mapping#title"><Link>Title</Link></RouterLink> of the form. Optional.|
52+
|description|node|<RouterLink href="/renderer/component-mapping#description"><Link>Description</Link></RouterLink> of the form. Optional.|
53+
|fields|array of objects|<RouterLink href="/renderer/component-api"><Link>Components</Link></RouterLink> of the form. Required!|
54+
55+
#### Example
56+
57+
```javascript
58+
schema = {
59+
title: 'Your name',
60+
description: 'Add your name',
61+
fields: [{
62+
name: 'userName',
63+
label: 'Your name is',
64+
component: componentTypes.TEXT_FIELD,
65+
}]
66+
};
67+
```
68+
4569
</Grid>
4670
<Grid item xs={false} md={2}>
4771
<ListOfContents file="renderer/renderer-api" />

0 commit comments

Comments
 (0)